How the Sweden fordonsskatt calculator is verified
Inputs
| Input | Field | Type |
|---|---|---|
| CO₂ (g/km) | co2 | number |
| Bilens ålder (år sedan den blev skattepliktig) | ageYears | number |
The formula
Each derived value below is computed by the Valem engine from the expression shown, in this order. Nothing else runs — there is no hidden code path.
| Derived value | Field | Formula (JSONata) |
|---|---|---|
| I Malus | iMalus | ageYears < $const.malusAr ? 1 : 0 |
| Koldioxidbelopp | co2Belopp | ($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))) |
| Fordonsskatt / år | tax | $round($const.grundbelopp + co2Belopp, 2) |
Rates and thresholds
The expressions above read these as $const. They are the figures the annual refresh replaces, so they live as data rather than being written into the formulas — which is what makes a year-on-year change a one-line diff instead of an edit to arithmetic.
| Constant | Value |
|---|---|
grundbelopp | 360 |
malusGrans1 | 75 |
malusGrans2 | 125 |
malusSats1 | 107 |
malusSats2 | 132 |
malusAr | 3 |
standardGrans | 111 |
standardSats | 22 |
Test vectors (3)
Every case is executed against this model on each build, by the Java engine and independently by a JavaScript one. A mismatch of a single cent fails the build, so the page cannot ship advertising a figure the model no longer produces.
Case 1 — C1 100 g/km, nyare bil — det publicerade räkneexemplet
given co2 | 100 |
|---|---|
given ageYears | 1 |
expect iMalus | 1 |
expect co2Belopp | 2675 |
expect tax | 3035 |
Case 2 — C2 150 g/km under malusperioden — båda satserna
given co2 | 150 |
|---|---|
given ageYears | 1 |
expect co2Belopp | 8650 |
expect tax | 9010 |
Case 3 — C3 samma bil efter malusperioden — standardsatsen
given co2 | 150 |
|---|---|
given ageYears | 5 |
expect iMalus | 0 |
expect co2Belopp | 858 |
expect tax | 1218 |
Sources
- Transportstyrelsen · checked 2026-08-05
Check it yourself — and reuse it
The whole model as JSON — inputs, outputs, formulas, vectors and sources in one re-runnable document.
This model is published under CC BY 4.0: use it, adapt it, build on it, with attribution. The licence covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds are law, and nobody licenses those; the sources above are where they come from.
← Back to the Sweden fordonsskatt calculator
Built with Valem — a live, verifiable calculator you can fork and embed.