{
  "$comment": "Machine-readable companion to https://valem.run/calculators/portugal/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/portugal/car-tax",
  "dataUrl": "https://valem.run/calculators/portugal/car-tax.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "Portugal iuc model by Valem (https://valem.run/calculators/portugal/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/portugal/car-tax/verify",
  "country": "portugal",
  "countryName": "Portugal",
  "formula": "car-tax",
  "formulaName": "IUC",
  "title": "Simulador IUC — Portugal car tax",
  "answer": "Portugal's annual car tax (IUC) for post-2007 cars combines an engine-size and a CO2 component.",
  "lang": "en",
  "currency": "EUR",
  "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": "Código do IUC — Portal das Finanças",
      "url": "https://info.portaldasfinancas.gov.pt",
      "checked": "2026-08-05"
    },
    {
      "label": "Tabelas IUC 2026 — DECO PROteste",
      "url": "https://www.deco.proteste.pt/dinheiro/impostos/noticias/tabelas-iuc-quanto-paga",
      "checked": "2026-08-05"
    }
  ],
  "terminalOutput": "iuc",
  "inputs": [
    {
      "name": "cc",
      "type": "number",
      "label": "Cilindrada (cm³)",
      "minimum": 0
    },
    {
      "name": "co2",
      "type": "number",
      "label": "Emissões CO2 (g/km, WLTP)",
      "minimum": 0
    },
    {
      "name": "anoMatricula",
      "type": "number",
      "label": "Ano da 1ª matrícula",
      "minimum": 2007
    },
    {
      "name": "gasoleo",
      "type": "boolean",
      "label": "Gasóleo"
    },
    {
      "name": "eletrico",
      "type": "boolean",
      "label": "100% elétrico (isento)"
    }
  ],
  "outputs": [
    {
      "name": "taxaCilindrada",
      "type": "number",
      "label": "Taxa de cilindrada",
      "format": "currency",
      "formula": "($c := cc; $round($c <= 1250 ? $const.cil1 : $c <= 1750 ? $const.cil2 : $c <= 2500 ? $const.cil3 : $const.cil4, 2))"
    },
    {
      "name": "taxaCo2",
      "type": "number",
      "label": "Taxa de CO2",
      "format": "currency",
      "formula": "($e := co2; $round($e <= 140 ? $const.co21 : $e <= 205 ? $const.co22 : $e <= 260 ? $const.co23 : $const.co24, 2))"
    },
    {
      "name": "coeficiente",
      "type": "number",
      "label": "Coeficiente do ano",
      "formula": "($a := anoMatricula; $a <= 2007 ? 1.00 : $a = 2008 ? 1.05 : $a = 2009 ? 1.10 : 1.15)"
    },
    {
      "name": "adicionalGasoleo",
      "type": "number",
      "label": "Adicional de gasóleo",
      "format": "currency",
      "formula": "($c := cc; $round(gasoleo ? ($c <= 1250 ? $const.ad1 : $c <= 1750 ? $const.ad2 : $c <= 2500 ? $const.ad3 : $const.ad4) : 0, 2))"
    },
    {
      "name": "iuc",
      "type": "number",
      "label": "IUC anual",
      "format": "currency",
      "formula": "$round(eletrico ? 0 : (taxaCilindrada + taxaCo2) * coeficiente + adicionalGasoleo, 2)"
    }
  ],
  "testCases": [
    {
      "description": "C1 gasolina de 2019, 1.395 cm³, 109 g/km — o exemplo publicado",
      "given": {
        "cc": 1395,
        "co2": 109,
        "anoMatricula": 2019,
        "gasoleo": false,
        "eletrico": false
      },
      "expect": {
        "taxaCilindrada": 63.74,
        "taxaCo2": 65.15,
        "coeficiente": 1.15,
        "adicionalGasoleo": 0,
        "iuc": 148.22
      }
    },
    {
      "description": "C2 o mesmo carro em gasóleo — soma o adicional de 10,07 EUR",
      "given": {
        "cc": 1395,
        "co2": 109,
        "anoMatricula": 2019,
        "gasoleo": true,
        "eletrico": false
      },
      "expect": {
        "adicionalGasoleo": 10.07,
        "iuc": 158.29
      }
    },
    {
      "description": "C3 100% elétrico — isento de IUC",
      "given": {
        "cc": 0,
        "co2": 0,
        "anoMatricula": 2024,
        "gasoleo": false,
        "eletrico": true
      },
      "expect": {
        "iuc": 0
      }
    }
  ],
  "spec": {
    "id": "car-tax-portugal",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "cc": {
          "type": "number",
          "minimum": 0
        },
        "co2": {
          "type": "number",
          "minimum": 0
        },
        "anoMatricula": {
          "type": "number",
          "minimum": 2007
        },
        "gasoleo": {
          "type": "boolean"
        },
        "eletrico": {
          "type": "boolean"
        },
        "taxaCilindrada": {
          "type": "number",
          "readOnly": true
        },
        "taxaCo2": {
          "type": "number",
          "readOnly": true
        },
        "coeficiente": {
          "type": "number",
          "readOnly": true
        },
        "adicionalGasoleo": {
          "type": "number",
          "readOnly": true
        },
        "iuc": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "cil1": 31.77,
      "cil2": 63.74,
      "cil3": 127.35,
      "cil4": 435.84,
      "co21": 65.15,
      "co22": 97.63,
      "co23": 212.04,
      "co24": 363.25,
      "ad1": 5.02,
      "ad2": 10.07,
      "ad3": 20.12,
      "ad4": 68.85
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'cc': 1395, 'co2': 109, 'anoMatricula': 2019, 'gasoleo': false, 'eletrico': false }"
      }
    ],
    "derivations": [
      {
        "path": "$.taxaCilindrada",
        "expr": "($c := cc; $round($c <= 1250 ? $const.cil1 : $c <= 1750 ? $const.cil2 : $c <= 2500 ? $const.cil3 : $const.cil4, 2))"
      },
      {
        "path": "$.taxaCo2",
        "expr": "($e := co2; $round($e <= 140 ? $const.co21 : $e <= 205 ? $const.co22 : $e <= 260 ? $const.co23 : $const.co24, 2))"
      },
      {
        "path": "$.coeficiente",
        "expr": "($a := anoMatricula; $a <= 2007 ? 1.00 : $a = 2008 ? 1.05 : $a = 2009 ? 1.10 : 1.15)"
      },
      {
        "path": "$.adicionalGasoleo",
        "expr": "($c := cc; $round(gasoleo ? ($c <= 1250 ? $const.ad1 : $c <= 1750 ? $const.ad2 : $c <= 2500 ? $const.ad3 : $const.ad4) : 0, 2))"
      },
      {
        "path": "$.iuc",
        "expr": "$round(eletrico ? 0 : (taxaCilindrada + taxaCo2) * coeficiente + adicionalGasoleo, 2)"
      }
    ],
    "constraints": [],
    "metaDerivations": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "IUC",
          "layout": "vertical",
          "components": [
            {
              "id": "cc",
              "type": "numericField",
              "label": "Cilindrada (cm³)",
              "bind": "$.cc"
            },
            {
              "id": "co2",
              "type": "numericField",
              "label": "Emissões CO2 (g/km, WLTP)",
              "bind": "$.co2"
            },
            {
              "id": "ano",
              "type": "numericField",
              "label": "Ano da 1ª matrícula",
              "bind": "$.anoMatricula"
            },
            {
              "id": "gasoleo",
              "type": "checkboxField",
              "label": "Gasóleo",
              "bind": "$.gasoleo"
            },
            {
              "id": "eletrico",
              "type": "checkboxField",
              "label": "100% elétrico (isento)",
              "bind": "$.eletrico"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "iucTile",
                  "type": "statTile",
                  "label": "IUC anual",
                  "bind": "$.iuc",
                  "format": "currency",
                  "currency": "EUR"
                }
              ]
            },
            {
              "id": "breakdown",
              "type": "keyValueList",
              "label": "Cálculo",
              "items": [
                {
                  "label": "Taxa de cilindrada",
                  "bind": "$.taxaCilindrada",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Taxa de CO2",
                  "bind": "$.taxaCo2",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "Coeficiente do ano",
                  "bind": "$.coeficiente"
                },
                {
                  "label": "Adicional de gasóleo",
                  "bind": "$.adicionalGasoleo",
                  "format": "currency",
                  "currency": "EUR"
                },
                {
                  "label": "IUC",
                  "bind": "$.iuc",
                  "format": "currency",
                  "currency": "EUR"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'Portugal 2026 — Categoria B (ligeiros de passageiros matriculados a partir de julho de 2007): IUC = (taxa de cilindrada + taxa de CO2) × coeficiente do ano da 1ª matrícula + adicional de gasóleo. Cilindrada: 31,77 EUR até 1.250 cm³, 63,74 até 1.750, 127,35 até 2.500 e 435,84 acima. CO2 (WLTP): 65,15 EUR até 140 g/km, 97,63 até 205, 212,04 até 260 e 363,25 acima. Coeficiente 1,00 (2007), 1,05 (2008), 1,10 (2009) e 1,15 de 2010 em diante. Adicional de gasóleo 5,02 / 10,07 / 20,12 / 68,85 EUR pelos mesmos escalões de cilindrada. Os ligeiros 100% elétricos estão isentos, sem prazo. Estimativa, não é aconselhamento fiscal.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Fontes",
              "items": [
                {
                  "label": "Código do IUC — Portal das Finanças",
                  "url": "https://info.portaldasfinancas.gov.pt",
                  "date": "2026-08-05"
                },
                {
                  "label": "Tabelas IUC 2026 — DECO PROteste",
                  "url": "https://www.deco.proteste.pt/dinheiro/impostos/noticias/tabelas-iuc-quanto-paga",
                  "date": "2026-08-05"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "C1 gasolina de 2019, 1.395 cm³, 109 g/km — o exemplo publicado",
        "given": {
          "$.cc": 1395,
          "$.co2": 109,
          "$.anoMatricula": 2019,
          "$.gasoleo": false,
          "$.eletrico": false
        },
        "expect": {
          "$.taxaCilindrada": 63.74,
          "$.taxaCo2": 65.15,
          "$.coeficiente": 1.15,
          "$.adicionalGasoleo": 0,
          "$.iuc": 148.22
        }
      },
      {
        "description": "C2 o mesmo carro em gasóleo — soma o adicional de 10,07 EUR",
        "given": {
          "$.cc": 1395,
          "$.co2": 109,
          "$.anoMatricula": 2019,
          "$.gasoleo": true,
          "$.eletrico": false
        },
        "expect": {
          "$.adicionalGasoleo": 10.07,
          "$.iuc": 158.29
        }
      },
      {
        "description": "C3 100% elétrico — isento de IUC",
        "given": {
          "$.cc": 0,
          "$.co2": 0,
          "$.anoMatricula": 2024,
          "$.gasoleo": false,
          "$.eletrico": true
        },
        "expect": {
          "$.iuc": 0
        }
      }
    ]
  }
}
