How to calculate sales tax on discounts and shipping
By Adrian Simpson, 20+ years running small web and IT businesses and doing this exact arithmetic on orders. First posted 2 Aug 2026; revised 14 Aug 2026.
Getting the total right is mostly about order of operations. Apply things in the wrong sequence and you'll be out by a small amount on every order, which is fine until somebody reconciles a year of them.
The order
2. Take off any discount → taxable amount
3. Apply the tax rate to that
4. Add shipping
5. Total
Discount before tax is the key step. The customer never paid the pre-discount amount, so there's nothing to tax on it.
Worked example
A $200 order, 10% off, 8% sales tax, $12 shipping.
Discount (10%): −$20.00
Taxable amount: $180.00
Tax (8%): +$14.40
Shipping: +$12.00
Total: $206.40
Tax the full $200 by mistake and you'd charge $16.00 instead of $14.40. A $1.60 error on one order. Across a thousand orders it's $1,600 you either overcharged customers or owe out of your own pocket.
Store discounts and manufacturer rebates
These look identical to the customer and are treated differently in many US states.
The logic is who ended up out of pocket. It varies by state, so check your own rules if you handle manufacturer coupons regularly.
Is shipping taxable?
Sometimes. It depends where you are, and there's no rule that holds everywhere.
A rough guide for the US: if shipping is stated separately on the invoice, many states don't tax it. If it's rolled into the item price, or the charge is more than actual delivery cost, it often becomes taxable. Some states tax delivery regardless. A few tax it only when the goods themselves are taxable.
In VAT countries it's simpler and goes the other way. Delivery is usually treated as part of the supply and carries the same VAT rate as the goods.
If shipping is taxable where you are, add it to the subtotal before working out tax, rather than adding it at the end. The calculator's default puts shipping after tax, which matches separately-stated delivery in the US.
Free shipping and thresholds
"Free delivery over $100" is a discount wearing a different hat, and it needs the same care as any other.
If delivery is genuinely free, there's no shipping charge and nothing to tax on it. Where it gets awkward is building the cost into the item prices instead. Do that in a place where separately-stated delivery isn't taxable and you've just made it taxable, because it's no longer stated separately. It's now part of the price of the goods.
Partial subsidies need the same thought. Charging a flat $5 on a delivery that costs you $12 is fine, but some places tax stated delivery only up to actual cost and treat anything above as part of the sale price. If you routinely charge more for shipping than it costs you, that's worth checking locally.
Refunds and returns
Refund a sale and you refund the tax with it. The customer gets back what they paid including tax, and you adjust what you owe on your next return. Keeping tax on a refunded sale means you're holding money that belongs to the customer, and if you've already remitted it, you're out of pocket yourself.
Partial refunds are where the arithmetic gets fiddly, and the fix is to work backwards through the same order you used going forwards.
Discount applied to it: $50 × 10% = $5.00
Net refundable: $50 − $5 = $45.00
Tax on that: $45 × 8% = $3.60
Refund the customer: $48.60
Refunding the $50 plus $4 of tax would be wrong twice: the customer never paid $50 for it after the discount, and never paid $4 of tax on it. Small on one return, and a steady leak across a year of them.
Restocking fees are their own question. Some places treat them as taxable, others don't, and it can depend on whether you're keeping part of a taxable sale or charging for a service. Worth a check if you charge them regularly.
Bundles with mixed rates
Sell a taxable item and a non-taxable one together for a single price and something has to give, because the bundle needs splitting before tax can be worked out.
The usual approach is to allocate the bundle price across the items in proportion to what they'd sell for separately, then tax each part at its own rate. A $90 bundle containing a $60 taxable item and a $40 non-taxable one splits 60/40 by value: $54 taxable, $36 not.
Some places take a blunter line, where a bundle containing any taxable item is taxable in full, or where it depends on whether the taxable part is more than a set share of the value. If bundles are a real part of what you sell, this is one to confirm rather than infer.
Gift cards
Selling a gift card isn't a taxable sale. You've taken money for nothing in particular yet, so there's nothing to apply a rate to.
Tax applies when the card is spent, on whatever it buys, at the rate applying then. Treat redemption like any other payment method: work out the sale and its tax as normal, then apply the card against the total. Charging tax at the point you sell the card, and again when it's used, taxes the same money twice.
Rounding
Work out tax on the whole taxable amount, then round once, to the nearest cent. Rounding each line separately and adding up gives a slightly different answer, and on a long invoice the gap is big enough for a client to notice.
Half-up is the usual convention, so $14.405 becomes $14.41. Some jurisdictions specify something else, which matters if you're filing returns from these figures.
Multiple tax rates
Some orders carry different rates on different items, groceries at one rate and general goods at another, or a combined state and city rate. Group the items by rate, work out tax for each group on its own, then add the results.
Applying one blended rate across everything is close but not exact, and it's the kind of shortcut that shows up in an audit.
Do the arithmetic
The sales tax and VAT calculator applies discount before tax and shows each step, so you can check the order against your own rules. For the difference between the two systems, see sales tax vs VAT.
This is general guidance, not tax advice. Sales tax and VAT rules vary by jurisdiction and change often, so confirm your rate and rules with a qualified professional.