Home › Finance › 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
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
amount | number | yes | The pre-tax price (mode=add_tax) or the tax-inclusive total (mode=extract_tax). Range: ≥ 0, ≤ 1000000000 | |
tax_rate_percent | number | % | yes | Combined sales-tax rate in percent (state + local), e.g. 8.25. Range: ≥ 0, ≤ 100 |
mode | enum: add_tax | extract_tax | default add_tax | Whether amount excludes tax (add) or already includes it (extract). |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
pre_tax_amount | number | Price before sales tax. | |
tax_amount | number | pre_tax_amount × rate. | |
total_amount | number | pre_tax_amount + tax_amount. | |
tax_share_of_total_percent | number | % | 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
- API:
GET https://tttkmbb.com/api/v1/calculate/sales-tax(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/sales-tax · Markdown: https://tttkmbb.com/finance/sales-tax.md · JSON definition: https://tttkmbb.com/finance/sales-tax.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="sales-tax" - OpenAPI operationId:
calculate_sales_tax - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Sales tax (reference)
- Investopedia – Sales Tax: Definition, Examples and How It's Calculated (reference)
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
- VAT Calculator — The same calculation with net/gross VAT terminology and rates.
- Discount Calculator — Apply a discount and then tax.
- Tip Calculator — Add a gratuity to a bill.