Sending an invoice with a discount and sales tax on it means doing three separate calculations before you can write down one final number — and getting the order wrong is an easy way to under- or over-bill a client by a few dollars. This calculator takes your subtotal, an optional percentage discount, and a tax rate, and returns the discount amount, the tax amount, and the total due, all rounded the way accounting software actually rounds them: to the cent, at each step.
How it works
The math runs in a fixed order. First, the discount is calculated as a percentage of the subtotal and rounded to the cent — that's your discount amount. Second, that discount amount is subtracted from the subtotal to get the discounted price, often called the "taxable base." Third, the tax rate is applied to that discounted price, not to the original subtotal, and rounded to the cent — that's your tax amount. Finally, the tax amount is added back to the discounted price to get the total due.
That ordering — discount first, then tax on what's left — is how most invoicing software and most state sales tax rules treat a seller-offered discount: the customer is taxed on what they're actually paying, not on the sticker price before the markdown. If your tax rate is 0, this collapses to a simple discount calculator; if your discount is 0, it collapses to a simple sales-tax calculator. Either input can sit at zero without breaking the math.
Worked example
Say your subtotal is $2,000, you're offering a 0% discount, and there's 0% sales tax — the calculator's defaults, useful as a baseline for a flat-rate invoice with no adjustments:
- Discount amount: $2,000 × 0% = $0
- Amount after discount: $2,000 − $0 = $2,000
- Tax amount: $2,000 × 0% = $0
- Total due: $2,000 + $0 = $2,000
Now make it realistic. Subtotal $1,000, a 10% discount, and 8% sales tax:
- Discount amount: $1,000 × 10% = $100
- Amount after discount: $1,000 − $100 = $900
- Tax amount: $900 × 8% = $72
- Total due: $900 + $72 = $972
Notice the tax is calculated on $900, the discounted amount — not on the original $1,000. Taxing the full subtotal instead would have added $80 in tax rather than $72, quietly overcharging the client by $8 on this one invoice.
How to interpret your result
The total is the number to put on the invoice — it already has the discount subtracted and the tax added, so there's nothing left for the client to calculate. The discount amount and tax amount are worth showing as separate line items anyway, because clients (and your own bookkeeping) generally want to see how a subtotal turned into a total rather than just trusting the final figure.
If your discount and tax amounts don't perfectly reconcile with a napkin calculation, it's almost always because each amount here is rounded to the cent independently as it's produced, rather than carried through as an exact fraction and rounded only once at the end. That's deliberate — it's how invoicing and point-of-sale software rounds in practice — but it means the total can occasionally differ from a raw subtotal-times-rate-minus-discount calculation by a cent.
This calculator assumes a single flat discount rate and a single flat tax rate applied to the whole invoice. It doesn't handle line-item-specific tax exemptions, tiered discounts, or tax calculated on a per-line basis — for those, you'll want dedicated invoicing or accounting software, or to run each line through this calculator separately.
Methodology & sources
The formula is: discountAmount = round2(subtotal × discountPercent / 100), afterDiscount = subtotal − discountAmount, taxAmount = round2(afterDiscount × taxRatePercent / 100), and total = round2(afterDiscount + taxAmount). Every dollar figure is rounded to the cent from its own unrounded intermediate value, keeping the three displayed numbers internally consistent with each other.
Calculating tax after the discount — rather than on the pre-discount subtotal — matches how most U.S. states treat a seller-offered discount for sales tax purposes. New York's Department of Taxation and Finance, for example, states plainly that trade, volume, and cash-and-carry discounts "are subtracted before calculating the amount of sales tax due on the sale" — see its guidance on taxable receipts. Rules can differ for manufacturer-funded coupons or reimbursed discounts, and VAT regimes outside the US have their own sequencing rules, so confirm the order that applies in your jurisdiction before relying on this for a tax filing rather than a client invoice.