{
  "id": "sales-tax",
  "version": "44c63e62ff91",
  "status": "published",
  "name": "Sales Tax Calculator",
  "question": "How much sales tax is on my purchase?",
  "summary": "Adds sales tax to a price, or takes it out of a total, with your state’s base sales tax rate and your local rate.",
  "category": "finance",
  "subcategory": "tax-and-pay",
  "url": "https://www.acalculator.org/finance/sales-tax-calculator",
  "markdown": "https://www.acalculator.org/finance/sales-tax-calculator.md",
  "kind": "function",
  "method": "Rate = state base rate + local rate. Before tax: tax = price × rate ÷ 100, total = price + tax. Including tax: price = total ÷ (1 + rate ÷ 100), tax = total − price.",
  "assumptions": [
    "State base rates are the statewide general rates of 2026 (Tax Foundation midyear 2026 table, DC from its Office of Tax and Revenue). Local rates are typed by you.",
    "The District of Columbia rate is 6%; its rise to 7% is postponed to October 1, 2027.",
    "Not modelled: exemptions and lower rates for groceries, clothing, medicine, and other goods; special rates on cars, meals, lodging, and fuel; and caps on local tax. Tax is not rounded until it is shown."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "The amount is",
        "description": "Whether the amount is the price before tax (add tax) or a total that includes tax (take tax out).",
        "type": "string",
        "enum": [
          "add",
          "remove"
        ]
      },
      "amount": {
        "title": "Amount",
        "description": "The price before tax, or the total with tax, as chosen above.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000
      },
      "state": {
        "title": "State",
        "description": "The state where you buy; its statewide base sales tax rate is used.",
        "type": "string",
        "enum": [
          "AL",
          "AK",
          "AZ",
          "AR",
          "CA",
          "CO",
          "CT",
          "DE",
          "DC",
          "FL",
          "GA",
          "HI",
          "ID",
          "IL",
          "IN",
          "IA",
          "KS",
          "KY",
          "LA",
          "ME",
          "MD",
          "MA",
          "MI",
          "MN",
          "MS",
          "MO",
          "MT",
          "NE",
          "NV",
          "NH",
          "NJ",
          "NM",
          "NY",
          "NC",
          "ND",
          "OH",
          "OK",
          "OR",
          "PA",
          "RI",
          "SC",
          "SD",
          "TN",
          "TX",
          "UT",
          "VT",
          "VA",
          "WA",
          "WV",
          "WI",
          "WY"
        ]
      },
      "local": {
        "title": "Local rate",
        "description": "County, city, and district sales tax on top of the state rate, in percent.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 20
      }
    }
  },
  "outputs": {
    "tax": {
      "label": "Sales tax",
      "description": "The sales tax on the price.",
      "format": "money"
    },
    "total": {
      "label": "Total with tax",
      "description": "The price plus the sales tax.",
      "format": "money"
    },
    "price": {
      "label": "Price before tax",
      "description": "The price the tax is charged on.",
      "format": "money"
    },
    "rate": {
      "label": "Combined rate",
      "description": "The state base rate plus the local rate, in percent.",
      "format": "percent"
    },
    "stateRate": {
      "label": "State base rate",
      "description": "The statewide base sales tax rate, in percent.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "add",
      "amount": 100,
      "state": "CA",
      "local": 0
    },
    "outputs": {
      "tax": 7.249999999999999,
      "total": 107.25,
      "price": 100,
      "rate": 7.249999999999999,
      "stateRate": 7.249999999999999
    },
    "text": "At 7.25% in total, the sales tax on $100.00 is $7.25, for $107.25 in all."
  },
  "examples": [
    {
      "given": {
        "mode": "add",
        "amount": 100,
        "state": "CA",
        "local": 1.5
      },
      "expect": {
        "stateRate": 7.25,
        "rate": 8.75,
        "tax": 8.75,
        "total": 108.75
      },
      "source": "State base rate: Tax Foundation, State and Local Sales Tax Rates, Midyear 2026, https://taxfoundation.org/data/all/state/sales-tax-rates/: California 7.25%; hand calculation in content.mdx; Python 3: 100*(7.25+1.5)/100"
    },
    {
      "given": {
        "mode": "remove",
        "amount": 108.875,
        "state": "NY",
        "local": 4.875
      },
      "expect": {
        "rate": 8.875,
        "price": 100,
        "tax": 8.875
      },
      "source": "State base rate: Tax Foundation, State and Local Sales Tax Rates, Midyear 2026, https://taxfoundation.org/data/all/state/sales-tax-rates/: New York 4% plus New York City 4.5% and the 0.375% MCTD rate; reverse: 108.875 ÷ 1.08875; Python 3: 108.875/1.08875"
    },
    {
      "given": {
        "mode": "add",
        "amount": 250,
        "state": "TX"
      },
      "expect": {
        "stateRate": 6.25,
        "tax": 15.625,
        "total": 265.625
      },
      "source": "State base rate: Tax Foundation, State and Local Sales Tax Rates, Midyear 2026, https://taxfoundation.org/data/all/state/sales-tax-rates/: Texas 6.25%; Python 3: 250*0.0625"
    },
    {
      "given": {
        "mode": "add",
        "amount": 500,
        "state": "OR"
      },
      "expect": {
        "tax": 0,
        "total": 500
      },
      "source": "State base rate: Tax Foundation, State and Local Sales Tax Rates, Midyear 2026, https://taxfoundation.org/data/all/state/sales-tax-rates/: Oregon has no general sales tax"
    }
  ],
  "sources": [
    "Tax Foundation, State and Local Sales Tax Rates, Midyear 2026 (state base rates, a cross-check source used by the WP-80 dataset). https://taxfoundation.org/data/all/state/sales-tax-rates/",
    "District of Columbia Office of Tax and Revenue, Sales & Use Tax: the October 2026 increase is postponed to October 1, 2027 (retrieved 2026-09-29). https://otr.cfo.dc.gov/page/sales-use-tax"
  ],
  "related": [
    "car-sales-tax",
    "discount",
    "margin",
    "california-income-tax"
  ],
  "changelog": []
}
