How the Malta self-occupied calculator is verified

Inputs

InputFieldType
Annual net income after expenses (EUR)annualNetIncomenumber

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)
Class 2 contributions (15%)class2Contributions$round(annualNetIncome <= $const.class2Floor ? 0 : $min([annualNetIncome * $const.class2Rate, $const.class2AnnualMax]), 2)
Income tax (single rates)incomeTax($i := annualNetIncome; $round($const.r2 * $max([0, $min([$i, $const.b2]) - $const.free]) + $const.r3 * $max([0, $min([$i, $const.b3]) - $const.b2]) + $const.r4 * $max([0, $i - $const.b3]), 2))
Net income / yearnetIncome$round($max([0, annualNetIncome - class2Contributions - incomeTax]), 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
class2Rate0.15
class2AnnualMax4362.28
class2Floor910
free9100
b214500
b319500
r20.15
r30.25
r40.35

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 — 35,000 EUR net income — a typical full-time self-occupied person

given annualNetIncome35000
expect class2Contributions4362.28
expect incomeTax7485
expect netIncome23152.72

Case 2 — 12,000 EUR — part-time, inside the 15% band

given annualNetIncome12000
expect class2Contributions1800
expect incomeTax435
expect netIncome9765

Case 3 — 80,000 EUR — Class 2 contributions capped out

given annualNetIncome80000
expect class2Contributions4362.28
expect incomeTax23235
expect netIncome52402.72

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 Malta self-occupied calculator

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