{
  "id": "reverse-sales-tax",
  "version": "5632de2cb6fa",
  "status": "published",
  "name": "Reverse Sales Tax Calculator",
  "question": "How do I reverse sales tax?",
  "summary": "Works back from a total that includes sales tax to the price before tax and the tax paid, or finds the tax rate from the total and the price.",
  "category": "finance",
  "subcategory": "tax-and-pay",
  "url": "https://www.acalculator.org/finance/reverse-sales-tax-calculator",
  "markdown": "https://www.acalculator.org/finance/reverse-sales-tax-calculator.md",
  "kind": "formulas",
  "method": "price before tax = total × 100 ÷ (100 + rate); tax = total − price before tax; rate = tax ÷ price before tax × 100.",
  "assumptions": [
    "One sales tax rate applies to the whole total. Items taxed at different rates, and fees that are not taxed, are not included.",
    "Arithmetic is exact on the typed decimals; money shows to the cent, halves up.",
    "Stores round the tax on a receipt to the cent, so a price worked back from a total can be a fraction of a cent off the shelf price."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "total": {
        "title": "Total with tax",
        "description": "What you paid, including the sales tax.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "rate": {
        "title": "Sales tax rate",
        "description": "The sales tax rate: state and local rates added together.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 100
      },
      "price": {
        "title": "Price before tax",
        "description": "The price without sales tax: total × 100 ÷ (100 + rate).",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "tax": {
        "title": "Sales tax",
        "description": "The sales tax inside the total: total − price before tax.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      }
    }
  },
  "solve": {
    "fillAny": 2,
    "variables": [
      "total",
      "rate",
      "price",
      "tax"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "total": {
      "label": "Total with tax",
      "description": "What you paid, including the sales tax.",
      "format": "money"
    },
    "rate": {
      "label": "Sales tax rate",
      "description": "The sales tax rate: state and local rates added together.",
      "format": "percent"
    },
    "price": {
      "label": "Price before tax",
      "description": "The price without sales tax: total × 100 ÷ (100 + rate).",
      "format": "money"
    },
    "tax": {
      "label": "Sales tax",
      "description": "The sales tax inside the total: total − price before tax.",
      "format": "money"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "total": 108.25,
      "rate": 8.25
    },
    "outputs": {
      "price": 100,
      "tax": 8.25
    },
    "text": "A total of $108.25 with 8.25% sales tax is a price of $100.00 before tax, plus $8.25 of tax."
  },
  "examples": [
    {
      "given": {
        "total": 417.48,
        "rate": 6.5
      },
      "expect": {
        "price": 392,
        "tax": 25.48
      },
      "source": "OpenStax, Prealgebra 2e, section 6.3 \"Solve Sales Tax, Commission, and Discount Applications\" (https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications), Example 6.25 worked back: 417.48 ÷ 1.065 = 392; 417.48 − 392 = 25.48"
    },
    {
      "given": {
        "price": 499,
        "tax": 42.42
      },
      "expect": {
        "rate": 8.501002004008017,
        "total": 541.42
      },
      "source": "OpenStax, Prealgebra 2e, section 6.3 \"Solve Sales Tax, Commission, and Discount Applications\" (https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications), Example 6.26: 42.42 ÷ 499 = 8.5% (rounded there; exactly 8.501002…%); 499 + 42.42 = 541.42"
    },
    {
      "given": {
        "total": 100,
        "rate": 8.25
      },
      "expect": {
        "price": 92.37875288683603,
        "tax": 7.621247113163972
      },
      "source": "hand calculation in content.mdx: 100 × 100 ÷ 108.25 = 92.3787528868…, shown as $92.38; 100 − 92.3787528868… = 7.6212471131…, shown as $7.62"
    },
    {
      "given": {
        "total": 108.25,
        "price": 100
      },
      "expect": {
        "rate": 8.25,
        "tax": 8.25
      },
      "source": "hand calculation in content.mdx: (108.25 − 100) ÷ 100 × 100 = 8.25%"
    }
  ],
  "sources": [
    "OpenStax, Prealgebra 2e, section 6.3 \"Solve Sales Tax, Commission, and Discount Applications\", Examples 6.25 and 6.26. https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
  ],
  "related": [
    "discount",
    "commission",
    "percentage"
  ],
  "changelog": []
}
