Tax-inclusive and tax-exclusive amounts are different calculations
Before calculating, ask whether the amount is before tax or already includes it. Applying the same percentage directly to both amounts does not recover the same tax component, because the base has changed.
Starting with a tax-exclusive amount
For a simple single-rate model, express the rate as a decimal r. Tax = base amount ×r, and total = base amount ×(1 +r). This is percentage arithmetic, not a decision about the applicable rate.
Obtain the rate and its applicability from the relevant invoice or authority. These examples state no current national rate and do not determine whether a person or product is taxable.
References: OpenStax — Sales-tax arithmetic
Starting with an inclusive price
Recover the base by dividing the total by (1 +r). The tax component is total minus that base, equivalently total ×r ÷(1 +r).
Simply subtracting the percentage from the inclusive total does not reverse the addition. That applies the rate to a larger amount than the base on which the tax arose.
Limits of the simple model
The calculator uses a rate supplied by the user and one currency. It does not determine exemptions, recoverability, multiple rates or the ordering of charges and discounts.
Line-level rounding rules can affect an invoice’s final total. Keep the original values, and do not treat a small difference as evidence of a legal error without checking the invoice’s calculation method.
Worked example with an illustrative 8% rate
Assume a base amount of 250 and an educational example rate of 8%, not a rate asserted for any country. The addition is 250 ×0.08 =20 and the total is 270.
If the given price is instead 270 inclusive, 270 ÷1.08 recovers the 250 base and leaves tax of 20. Taking 8% of 270 gives 21.6, which is not the original tax in this example.