{
  "$comment": "Machine-readable companion to https://valem.run/calculators/brazil/car-tax. Formula, inputs, outputs, engine-verified test vectors, cited sources and the re-runnable Valem ModelSpec behind the page.",
  "url": "https://valem.run/calculators/brazil/car-tax",
  "dataUrl": "https://valem.run/calculators/brazil/car-tax.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "Brazil ipva model by Valem (https://valem.run/calculators/brazil/car-tax), CC BY 4.0.",
    "note": "Covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds themselves are law and are not licensed by anyone; the cited sources are where they come from."
  },
  "verificationUrl": "https://valem.run/calculators/brazil/car-tax/verify",
  "country": "brazil",
  "countryName": "Brazil",
  "formula": "car-tax",
  "formulaName": "IPVA",
  "title": "Calculadora de IPVA — Brazil car tax",
  "answer": "Brazilian IPVA is your state's rate applied to the car's FIPE market value, with a common exemption for vehicles over twenty years old.",
  "lang": "en",
  "currency": "BRL",
  "taxYear": "2026",
  "verification": {
    "claim": "internal-consistency",
    "statement": "The Valem engine reproduces this model's stated formula through 3 self-test cases (below, and re-runnable against the spec). That asserts internal consistency, NOT that the formula matches current law — the cited sources are the evidence for that, and carry the date each was last checked.",
    "selfTestCases": 3,
    "ratesAreIllustrative": false,
    "sourcesCheckedOn": "2026-08-02"
  },
  "sources": [
    {
      "label": "Sefaz-SP — IPVA",
      "url": "https://portal.fazenda.sp.gov.br",
      "checked": "2026-08-04"
    },
    {
      "label": "Sefaz-SC — calendário IPVA 2026",
      "url": "https://www.sef.sc.gov.br",
      "checked": "2026-08-04"
    },
    {
      "label": "Tabela FIPE",
      "url": "https://veiculos.fipe.org.br",
      "checked": "2026-08-04"
    }
  ],
  "terminalOutput": "ipva",
  "inputs": [
    {
      "name": "fipeValue",
      "type": "number",
      "label": "Valor FIPE (BRL)",
      "format": "currency",
      "minimum": 0
    },
    {
      "name": "state",
      "type": "string",
      "label": "Estado (UF)"
    },
    {
      "name": "customRate",
      "type": "number",
      "label": "Alíquota se 'Outro' (fração, ex. 0.03)",
      "minimum": 0,
      "maximum": 1
    },
    {
      "name": "ageYears",
      "type": "number",
      "label": "Idade do veículo (anos)",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "stateRate",
      "type": "number",
      "label": "Alíquota aplicada",
      "formula": "($s := state; $s = 'SP' ? $const.rateSP : $s = 'RJ' ? $const.rateRJ : $s = 'MG' ? $const.rateMG : $s = 'SC' ? $const.rateSC : $s = 'PR' ? $const.ratePR : customRate)"
    },
    {
      "name": "exempt",
      "type": "number",
      "formula": "ageYears > $const.ageExemption ? 1 : 0"
    },
    {
      "name": "ipva",
      "type": "number",
      "label": "IPVA anual",
      "format": "currency",
      "formula": "$round(exempt = 1 ? 0 : fipeValue * stateRate, 2)"
    }
  ],
  "testCases": [
    {
      "description": "C1 SP, FIPE R$80,000, 3-year-old car",
      "given": {
        "fipeValue": 80000,
        "state": "SP",
        "ageYears": 3
      },
      "expect": {
        "stateRate": 0.04,
        "exempt": 0,
        "ipva": 3200
      }
    },
    {
      "description": "C2 same car registered in Paraná — the 2026 rate cut",
      "given": {
        "fipeValue": 80000,
        "state": "PR",
        "ageYears": 3
      },
      "expect": {
        "stateRate": 0.019,
        "ipva": 1520
      }
    },
    {
      "description": "C3 22-year-old car — age exemption",
      "given": {
        "fipeValue": 30000,
        "state": "SP",
        "ageYears": 22
      },
      "expect": {
        "exempt": 1,
        "ipva": 0
      }
    }
  ],
  "spec": {
    "id": "car-tax-brazil",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "fipeValue": {
          "type": "number",
          "minimum": 0
        },
        "state": {
          "type": "string"
        },
        "customRate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "ageYears": {
          "type": "number",
          "minimum": 0
        },
        "stateRate": {
          "type": "number",
          "readOnly": true
        },
        "exempt": {
          "type": "number",
          "readOnly": true
        },
        "ipva": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "ageExemption": 20,
      "rateSP": 0.04,
      "rateRJ": 0.04,
      "rateMG": 0.04,
      "rateSC": 0.02,
      "ratePR": 0.019
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'fipeValue': 80000, 'state': 'SP', 'customRate': 0.04, 'ageYears': 3 }"
      }
    ],
    "derivations": [
      {
        "path": "$.stateRate",
        "expr": "($s := state; $s = 'SP' ? $const.rateSP : $s = 'RJ' ? $const.rateRJ : $s = 'MG' ? $const.rateMG : $s = 'SC' ? $const.rateSC : $s = 'PR' ? $const.ratePR : customRate)"
      },
      {
        "path": "$.exempt",
        "expr": "ageYears > $const.ageExemption ? 1 : 0"
      },
      {
        "path": "$.ipva",
        "expr": "$round(exempt = 1 ? 0 : fipeValue * stateRate, 2)"
      }
    ],
    "constraints": [],
    "metaDerivations": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "IPVA",
          "layout": "vertical",
          "components": [
            {
              "id": "fipe",
              "type": "numericField",
              "label": "Valor FIPE (BRL)",
              "bind": "$.fipeValue"
            },
            {
              "id": "state",
              "type": "selectField",
              "label": "Estado (UF)",
              "bind": "$.state",
              "helperText": "Escolha o estado para carregar a alíquota de 2026, ou 'Outro' para digitar a sua.",
              "options": [
                {
                  "value": "SP",
                  "label": "São Paulo — 4%"
                },
                {
                  "value": "RJ",
                  "label": "Rio de Janeiro — 4%"
                },
                {
                  "value": "MG",
                  "label": "Minas Gerais — 4%"
                },
                {
                  "value": "SC",
                  "label": "Santa Catarina — 2%"
                },
                {
                  "value": "PR",
                  "label": "Paraná — 1,9% (a menor do país em 2026)"
                },
                {
                  "value": "outro",
                  "label": "Outro estado — informar alíquota"
                }
              ]
            },
            {
              "id": "rate",
              "type": "numericField",
              "label": "Alíquota se 'Outro' (fração, ex. 0.03)",
              "bind": "$.customRate"
            },
            {
              "id": "age",
              "type": "numericField",
              "label": "Idade do veículo (anos)",
              "bind": "$.ageYears"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "ipvaTile",
                  "type": "statTile",
                  "label": "IPVA anual",
                  "bind": "$.ipva",
                  "format": "currency",
                  "currency": "BRL"
                }
              ]
            },
            {
              "id": "breakdown",
              "type": "keyValueList",
              "label": "Cálculo",
              "items": [
                {
                  "label": "Valor FIPE",
                  "bind": "$.fipeValue",
                  "format": "currency",
                  "currency": "BRL"
                },
                {
                  "label": "Alíquota aplicada",
                  "bind": "$.stateRate"
                },
                {
                  "label": "IPVA",
                  "bind": "$.ipva",
                  "format": "currency",
                  "currency": "BRL"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'Brasil IPVA 2026: alíquota estadual sobre o valor de mercado FIPE; isenção comum para veículos com mais de 20 anos. SP, RJ e MG cobram 4%, SC 2% e o Paraná reduziu de 3,5% para 1,9%, a menor alíquota do país. Estimativa, não é aconselhamento fiscal.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Fontes",
              "items": [
                {
                  "label": "Sefaz-SP — IPVA",
                  "url": "https://portal.fazenda.sp.gov.br",
                  "date": "2026-08-04"
                },
                {
                  "label": "Sefaz-SC — calendário IPVA 2026",
                  "url": "https://www.sef.sc.gov.br",
                  "date": "2026-08-04"
                },
                {
                  "label": "Tabela FIPE",
                  "url": "https://veiculos.fipe.org.br",
                  "date": "2026-08-04"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "C1 SP, FIPE R$80,000, 3-year-old car",
        "given": {
          "$.fipeValue": 80000,
          "$.state": "SP",
          "$.ageYears": 3
        },
        "expect": {
          "$.stateRate": 0.04,
          "$.exempt": 0,
          "$.ipva": 3200
        }
      },
      {
        "description": "C2 same car registered in Paraná — the 2026 rate cut",
        "given": {
          "$.fipeValue": 80000,
          "$.state": "PR",
          "$.ageYears": 3
        },
        "expect": {
          "$.stateRate": 0.019,
          "$.ipva": 1520
        }
      },
      {
        "description": "C3 22-year-old car — age exemption",
        "given": {
          "$.fipeValue": 30000,
          "$.state": "SP",
          "$.ageYears": 22
        },
        "expect": {
          "$.exempt": 1,
          "$.ipva": 0
        }
      }
    ]
  }
}
