How the Denmark løn efter skat calculator is verified

Inputs

InputFieldType
Bruttoløn / år (DKK)grossAnnualnumber
Kommunekommunestring
Kommuneskat hvis « Anden » (f.eks. 0.251)customMunicipalRatenumber

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)
KommuneskatmunicipalRate($s := kommune; $s = 'gennemsnit' ? $const.rateGennemsnit : $s = 'koebenhavn' ? $const.rateKoebenhavn : $s = 'hoejeste' ? $const.rateHoejeste : customMunicipalRate)
Atpatp$round(grossAnnual > 0 ? $const.atpAnnual : 0, 2)
AM-bidrag (8%)amBidrag($b := grossAnnual - atp; $round(($b > 0 ? $b : 0) * $const.amRate, 2))
After AmafterAm($a := grossAnnual - amBidrag - atp; $round($a > 0 ? $a : 0, 2))
Skattepligtigtaxable($b := afterAm - $const.personalAllowance; $round($b > 0 ? $b : 0, 2))
Bund + kommuneskatbottomMunicipal$round(taxable * ($const.bottomRate + municipalRate), 2)
MellemskatmellemTax$round(afterAm > $const.mellemThreshold ? (afterAm - $const.mellemThreshold) * $const.mellemRate : 0, 2)
TopskattopTax$round(afterAm > $const.topThreshold ? (afterAm - $const.topThreshold) * $const.topRate : 0, 2)
Top Top TaxtopTopTax$round(grossAnnual > $const.topTopThreshold ? (grossAnnual - $const.topTopThreshold) * $const.topTopRate : 0, 2)
Netto / årnetAnnual$round(grossAnnual - amBidrag - atp - bottomMunicipal - mellemTax - topTax - topTopTax, 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
atpAnnual1188
amRate0.08
personalAllowance54100
bottomRate0.1201
mellemThreshold641200
mellemRate0.075
topThreshold777900
topRate0.075
topTopThreshold2818152
topTopRate0.05
rateGennemsnit0.2543
rateKoebenhavn0.2339
rateHoejeste0.263

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 — S1 420,000 DKK, average municipality

given grossAnnual420000
given kommuneanden
given customMunicipalRate0.251
expect atp1188
expect amBidrag33504.96
expect afterAm385307.04
expect taxable331207.04

Case 2 — S3 900,000 DKK — mellemskat and topskat both bind

given grossAnnual900000
given kommuneanden
given customMunicipalRate0.251
expect amBidrag71904.96
expect afterAm826907.04
expect mellemTax13928.03
expect topTax3675.53

Case 3 — S2 420.000 kr. i København — landets laveste kommuneskat

given grossAnnual420000
given kommunekoebenhavn
expect municipalRate0.2339
expect bottomMunicipal117247.29

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 Denmark løn efter skat calculator

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