How to calculate sales tax on an invoice
Getting tax math right on an invoice matters both for your customer's trust and for your own bookkeeping. The basic formula is simple; the parts that actually trip people up — multiple rates on one invoice, compound tax, tax-inclusive pricing — are covered below with the real formulas, not just the theory.
The basic formula
For a single tax rate applied to a subtotal:
tax amount = subtotal × (tax rate ÷ 100)
total = subtotal + tax amount
Example: a $1,000 subtotal with 8% sales tax gives a tax amount of $80.00, and a total of $1,080.00.
When you have a discount too
Apply the discount to the subtotal before calculating tax, not after — this matches how most tax authorities require it, and how most accounting software handles it:
discounted subtotal = subtotal − discount
tax amount = discounted subtotal × (tax rate ÷ 100)
total = discounted subtotal + tax amount
Example: $1,000 subtotal, 10% discount ($100), 8% tax. Discounted subtotal is $900; tax is $72.00; total is $972.00.
Multiple tax rates on one invoice
Sometimes different line items are taxed at different rates (for example, standard goods vs. a reduced-rate category), or a single jurisdiction requires you to show a state/provincial rate and a local rate separately. In that case, calculate and display each tax amount as its own line rather than blending them into a single percentage — it keeps the invoice auditable and matches how most tax authorities expect line items to be reported.
Compound tax
Compound tax means one tax is calculated on top of a subtotal that already includes another tax — common in some Canadian provinces (GST then PST-on-GST-inclusive-price) and a few other jurisdictions. The order matters:
first tax amount = subtotal × (rate 1 ÷ 100)
compound base = subtotal + first tax amount
second tax amount = compound base × (rate 2 ÷ 100)
total = compound base + second tax amount
If your jurisdiction uses compound tax, double check whether it applies to your specific product/service category — not every combination of taxes compounds.
Tax-inclusive vs. tax-exclusive pricing
Most invoices show tax-exclusive pricing — the listed price is before tax, and tax is added on top, as shown above. Some regions and industries (retail in particular) instead show tax-inclusive pricing, where the listed price already contains tax and you need to back it out for reporting:
pre-tax amount = tax-inclusive price ÷ (1 + tax rate ÷ 100)
tax amount = tax-inclusive price − pre-tax amount
Whichever convention you use, state it clearly on the invoice (for example, "all prices include VAT") so there's no ambiguity for the customer.
Rounding matters more than it seems
On an invoice with many line items, each individually rounded to the nearest cent, small rounding differences can accumulate — the sum of the rounded line totals can end up a cent or two off from tax calculated on the overall subtotal. Good invoicing tools calculate on the smallest currency unit (cents) throughout and reconcile rounding at the total, rather than rounding at every intermediate step, which is exactly what our invoice generator's calculation engine does automatically.
A worked example with mixed tax rates
In practice, that looks like this — an invoice with line items taxed at two different rates, say standard hardware plus a reduced-rate service call:
Replacement thermostat unit 1 × $180.00 = $180.00 (taxed at 8%)
Installation labor 2 hrs × $95.00 = $190.00 (taxed at 5%, reduced service rate)
Subtotal: $370.00
Sales tax on hardware (8% of $180.00): $14.40
Sales tax on labor (5% of $190.00): $9.50
Total: $393.90
Note that the two tax amounts are calculated against their own line items individually, then shown as separate lines — not averaged into one blended rate. Averaging (in this case, roughly 6.4%) would produce the wrong total the moment the ratio between hardware and labor changes on a future invoice, so calculate per rate group, every time.
VAT/GST vs. US-style sales tax
These often get treated as interchangeable, and the arithmetic on a single invoice does look the same, but the systems behind them differ: US-style sales tax is collected once, at the final retail sale to the end consumer — a business buying materials for resale is typically exempt with a valid resale certificate. VAT (Value Added Tax) and GST (Goods and Services Tax) are collected at every stage of a supply chain, with registered businesses reclaiming the tax they paid on their own inputs, so the net cost still lands only on the final consumer, just collected in stages rather than once. If you sell internationally, whether you need to register for VAT/GST in a buyer's country depends on your sales volume and their specific threshold rules — worth checking per market rather than assuming your home-country registration covers it.
Tax-exempt sales and resale certificates
Some customers are legitimately tax-exempt: a reseller with a valid resale certificate (buying inventory to resell, not to use), a registered nonprofit in some jurisdictions, or a government entity. Show these as "Tax (exempt): $0.00" rather than just leaving the tax line off entirely — it makes clear the zero was intentional and calculated, not an oversight. Keep a copy of the exemption certificate on file for as long as your jurisdiction's audit window requires; "the customer said they were exempt" isn't documentation.
Sales tax nexus, briefly
Nexus is what determines whether you're even required to collect a given jurisdiction's sales tax in the first place. Historically this meant having a physical presence (an office, employees, inventory) there. Many jurisdictions — notably US states following the 2018 South Dakota v. Wayfair Supreme Court decision — now also apply "economic nexus," triggered once your sales into that state cross a revenue or transaction-count threshold, with no physical presence required at all. If you sell across state or national borders at meaningful volume, it's worth specifically confirming which jurisdictions you have nexus in rather than assuming your home state or country is the only one that matters.
Common mistakes on tax calculations
- Averaging multiple tax rates into one blended percentage — calculate each rate against its own line items and show them separately.
- Applying tax before the discount instead of after — discount the subtotal first, then calculate tax on what remains.
- Leaving the tax line off entirely for exempt sales — show $0.00 explicitly so it reads as intentional.
- Rounding each line item independently and letting the errors compound — calculate on the smallest currency unit throughout and reconcile only at the total.
- Not stating whether prices are tax-inclusive or tax-exclusive — always say so explicitly if there's any chance of ambiguity for the customer.
This isn't tax advice
Tax rules vary by country, state/province, and industry, and change over time. This guide explains the arithmetic, not your specific compliance obligations — verify the rates and rules that apply to you, and consult a tax professional for anything beyond straightforward transactions. See our Disclaimer for more.
A few more questions on the math
What's the difference between VAT/GST and US-style sales tax?
Sales tax (as used in the US) is a single-stage tax collected only at the final retail sale to the end consumer — businesses buying for resale are generally exempt. VAT and GST are multi-stage taxes collected at every step of a supply chain, with registered businesses reclaiming ("crediting") the tax they paid on their own purchases, so only the final consumer bears the net cost. The end math on a single invoice looks similar (rate × subtotal), but the underlying system, registration rules, and who can reclaim it are quite different.
Do I charge sales tax on services or only physical goods?
It depends entirely on your jurisdiction — some tax almost all services, some tax very few, and many draw specific category distinctions (e.g. taxing software licenses but not consulting hours). There's no universal rule here; check your local tax authority's guidance for your specific service category.
What is "nexus" and why does it matter for sales tax?
Nexus is the legal connection between your business and a taxing jurisdiction that creates an obligation to collect its tax — historically based on having a physical presence there, but many jurisdictions (notably US states, post-2018) now also apply "economic nexus" based on sales volume or transaction count into that jurisdiction, even with zero physical presence. If you sell across state or national borders, it's worth confirming which jurisdictions you have nexus in — this is genuinely complex and worth professional advice if your sales volume is significant.
Should I show tax as one combined line or split it out?
Split it out whenever more than one tax applies (state + local, or GST + PST, for example) — a single blended percentage is harder for the customer to verify and can look like an error even when it isn't. If only one tax applies, either a single combined line or the rate shown next to the tax amount both work.
What if my customer is tax-exempt?
Tax-exempt customers (resellers with a valid resale certificate, registered nonprofits, government entities, depending on your jurisdiction's rules) should have $0.00 tax shown on the invoice, not simply omitted — showing "Tax (exempt): $0.00" makes it clear the omission was intentional and correctly calculated, not a mistake. Keep the exemption certificate on file; most tax authorities can request it during an audit.
More invoicing guides
Practical, no-fluff answers to the other questions that come up when you're billing someone.
How to Write an Invoice
What every invoice needs, step by step — from numbering to payment instructions.
Invoice vs. Receipt: What’s the Difference?
They look similar but serve different moments in a transaction. Here’s how to tell them apart.
Freelance Invoicing Guide
Practical tips for freelancers to get paid faster, including payment terms and deposits.
What Is a Commercial Invoice?
Why customs requires one for international shipments, and exactly what it needs to include.
Construction Invoicing Guide
Milestone billing, retainage, change orders, and work orders for trade and construction jobs.
Medical & Legal Invoicing Guide
Patient vs. insurance billing, superbills, legal retainers, and billing by time increment.
Estimate vs. Quote vs. Invoice
They look similar but mean different things — which one is binding, and when to use each.
Let the tool do the math
Add as many named tax rates as you need — compound or not, applied per line or globally — and our invoice generator handles the calculation correctly every time.
Create Your Invoice