How the Norway lønn etter skatt calculator is verified

Inputs

InputFieldType
Bruttolønn / år (NOK)grossAnnualnumber

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 valueFieldFormula (JSONata)
Trygdeavgift (7,7%)trygdeavgift$round(grossAnnual * $const.trygdeRate, 2)
Min DeductionminDeduction($m := grossAnnual * $const.minDeductionRate; $round($m < $const.minDeductionCap ? $m : $const.minDeductionCap, 2))
Alminnelig inntekt (base)ordinaryBase($b := grossAnnual - minDeduction - $const.personalAllowance; $round($b > 0 ? $b : 0, 2))
Skatt 22%ordinaryTax$round(ordinaryBase * $const.ordinaryRate, 2)
TrinnskattbracketTax($g := grossAnnual; $round((($g > 226100 ? (($g < 318300 ? $g : 318300) - 226100) : 0) * 0.017) + (($g > 318300 ? (($g < 725050 ? $g : 725050) - 318300) : 0) * 0.040) + (($g > 725050 ? (($g < 980100 ? $g : 980100) - 725050) : 0) * 0.137) + (($g > 980100 ? (($g < 1467200 ? $g : 1467200) - 980100) : 0) * 0.168) + (($g > 1467200 ? ($g - 1467200) : 0) * 0.178), 2))
Netto / årnetAnnual$round(grossAnnual - trygdeavgift - ordinaryTax - bracketTax, 2)
Netto / månednetMonthly$round(netAnnual / 12, 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.

ConstantValue
trygdeRate0.076
minDeductionRate0.46
minDeductionCap95700
personalAllowance114540
ordinaryRate0.22

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 — S1 600,000 NOK

given grossAnnual600000
expect trygdeavgift45600
expect minDeduction95700
expect ordinaryBase389760
expect ordinaryTax85747.2

Case 2 — S3 900,000 NOK

given grossAnnual900000
expect trygdeavgift68400
expect ordinaryBase689760
expect ordinaryTax151747.2

Sources

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 Norway lønn etter skatt calculator

Built with Valem — a live, verifiable calculator you can fork and embed.