{
  "id": "vat",
  "version": "a5c5e81ba00a",
  "status": "published",
  "name": "VAT Calculator",
  "question": "How much VAT is in this price?",
  "summary": "Adds VAT to a net price or takes it out of a VAT-inclusive price at any rate, with the VAT fraction, the net price and the gross price.",
  "category": "finance",
  "subcategory": "tax-and-pay",
  "url": "https://www.acalculator.org/finance/vat-calculator",
  "markdown": "https://www.acalculator.org/finance/vat-calculator.md",
  "kind": "function",
  "method": "Add VAT: VAT = net × rate ÷ 100, gross = net + VAT. Remove VAT: VAT = gross × rate ÷ (100 + rate) (the VAT fraction), net = gross − VAT.",
  "assumptions": [
    "One VAT rate applies to the whole amount.",
    "Amounts are in any one currency; results round half up to 2 decimals.",
    "Where a business rounds VAT on each line of an invoice, its total can differ by a penny from this one."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "The amount",
        "description": "Whether the amount you type is before VAT (add VAT) or already includes VAT (remove VAT).",
        "type": "string",
        "enum": [
          "add",
          "remove"
        ]
      },
      "amt": {
        "title": "Amount",
        "description": "The price in any currency: before VAT to add VAT, or including VAT to take it out.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "rate": {
        "title": "VAT rate",
        "description": "The VAT rate in percent, for example 20 for the UK standard rate or 5 for the reduced rate.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 100
      }
    }
  },
  "outputs": {
    "vat": {
      "label": "VAT",
      "description": "The VAT in the price.",
      "format": "number"
    },
    "net": {
      "label": "Net price",
      "description": "The price before VAT.",
      "format": "number"
    },
    "gross": {
      "label": "Gross price",
      "description": "The price including VAT.",
      "format": "number"
    },
    "fraction": {
      "label": "VAT fraction",
      "description": "Rate ÷ (100 + rate): the share of a VAT-inclusive price that is VAT, as a percent.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "add",
      "amt": 100,
      "rate": 20
    },
    "outputs": {
      "vat": 20,
      "net": 100,
      "gross": 120,
      "fraction": 16.666666666666668
    },
    "text": "VAT: 20.00. Net price 100.00, gross price 120.00."
  },
  "examples": [
    {
      "given": {
        "mode": "remove",
        "amt": 2.4,
        "rate": 20
      },
      "expect": {
        "vat": 0.4,
        "net": 2,
        "gross": 2.4,
        "fraction": 16.666666666666668
      },
      "source": "HMRC, VAT guide (VAT Notice 700), §7.3.1 VAT fractions: rate ÷ (100 + rate). https://www.gov.uk/guidance/vat-guide-notice-700 (a £2.40 price at 20% includes 40p of VAT, one-sixth of £2.40)"
    },
    {
      "given": {
        "mode": "remove",
        "amt": 21,
        "rate": 5
      },
      "expect": {
        "vat": 1,
        "net": 20,
        "fraction": 4.761904761904762
      },
      "source": "HMRC, VAT guide (VAT Notice 700), §7.3.1 VAT fractions: rate ÷ (100 + rate). https://www.gov.uk/guidance/vat-guide-notice-700 (the VAT fraction at 5% is 1/21); hand calculation in content.mdx: 21 × 1/21 = 1"
    },
    {
      "given": {
        "mode": "remove",
        "amt": 47,
        "rate": 17.5
      },
      "expect": {
        "vat": 7,
        "net": 40,
        "fraction": 14.893617021276595
      },
      "source": "HMRC, VAT guide (VAT Notice 700), §7.3.1 VAT fractions: rate ÷ (100 + rate). https://www.gov.uk/guidance/vat-guide-notice-700 (the VAT fraction at 17.5% is 7/47); hand calculation in content.mdx: 47 × 7/47 = 7"
    },
    {
      "given": {
        "mode": "add",
        "amt": 100,
        "rate": 20
      },
      "expect": {
        "vat": 20,
        "net": 100,
        "gross": 120
      },
      "source": "HMRC VAT Notice 700 (VAT is charged at the rate on the value of the supply); hand calculation: 100 × 20% = 20"
    },
    {
      "given": {
        "mode": "add",
        "amt": 0.1,
        "rate": 20
      },
      "expect": {
        "vat": 0.02,
        "gross": 0.12
      },
      "source": "Hand calculation in content.mdx: 0.10 × 20% = 0.02, exact decimals (not 0.020000000000000004)"
    }
  ],
  "sources": [
    "HMRC, VAT guide (VAT Notice 700), §7.3.1 VAT fractions (rate ÷ (100 + rate); 1/6 at 20%, 1/21 at 5%, 7/47 at 17.5%; £2.40 includes 40p VAT). https://www.gov.uk/guidance/vat-guide-notice-700 (retrieved 2026-10-05)",
    "GOV.UK, VAT rates on different goods and services (standard 20%, reduced 5% and zero rates). https://www.gov.uk/guidance/rates-of-vat-on-different-goods-and-services (retrieved 2026-10-05)"
  ],
  "related": [
    "sales-tax",
    "percentage",
    "discount",
    "margin"
  ],
  "changelog": [
    {
      "date": "2026-10-06",
      "note": "Amounts always show two decimal places: 0.40, not 0.4."
    }
  ]
}
