Inclusive versus exclusive tax arithmetic

The generator offers three tax modes, and two of them produce a tax line. With tax added on top, the prices you typed are net and the tax is computed from them and added. With tax already included, the prices you typed are gross and the tax is found inside them. The two modes take exactly the same inputs, which is why they are easy to confuse. This guide walks through what the engine computes in each mode, on fictional documents whose figures the engine itself produced when the page was built. For which shape of tax applies where, read sales tax vs. VAT first; this page is only about the arithmetic.

Added on top: tax is a percentage of the taxable base

Take a fictional invoice with one line — a garden design consultation at $450.00 — and a rate of 20% with the mode set to added on top. The engine computes the line as quantity × unit price, rounded once to the cent, and the subtotal as the sum of its lines: $450.00. There is no discount, so the taxable base is the same $450.00. The tax is the base × rate, rounded half away from zero to the cent: $90.00. The total is base + tax: $540.00. Three figures, each derived from the one before, and all of them reproducible from the printed subtotal with a calculator. The thing to notice is what the rate was applied to: the net amount. That is what a tax rate means in this mode, and it is the fact the inclusive case has to respect.

Already included: tax is extracted by division

Now the same consultation, the same $450.00, the same 20%, with the mode set to already included. The price is gross: it is what the client pays, and the tax is somewhere inside it. The engine finds the pre-tax figure by dividing the taxable amount by 1 + the rate — by 1.20 at 20% — and rounding that quotient to a cent: $375.00. The tax is whatever is left when the pre-tax figure is taken away from the gross: $75.00. The total is $450.00, unchanged, because the tax was never added — it was already there.

Check it against the first mode. A net price of $375.00 with 20% added on top gives $75.00 of tax and $450.00 in total — exactly the figures the extraction found. That round trip is the test of a correct extraction, and subtracting a percentage fails it, which is the next section.

The subtraction error, measured

The wrong method takes the rate as a percentage of the gross price and calls the result tax. How wrong is easy to measure, because rate × gross is exactly what the added-on-top mode computes when it is handed a gross price. So the table below runs one fictional line — a workshop booking at $2,310.00 — through both modes at several rates. The inclusive column is the tax actually inside the price; the subtraction column is what you get by taking the percentage off the gross.

Rate Divide by Pre-tax (extracted) Tax inside the price Rate × gross (wrong) Overstated by As a share of the correct tax
5% 1.05 $2,200.00 $110.00 $115.50 $5.50 5%
10% 1.10 $2,100.00 $210.00 $231.00 $21.00 10%
20% 1.20 $1,925.00 $385.00 $462.00 $77.00 20%
25% 1.25 $1,848.00 $462.00 $577.50 $115.50 25%

The last column is the point: the overstatement is the rate itself, expressed as a share of the correct tax. At 20% the subtraction overstates the tax by $77.00 on a $2,310.00 line, a fifth of the $385.00 that was really there, and the methodology page singles this out as the error to watch for on hand-made invoices. The reason is that the subtraction charges tax on the tax: 20% of a gross price is 20% of the net plus 20% of the tax that already sits on top of the net. Division undoes the addition; subtraction does not. The engine's inclusive mode divides, and there is no setting that makes it subtract.

Rounding at the extraction

Division rarely lands on whole cents, so the engine has to decide where the rounding goes. It rounds the pre-tax quotient to a cent, half away from zero, and defines the tax as gross minus that rounded figure, so the two printed figures always add back to the gross exactly. A fictional receipt for three replacement filters at $33.33 each, with 8.875% included, has a gross of $99.99. Dividing by 1.08875 does not produce a whole number of cents; the engine rounds the quotient to $91.84, reports $8.15 of tax, and prints a total of $99.99. Add the first two and you get the third, to the cent.

The rate itself is held to four decimal places, which is why 8.875% is accepted as typed. A rate with a fifth decimal is refused rather than silently truncated, with the message “The tax rate can have at most four decimal places.”. The same validation turns away a negative rate (“The tax rate cannot be negative.”) and anything above 100% (“The tax rate cannot exceed 100%.”). At the ceiling the arithmetic still holds: a $200.00 line with 100% included divides by 2.00, so $100.00 of it is tax and $100.00 is not.

The same price in the wrong mode

Because the two modes take the same inputs, nothing stops you from typing a gross price into the added-on-top mode. The engine cannot tell, and it will do what it was asked: the $450.00 consultation typed as a net price at 20% on top becomes $540.00, with $90.00 of tax — tax charged a second time on a price that already contained it. Every individual figure looks plausible, which is what makes the mistake hard to see.

The mirror error is quieter. Type the net $375.00 into the already-included mode at 20% and the engine extracts $62.50 of tax from it, leaving a total of $375.00 — where the intended document, the same net price with 20% added on top, had $75.00 of tax and a total of $450.00. Both the tax line and the total are understated. The mode is not a label; it is the instruction that decides whether the engine multiplies or divides. The tax label field, by contrast, only changes the words on the line — when you leave it blank, the engine prints “VAT (included)” for the inclusive mode and “Tax” otherwise, and typing “GST” or “Sales tax” over either changes nothing in the figures.

