Sales Tax Calculator Formula

Understand the math behind the sales tax calculator. Each variable explained with a worked example.

Formulas Used

Sales Tax Amount

tax_amount = price * tax_rate / 100

Total Price

total_price = price + price * tax_rate / 100

Variables

VariableDescriptionDefault
pricePrice Before Tax(USD)100
tax_rateSales Tax Rate(%)8.25

How It Works

How to Calculate Sales Tax

Formula

Tax Amount = Price x (Tax Rate / 100) Total Price = Price + Tax Amount

Sales tax rates vary by state and locality. Always check your local rate for accuracy.

Worked Example

A $100 item with 8.25% sales tax.

price = 100tax_rate = 8.25
  1. 01Tax = $100 x 0.0825 = $8.25
  2. 02Total = $100 + $8.25 = $108.25

When to Use This Formula

  • Quickly calculating the total cost of a purchase including tax when shopping, to know exactly what you will pay at checkout.
  • Reverse-calculating the pre-tax price from a receipt total when you need to separate the base price from the tax amount for expense reporting.
  • Comparing the effective cost of a purchase across different states or jurisdictions with different tax rates to decide where to buy.
  • Invoicing clients in a state or country where you must itemize sales tax separately from the product or service price.
  • Budgeting for large purchases like furniture, appliances, or vehicles where the tax amount can be hundreds or thousands of dollars.
  • Determining the combined state and local tax rate when a purchase is subject to both, and calculating the total tax from the combined rate.

Common Mistakes to Avoid

  • Forgetting to combine state and local tax rates — many jurisdictions have a base state rate plus an additional city or county rate, and using only the state rate underestimates the tax.
  • Applying sales tax to items that are exempt — groceries, prescription medications, and clothing are tax-exempt in many states, and taxing them overstates the total.
  • Calculating tax on the tax-inclusive price instead of the pre-tax price — if a receipt shows $107 total and tax is 7%, the pre-tax price is $100 (107 / 1.07), not $107 minus 7% of $107.
  • Assuming the same tax rate applies everywhere in a state — local sales tax rates vary by city and county, sometimes by several percentage points within the same state.

Frequently Asked Questions

How is sales tax calculated?

Sales tax is calculated by multiplying the pre-tax price by the tax rate (as a decimal). For example, 8.25% tax on $100 = $100 x 0.0825 = $8.25.

How do I find the pre-tax price from a total?

Divide the total by (1 + tax rate as decimal). For example, $108.25 total with 8.25% tax: $108.25 / 1.0825 = $100.00.

Which US states have no sales tax?

Five US states have no statewide sales tax: Alaska, Delaware, Montana, New Hampshire, and Oregon. However, some local jurisdictions in Alaska do charge local sales taxes.

Is sales tax charged on services?

In most US states, sales tax applies to tangible goods but not to most services. However, this varies by state. Some states tax certain services like telecommunications, construction labor, or digital downloads. Always check your specific state rules.

Learn More

Guide

How to Calculate Sales Tax

Learn how to calculate sales tax on purchases and selling prices, how to back out tax from a total, understand origin vs. destination-based sourcing, and handle multi-state nexus.

Ready to run the numbers?

Open Sales Tax Calculator