HomeFinance › Sales Tax Calculator

Sales Tax Calculator

Adds sales tax at a given rate to a pre-tax price, or works backwards from a tax-inclusive total to the pre-tax price and the tax paid.

When to use

You need the checkout total for a price and a combined state/local sales-tax rate, or want to know how much of a receipt total was tax.

Do not use when: The tax is a value-added tax quoted as net/gross (use vat, which is the same arithmetic with VAT terminology), or you need the tax rate for a specific location (look it up first).

Formula

add_tax: tax = amount × rate/100, total = amount + tax. extract_tax: pre_tax = amount / (1 + rate/100), tax = amount − pre_tax

Inputs

ParameterTypeUnitRequiredDescription
amountnumberyesThe pre-tax price (mode=add_tax) or the tax-inclusive total (mode=extract_tax). Range: ≥ 0, ≤ 1000000000
tax_rate_percentnumber%yesCombined sales-tax rate in percent (state + local), e.g. 8.25. Range: ≥ 0, ≤ 100
modeenum: add_tax | extract_taxdefault add_taxWhether amount excludes tax (add) or already includes it (extract).

Outputs

OutputTypeUnitDescription
pre_tax_amountnumberPrice before sales tax.
tax_amountnumberpre_tax_amount × rate.
total_amountnumberpre_tax_amount + tax_amount.
tax_share_of_total_percentnumber%tax_amount / total_amount × 100 (lower than the rate, since the rate applies to the pre-tax price).

Example

100 plus 8.25 % tax: {"amount":100,"tax_rate_percent":8.25,"mode":"add_tax"}{"pre_tax_amount":100,"tax_amount":8.25,"total_amount":108.25,"tax_share_of_total_percent":7.62}

108.25 total, extract 8.25 % tax: {"amount":108.25,"tax_rate_percent":8.25,"mode":"extract_tax"}{"pre_tax_amount":100,"tax_amount":8.25,"total_amount":108.25}

GET https://tttkmbb.com/api/v1/calculate/sales-tax?amount=100&tax_rate_percent=8.25&mode=add_tax

Machine access

Sources

FAQ

Why can't I extract tax by multiplying the total by the rate?

Because the rate applies to the pre-tax price: 108.25 × 8.25 % = 8.93, not 8.25. Divide the total by 1.0825 to get the pre-tax price first.

Which rate do I enter?

The combined rate that applies at the point of sale: state plus county, city and special-district rates. It varies by location and product type.

Related calculators