StringToolsStringTools
Back to Blog
How to Calculate Sales Tax (and Work Backwards From a Total) — cover illustration
FinanceSeptember 1, 2026·9 min read·Mitul Mandanka

How to Calculate Sales Tax (and Work Backwards From a Total)

By Mitul Mandanka·Reviewed for accuracy·Last updated September 1, 2026

The Two Formulas You Actually Need

Sales tax has two directions. To add tax, multiply the pre-tax price by the rate and add it back: price x rate = tax, and price + tax = total. To strip tax out of a tax-inclusive total, divide rather than subtract: total divided by (1 + rate) gives the pre-tax price, and the remainder is the tax.

Key Takeaways

  • Adding tax: tax = price x rate, total = price + tax. A 48.00 item at an illustrative 7% combined rate carries 3.36 of tax and comes to 51.36.
  • Removing tax: pre-tax = total / (1 + rate). On that same 51.36 total at 7%, the answer is 48.00 with 3.36 of tax.
  • Multiplying a total by (1 - rate) is the single most common mistake in reverse tax maths, and it always under-states the pre-tax price.
  • The rate you apply is almost never a single published number. In the US it is a state base rate plus whatever the county, city and special districts stack on top.
  • Exempt lines do not simply get a lower rate. They are removed from the taxable subtotal entirely, which changes the effective percentage on the receipt.
  • Rates move. Treat any figure in an article, this one included, as illustrative and check a current source at the delivery address before you file or invoice.

This is general information, not tax advice. If you are collecting and remitting tax, the state revenue department is the authority, not a blog.

Adding Sales Tax to a Price

The forward direction is the easy one, and it is worth being precise about it anyway because the order of operations decides where the rounding lands.

Convert the percentage to a decimal by dividing by 100. An 8.25% rate becomes 0.0825. Multiply the pre-tax price by that decimal to get the tax, round the tax to the nearest cent, then add it to the price.

Take a 48.00 pre-tax price and run it at a spread of illustrative combined rates. Every figure below is rounded to the nearest cent at the tax line, which is what a point-of-sale system does.

Illustrative combined rateTax on 48.00Total
4.00%1.9249.92
6.00%2.8850.88
7.00%3.3651.36
8.25%3.9651.96
9.50%4.5652.56

Notice the shape of that column. Between 4% and 9.5% the tax on a single 48.00 purchase moves by 2.64. Scale that to a 4,800 equipment order and the same rate spread is a 264 difference. This is why getting the rate right matters more than getting the arithmetic right, and why the sales tax calculator keeps the state base rate and the local add-on in two separate fields rather than pretending there is one number to look up.

A shortcut worth knowing: you can go straight to the total by multiplying by (1 + rate). A 48.00 item at 7% is 48.00 x 1.07 = 51.36 in one step. It gives the same answer as the two-step version for a single line, though the two-step version is what you want when you need to show tax separately on an invoice, which in the United States you almost always do.

Working Backwards From a Tax-Inclusive Total

This is the direction people get wrong, and it is the direction that matters most in practice. You have a receipt total, or a credit-card line, or a price that already includes tax, and you need the pre-tax figure for bookkeeping, an expense claim, or a tax return.

The reasoning is short. If the total is the pre-tax price plus tax on that price, then:

total = price x (1 + rate)

Rearranged, that gives:

price = total / (1 + rate)

Then the tax is whatever is left: tax = total - price.

Work the 51.36 total back at each of the same illustrative rates and you can see how sensitive the answer is to the rate you assume.

Illustrative rate appliedPre-tax from 51.36Tax
4.00%49.381.98
6.00%48.452.91
7.00%48.003.36
8.25%47.453.91
9.50%46.904.46

Only the 7% row reconciles with the forward example, which is the point. Reversing a total without knowing the rate that was applied is guesswork. If you have the receipt, the rate is usually printed on it, or you can derive it: divide the tax line by the pre-tax subtotal.

The full method is worked step by step in how to remove sales tax from a total, including what to do when the receipt mixes taxed and untaxed lines.

Why Multiplying by (1 - Rate) Is Wrong

