How the Estonia car tax calculator is verified
Inputs
| Input | Field | Type |
|---|---|---|
| CO₂ emissions (g/km, WLTP) | co2 | number |
| Gross mass (kg) | mass | 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) |
|---|---|---|
| CO₂ over 117 g/km | co2Over | ($x := co2 - $const.co2Free; $round($x > 0 ? $x : 0, 2)) |
| Mass Over | massOver | ($x := mass - $const.massFree; $round($x > 0 ? $x : 0, 2)) |
| Annual CO₂ component | annualCo2 | $round($const.annualCo2Rate * co2Over, 2) |
| Annual weight component | annualWeight | $round($const.annualMassRate * massOver, 2) |
| Annual tax | annualTax | $round($const.annualBase + annualCo2 + annualWeight, 2) |
| Reg Co2 | regCo2 | $round($const.regCo2Rate * co2Over, 2) |
| Registration (one-time) | registrationTax | $round($const.regBase + regCo2, 2) |
| First-year total | firstYearTotal | $round(annualTax + registrationTax, 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 |
|---|---|
co2Free | 117 |
massFree | 2000 |
annualBase | 50 |
annualCo2Rate | 3 |
annualMassRate | 0.2 |
regBase | 300 |
regCo2Rate | 5 |
Test vectors (2)
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 — 150 g/km, 1800 kg
given co2 | 150 |
|---|---|
given mass | 1800 |
expect co2Over | 33 |
expect annualTax | 149 |
expect registrationTax | 465 |
expect firstYearTotal | 614 |
Case 2 — 95 g/km (below CO2 threshold), 2500 kg heavy
given co2 | 95 |
|---|---|
given mass | 2500 |
expect co2Over | 0 |
expect annualWeight | 100 |
expect annualTax | 150 |
expect registrationTax | 300 |
expect firstYearTotal | 450 |
Sources
- EMTA — vehicle tax calculator · checked 2026-08-02
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 Estonia car tax calculator
Built with Valem — a live, verifiable calculator you can fork and embed.