Discount, shipping and amount paid in each mode

The order of operations is the same in both modes — subtotal, discount, taxable base, tax, shipping, total, amount paid, balance due — but the tax step and the total step differ. A fictional plumbing invoice has three lines: a kitchen tap replacement at $180.00, four pipe fittings at $12.50 each, and 2.5 hours of labour at $60.00 an hour. It carries a 10% discount, $25.00 of shipping, and records $200.00 already paid, at a 20% rate.

Added on top. The subtotal is $380.00. The discount comes off first, $38.00, leaving a taxable base of $342.00 — the discount is applied before tax because tax follows what was actually charged. Tax at 20% on that base is $68.40. Shipping is added after tax, so the total is base + tax + shipping: $435.40. The $200.00 already paid is subtracted last, and the balance due is $235.40.

Already included. Same subtotal, $380.00; same discount, $38.00; same taxable amount, $342.00. Now the tax is extracted from that amount rather than added to it: a pre-tax figure of $285.00 and tax of $57.00. The total is the taxable amount plus shipping — $367.00 — and the tax is not added to it, because it is already inside the $342.00. After the $200.00 paid, the balance due is $167.00.

The discount is a percentage of the subtotal in both cases, so it is the same $38.00 whether that subtotal was net or gross; in inclusive mode the tax is then extracted from the discounted gross, the counterpart of discount-before-tax in the other mode. Shipping sits outside the tax in both modes, which is a documented simplification: the engine does not model freight being taxed, so if your shipping belongs inside the taxable base, enter it as a line item instead. The full order of operations is set out on the methodology page, and the sibling guide on how invoice totals are computed walks each step on more documents.

No tax: the third mode

The third mode prints no tax line. The engine still runs the same sequence; it just skips the tax step, so the total is the discounted subtotal plus shipping. A fictional receipt for a second-hand bicycle at $240.00 and a lock at $18.50, with $12.50 of shipping, has a subtotal of $258.50, tax of $0.00, and a total of $271.00. If the prices contain tax and the document should say how much, that is the already-included mode instead: the same total, with the tax line shown.

How to read the document

On the printed page, the mode shows up in two places: the tax line's label and the relationship between the lines above the total. In added-on-top mode the total is larger than the taxable amount by the tax plus any shipping. In already-included mode the total equals the taxable amount plus shipping, and the tax line sits beside it as information. The bottom line is then named for the document kind — on an invoice it reads “Balance due”, the total less any amount already paid, floored at zero; a receipt and a quote carry different bottom-line labels, for reasons the guide on receipts, quotes and the bottom-line label sets out. Whichever mode you used, a reader's test is the same: do the lines add to the subtotal, and does the subtotal arrive at the total through discount, tax and shipping. Rounding once at each line and once at the extraction is what lets both checks pass.

What the engine does not decide

The engine decides none of the questions that come before the arithmetic. It does not know whether your prices should be shown inclusive or exclusive of tax, whether you must charge tax at all, what rate applies to a given customer or product, or whether a sale is taxable. It applies the rate you type, in the mode you select, and prints the result; it does not look up a jurisdiction, validate a tax number, or apply any per-jurisdiction rule. If you are unsure which mode applies to you, this page cannot tell you — it explains arithmetic, not obligations, and nothing on this site is tax or legal advice.

Questions

What does “already included” actually compute?

The engine divides the taxable amount by 1 + the rate to find the pre-tax figure, rounds that to a cent, and reports the difference as tax. On $450.00 at 20% that is $375.00 before tax and $75.00 of tax; the total stays $450.00, because the tax was inside the price all along.

Why not just take the percentage off the gross price?

Because the rate is a percentage of the net price, not the gross one. Taking 20% of $2,310.00 gives $462.00, but the tax inside that price is $385.00 — the subtraction overstates it by $77.00, a fifth of the correct figure. The engine never subtracts a percentage in inclusive mode.

Does the tax line change the total in inclusive mode?

No. In inclusive mode the tax line is informational: it tells the reader how much of the total is tax. The total is the discounted subtotal plus shipping. Adding the tax on again would charge it twice, which is the error that happens when tax-inclusive prices are entered with the mode left on “added on top”.

Which mode should I use?

The mode describes what the unit prices you typed already contain: net prices take “added on top”, gross prices take “already included”, and “no tax” prints no tax line. Whether your prices should be shown inclusive, whether you must charge tax, and at what rate are questions about your situation, not about arithmetic — this site does not answer them and is not tax advice.

Where does a discount go when tax is included?

Off the gross subtotal first. The engine then extracts the tax from the discounted amount, so a 10% discount on a $380.00 document leaves $342.00, of which $57.00 is tax at 20%. Shipping is added after that, and the total is $367.00.

What rates does the engine accept?

Zero up to 100%, with at most four decimal places, so a rate like 8.875% is fine. Anything outside that is rejected with a message rather than silently clamped: a rate above the ceiling is answered with “The tax rate cannot exceed 100%.”.

A document generator, not accounting or tax advice. Every figure on this page was computed at build time by the same engine the generator runs, and nothing you enter leaves your browser. The methodology page sets out every rule and limit, and the guides cover the rest.