The tempting shortcut is to treat the tax as a slice of the total and multiply by (1 - rate). On a 51.36 total at 7% that gives 47.76, and a tax figure of 3.60. The correct answer is 48.00 and 3.36. The shortcut over-states the tax by 24 cents on a 51.36 purchase.

The error is not a rounding artefact. It has a closed form. The gap between the wrong answer and the right one is the total multiplied by rate squared, divided by (1 + rate):

error = total x rate x rate / (1 + rate)

At 7% that factor is roughly 0.458% of the total. At 10% it is about 0.909%. The error grows faster than the rate does, because it depends on the square of the rate.

TotalRateCorrect pre-taxWrong method pre-taxUnderstated by
107.004.00%102.88102.720.16
107.007.00%100.0099.510.49
107.0010.00%97.2796.300.97
1,075.007.00%1,004.67999.754.92
1,075.008.25%993.07986.316.76
1,075.0010.00%977.27967.509.77

The 107.00 at 7.00% row is the cleanest illustration in the table, because it is the exact inverse of adding 7% to 100.00. If the shortcut worked, it would return 100.00. It returns 99.51.

On one lunch receipt nobody cares. Across a year of expense claims, or a business reclaiming tax on thousands of tax-inclusive purchases, a consistent 0.5% understatement of every pre-tax figure is the kind of thing an auditor notices.

Building the Rate: State Base Plus Local Stacking

In the United States there is no national sales tax. Each state sets its own base rate, and then counties, cities, transit authorities and special districts layer their own rates on top of it. The number you pay at the till is the sum.

That stacking is why two shops a few miles apart can charge different amounts on the same item, and why a single statewide figure is often useless on its own. Some states have no local add-ons at all, so the base rate is the whole story. Others have local rates that average more than the state rate itself. A handful have no statewide sales tax but do have local taxes, so an assumed zero is wrong across much of the state.

There is a second complication: sourcing. Some states tax based on where the seller is (origin sourcing), others on where the buyer takes delivery (destination sourcing). For anything shipped, destination sourcing means the rate follows the delivery address, which can change street by street. The mechanics of all this, including why the spread between states is as wide as it is, are covered in why sales tax differs so much between states.

For current figures, the Tax Foundation's state and local sales tax tables are the usual starting point, and the state revenue department is the authority — California's CDTFA rate pages are a good example of what a primary source looks like. The sales tax calculator carries a state base-rate dropdown with its own as-of date printed beside it, plus a separate field for the local portion, precisely because the local portion is the part no national table can give you.

Several Items, Some of Them Untaxed

Real receipts are not one line. They are a basket, and some of the basket may be exempt: unprepared groceries in many states, clothing under a threshold in a few, prescription medicine almost everywhere.

An exempt line is not taxed at a reduced rate. It is pulled out of the taxable subtotal altogether. The method is: add up the taxable lines, apply the rate to that subtotal only, then add the exempt lines back at face value.

Say a basket at an illustrative 7% combined rate:

LineQtyAmountTaxable
T-shirt224.99 eachYes
Mug112.00Yes
Paperback18.50Exempt

The taxable subtotal is 49.98 + 12.00 = 61.98. Tax at 7% is 4.34. The full subtotal is 70.48, and the total is 74.82.

Now look at what the tax is as a share of that total: 4.34 divided by 74.82 is 5.80%, not 7%. That gap between the headline rate and the effective rate on the whole receipt is normal whenever any part of the basket is exempt, and it is the reason reversing a mixed receipt with a single rate gives the wrong answer. You have to split the taxed and untaxed lines first. Per-line exempt flags exist in the tool for exactly this case.

Rounding, and Why Receipts Disagree by a Cent

Tax on a single item rarely lands on an exact cent. 24.99 at 7% is 1.7493, which has to become 1.75 or 1.74 before it can be printed.

There are two defensible approaches, and they do not always agree:

  • Round each line's tax, then add the lines. This is what most point-of-sale systems do when tax is shown per line.
  • Add the untaxed lines, apply the rate once to the subtotal, then round once. This is what most receipts do, and what the worked example above does.

