{
  "$comment": "Machine-readable companion to https://valem.run/calculators/sweden/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/sweden/car-tax",
  "dataUrl": "https://valem.run/calculators/sweden/car-tax.json",
  "license": {
    "name": "CC BY 4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "attribution": "Sweden fordonsskatt model by Valem (https://valem.run/calculators/sweden/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/sweden/car-tax/verify",
  "country": "sweden",
  "countryName": "Sweden",
  "formula": "car-tax",
  "formulaName": "Fordonsskatt",
  "title": "Fordonsskatt — Sweden car tax",
  "answer": "Sweden's vehicle tax charges new petrol and diesel cars a CO2 malus in years 1-3, then a lower standard rate.",
  "lang": "en",
  "currency": "SEK",
  "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": "Transportstyrelsen",
      "url": "https://www.transportstyrelsen.se",
      "checked": "2026-08-05"
    }
  ],
  "terminalOutput": "tax",
  "inputs": [
    {
      "name": "co2",
      "type": "number",
      "label": "CO₂ (g/km)",
      "minimum": 0
    },
    {
      "name": "ageYears",
      "type": "number",
      "label": "Bilens ålder (år sedan den blev skattepliktig)",
      "minimum": 0
    }
  ],
  "outputs": [
    {
      "name": "iMalus",
      "type": "number",
      "formula": "ageYears < $const.malusAr ? 1 : 0"
    },
    {
      "name": "co2Belopp",
      "type": "number",
      "label": "Koldioxidbelopp",
      "format": "currency",
      "formula": "($c := co2; iMalus = 1 ? $round((($c > $const.malusGrans1 ? (($c < $const.malusGrans2 ? $c : $const.malusGrans2) - $const.malusGrans1) : 0) * $const.malusSats1) + (($c > $const.malusGrans2 ? ($c - $const.malusGrans2) : 0) * $const.malusSats2), 2) : ($x := ($c - $const.standardGrans) * $const.standardSats; $round($x > 0 ? $x : 0, 2)))"
    },
    {
      "name": "tax",
      "type": "number",
      "label": "Fordonsskatt / år",
      "format": "currency",
      "formula": "$round($const.grundbelopp + co2Belopp, 2)"
    }
  ],
  "testCases": [
    {
      "description": "C1 100 g/km, nyare bil — det publicerade räkneexemplet",
      "given": {
        "co2": 100,
        "ageYears": 1
      },
      "expect": {
        "iMalus": 1,
        "co2Belopp": 2675,
        "tax": 3035
      }
    },
    {
      "description": "C2 150 g/km under malusperioden — båda satserna",
      "given": {
        "co2": 150,
        "ageYears": 1
      },
      "expect": {
        "co2Belopp": 8650,
        "tax": 9010
      }
    },
    {
      "description": "C3 samma bil efter malusperioden — standardsatsen",
      "given": {
        "co2": 150,
        "ageYears": 5
      },
      "expect": {
        "iMalus": 0,
        "co2Belopp": 858,
        "tax": 1218
      }
    }
  ],
  "spec": {
    "id": "car-tax-sweden",
    "version": "1.0.0",
    "schema": {
      "type": "object",
      "properties": {
        "co2": {
          "type": "number",
          "minimum": 0
        },
        "ageYears": {
          "type": "number",
          "minimum": 0
        },
        "iMalus": {
          "type": "number",
          "readOnly": true
        },
        "co2Belopp": {
          "type": "number",
          "readOnly": true
        },
        "tax": {
          "type": "number",
          "readOnly": true
        }
      }
    },
    "constants": {
      "grundbelopp": 360,
      "malusGrans1": 75,
      "malusGrans2": 125,
      "malusSats1": 107,
      "malusSats2": 132,
      "malusAr": 3,
      "standardGrans": 111,
      "standardSats": 22
    },
    "defaultValues": [
      {
        "path": "$",
        "expr": "{ 'co2': 100, 'ageYears': 1 }"
      }
    ],
    "derivations": [
      {
        "path": "$.iMalus",
        "expr": "ageYears < $const.malusAr ? 1 : 0"
      },
      {
        "path": "$.co2Belopp",
        "expr": "($c := co2; iMalus = 1 ? $round((($c > $const.malusGrans1 ? (($c < $const.malusGrans2 ? $c : $const.malusGrans2) - $const.malusGrans1) : 0) * $const.malusSats1) + (($c > $const.malusGrans2 ? ($c - $const.malusGrans2) : 0) * $const.malusSats2), 2) : ($x := ($c - $const.standardGrans) * $const.standardSats; $round($x > 0 ? $x : 0, 2)))"
      },
      {
        "path": "$.tax",
        "expr": "$round($const.grundbelopp + co2Belopp, 2)"
      }
    ],
    "constraints": [],
    "metaDerivations": [],
    "viewDefinition": {
      "renderer": "builtin",
      "defaultView": "main",
      "views": [
        {
          "id": "main",
          "label": "Fordonsskatt",
          "layout": "vertical",
          "components": [
            {
              "id": "co2",
              "type": "numericField",
              "label": "CO₂ (g/km)",
              "bind": "$.co2"
            },
            {
              "id": "age",
              "type": "numericField",
              "label": "Bilens ålder (år sedan den blev skattepliktig)",
              "bind": "$.ageYears"
            },
            {
              "id": "tiles",
              "type": "group",
              "layout": "horizontal",
              "components": [
                {
                  "id": "taxTile",
                  "type": "statTile",
                  "label": "Fordonsskatt / år",
                  "bind": "$.tax",
                  "format": "currency",
                  "currency": "SEK"
                }
              ]
            },
            {
              "id": "breakdown",
              "type": "keyValueList",
              "label": "Beräkning",
              "items": [
                {
                  "label": "Koldioxidbelopp",
                  "bind": "$.co2Belopp",
                  "format": "currency",
                  "currency": "SEK"
                },
                {
                  "label": "Fordonsskatt per år",
                  "bind": "$.tax",
                  "format": "currency",
                  "currency": "SEK"
                }
              ]
            },
            {
              "id": "note",
              "type": "staticText",
              "text": "'Sverige 2026: fordonsskatten är ett grundbelopp på 360 kr per år plus ett koldioxidbelopp. Under de tre första åren gäller malus: 107 kr per gram för utsläpp över 75 och upp till 125 g/km, och 132 kr per gram däröver. En bil på 100 g/km betalar alltså 360 + (100 − 75) × 107 = 3 035 kr per år under malusperioden. Därefter gäller standardsatsen 22 kr per gram över 111 g/km. Uppskattning, inte skatterådgivning.'"
            },
            {
              "id": "sources",
              "type": "sourceList",
              "label": "Källor",
              "items": [
                {
                  "label": "Transportstyrelsen",
                  "url": "https://www.transportstyrelsen.se",
                  "date": "2026-08-05"
                }
              ]
            }
          ]
        }
      ]
    },
    "tests": [
      {
        "description": "C1 100 g/km, nyare bil — det publicerade räkneexemplet",
        "given": {
          "$.co2": 100,
          "$.ageYears": 1
        },
        "expect": {
          "$.iMalus": 1,
          "$.co2Belopp": 2675,
          "$.tax": 3035
        }
      },
      {
        "description": "C2 150 g/km under malusperioden — båda satserna",
        "given": {
          "$.co2": 150,
          "$.ageYears": 1
        },
        "expect": {
          "$.co2Belopp": 8650,
          "$.tax": 9010
        }
      },
      {
        "description": "C3 samma bil efter malusperioden — standardsatsen",
        "given": {
          "$.co2": 150,
          "$.ageYears": 5
        },
        "expect": {
          "$.iMalus": 0,
          "$.co2Belopp": 858,
          "$.tax": 1218
        }
      }
    ]
  }
}
