# 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.

- Calculator id: `sales-tax` · Category: Finance (`finance`) · Tool name: `calculate_sales_tax`
- Canonical page: https://tttkmbb.com/finance/sales-tax · This document: https://tttkmbb.com/finance/sales-tax.md · JSON definition: https://tttkmbb.com/finance/sales-tax.json

## Purpose

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.

**Use when:** 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).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `amount` | number |  | required | The pre-tax price (mode=add_tax) or the tax-inclusive total (mode=extract_tax). (min 0, max 1000000000) |
| `tax_rate_percent` | number | % | required | Combined sales-tax rate in percent (state + local), e.g. 8.25. (min 0, max 100) |
| `mode` | enum: add_tax \| extract_tax |  | optional, default "add_tax" | Whether amount excludes tax (add) or already includes it (extract). |

## Output

| Field | 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). |

## Formula

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

## Data Sources

- Wikipedia – Sales tax — https://en.wikipedia.org/wiki/Sales_tax (reference, retrieved 2026-09-23)
- Investopedia – Sales Tax: Definition, Examples and How It's Calculated — https://www.investopedia.com/terms/s/salestax.asp (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/sales-tax?amount=…&tax_rate_percent=…`
- `POST https://tttkmbb.com/api/v1/calculate/sales-tax` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/sales-tax · OpenAPI operationId `calculate_sales_tax` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "sales-tax", "inputs": {…}}`

## Example

- 100 plus 8.25 % tax: inputs `{"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: inputs `{"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
```

## Limitations

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). All values are computed from the formula above; no measurement or live data is involved.

## 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

- [VAT Calculator](https://tttkmbb.com/finance/vat.md) — The same calculation with net/gross VAT terminology and rates.
- [Discount Calculator](https://tttkmbb.com/finance/discount.md) — Apply a discount and then tax.
- [Tip Calculator](https://tttkmbb.com/finance/tip.md) — Add a gratuity to a bill.