On the basket above, rounding per line gives 1.75 + 1.75 + 0.84 = 4.34, which happens to match the subtotal method's 4.34. On other baskets the two differ by a cent or two. Neither is an error; they are different conventions, and states publish rules about which they accept. The sales tax calculator uses the first convention: it rounds each line's tax to the cent and adds the rounded lines, so the total always reconciles with the rows on screen. If you check a mixed basket against it and the round-once-on-the-subtotal method gives you a cent more or less, that is the difference you are looking at. If you are reconciling a supplier invoice against your own calculation and you are out by a cent, this is almost always why, and it is not worth an email.

The practical rule for your own books: pick one convention, apply it consistently, and make sure the lines you show add up to the total you show. A summary that does not reconcile with its own rows is the thing that costs you time later.

A Short Checklist Before You Trust a Number

Run through this whenever a sales tax figure matters enough to be written down:

  • Do you know the combined rate, not just the state base rate? If the local portion is missing, the answer is low.
  • Is the rate the one for the delivery address, or the shop's address? In destination-sourcing states those are different questions.
  • Which direction are you going? If the input already includes tax, you divide by (1 + rate). You never multiply by (1 - rate).
  • Is anything in the basket exempt or at a reduced rate? If so, split the lines before you apply anything.
  • How old is the rate you are using? Rates change on legislative schedules, and a figure that was right last year may not be right today.
  • Does the total reconcile with the lines? If it does not, you have a rounding convention problem, not a maths problem.

For businesses that sell into more than one state, the registration and filing side is a separate problem from the arithmetic, and a much larger one. The Streamlined Sales Tax Governing Board publishes the multi-state simplification framework that many states follow, and the IRS small business pages are the right starting point for the federal side of your records. For anything you will file, get a rate lookup for the actual address and, if the amounts are material, an accountant.

If you just need the arithmetic done cleanly on a basket, the sales tax calculator does both directions, takes the state base and the local rate separately, and lets you flag individual lines as exempt. Related: sales tax vs VAT vs GST if you are dealing with prices from outside the US and wondering why they already include the tax.

Frequently Asked Questions

What is the formula for calculating sales tax?

To add tax: tax = pre-tax price x rate, and total = price + tax. A 48.00 item at an illustrative 7% combined rate carries 3.36 of tax for a 51.36 total. You can also go straight to the total by multiplying the price by (1 + rate): 48.00 x 1.07 = 51.36.

How do I work out the price before tax from a total?

Divide the total by (1 + rate). A 51.36 total at 7% gives 51.36 / 1.07 = 48.00 pre-tax, and the tax is the 3.36 remainder. Do not multiply the total by (1 - rate) — on that same total it returns 47.76 and over-states the tax by 24 cents.

Why does multiplying by (1 minus the rate) give the wrong answer?

Because the tax was charged on the smaller pre-tax price, not on the larger tax-inclusive total. Taking a percentage off the total removes too much. The size of the error is total x rate x rate / (1 + rate) — roughly 0.458% of the total at a 7% rate, and about 0.909% at 10%.

How do I find the combined sales tax rate for my address?

Start with the state base rate, then add the county, city and any special-district rates that apply at the address in question. Your state revenue department publishes an address-level lookup; national tables generally give the state base plus an average local figure, which is useful for estimating but not for filing.

How do I calculate tax when some items are exempt?

Add up only the taxable lines, apply the rate to that subtotal, then add the exempt lines back at face value. On a basket of 61.98 taxable and 8.50 exempt at 7%, the tax is 4.34 and the total is 74.82 — an effective 5.80% of the total, not 7%.

Is sales tax calculated on the price before or after a discount?

Generally on the discounted price, because tax applies to what the buyer actually pays. Manufacturer coupons and rebates are often treated differently from store discounts, because the seller still receives the full amount from a third party. The rules are state-specific, so check the state's guidance for the transaction type.

Sources and references

Tax Foundation's state and local sales tax tables (taxfoundation.org) · CDTFA rate pages (cdtfa.ca.gov) · Streamlined Sales Tax Governing Board (streamlinedsalestax.org) · IRS small business pages (irs.gov). Content was reviewed against these sources as of the last-updated date above; external figures and rules may change after publication.

Borrowing soon? Read the free loan guide.

What sets your interest rate, how to compare lenders on total cost, and the fees to watch for — plain-English, no sign-up.

Read the guide →