How the Singapore net pay calculator is verified
Inputs
| Input | Field | Type |
|---|---|---|
| Gross annual salary (SGD) | grossAnnual | 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) |
|---|---|---|
| Employee CPF (20%) | cpf | $round((grossAnnual < $const.cpfCeiling ? grossAnnual : $const.cpfCeiling) * $const.cpfRate, 2) |
| Chargeable income | taxableIncome | $round(grossAnnual - cpf, 2) |
| Income tax | incomeTax | ($t := taxableIncome; $round((($t > 20000 ? (($t < 30000 ? $t : 30000) - 20000) : 0) * 0.02) + (($t > 30000 ? (($t < 40000 ? $t : 40000) - 30000) : 0) * 0.035) + (($t > 40000 ? (($t < 80000 ? $t : 80000) - 40000) : 0) * 0.07) + (($t > 80000 ? (($t < 120000 ? $t : 120000) - 80000) : 0) * 0.115) + (($t > 120000 ? (($t < 160000 ? $t : 160000) - 120000) : 0) * 0.15) + (($t > 160000 ? (($t < 200000 ? $t : 200000) - 160000) : 0) * 0.18) + (($t > 200000 ? (($t < 240000 ? $t : 240000) - 200000) : 0) * 0.19) + (($t > 240000 ? (($t < 280000 ? $t : 280000) - 240000) : 0) * 0.195) + (($t > 280000 ? (($t < 320000 ? $t : 320000) - 280000) : 0) * 0.20) + (($t > 320000 ? ($t - 320000) : 0) * 0.22), 2)) |
| Net / year (after CPF & tax) | netAnnual | $round(grossAnnual - cpf - 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.
| Constant | Value |
|---|---|
cpfRate | 0.2 |
cpfCeiling | 96000 |
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 60,000 SGD, age 30
given grossAnnual | 60000 |
|---|---|
expect cpf | 12000 |
expect taxableIncome | 48000 |
expect incomeTax | 1110 |
expect netAnnual | 46890 |
Case 2 — S3 300,000 SGD — CPF ceiling binds
given grossAnnual | 300000 |
|---|---|
expect cpf | 19200 |
expect taxableIncome | 280800 |
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 Singapore net pay calculator
Built with Valem — a live, verifiable calculator you can fork and embed.