DEV Community

ke ja
ke ja

Posted on Edited on

The £100k Tax Trap and Other Joys: Building One Take-Home Pay Engine for Four Countries

Every extra £100 in that band is taxed at 40% (£40), and it also destroys £50 of allowance, which gets taxed at 40% too (£20) — plus 2% National Insurance. £62 gone from £100, from a system whose headline rates say 40%. Modelling this is three lines of code; discovering it requires reading the allowance rules instead of the rate table. Scotland, meanwhile, runs six bands of its own (19% to 48%) on the same payslip infrastructure, so "UK tax" is really two engines wearing one coat. On £100,000 in England the full result: £27,432 income tax, £4,011 NI, £68,557 take-home.

Australia: the debt repayment that isn't a tax

Australia layers three different things on top of income tax. The Medicare levy is a flat 2% — easy. The LITO is a low-income offset that phases out — fiddly but fine. The genuinely strange one is HELP (student debt) repayment: it's collected through payroll like a tax, it's calculated on "repayment income", and since the 2025-26 reform it's marginal — you pay a percentage only on the slice above the threshold, with the rate stepping up across bands. Model it as a percentage of total income, the way it worked for decades, and every payslip with a student debt is wrong.

On $100,000 with no HELP debt: $20,520 tax, $2,000 Medicare levy, $77,480 take-home — and $12,000 of employer superannuation that sits on top of the salary and must never be deducted from it, a mistake roughly half the home-grown spreadsheets I found seem to make.

Ireland: the rate that changes mid-year

Ireland stacks income tax (with credits, not allowances — a different shape again), USC (a separate surcharge with its own bands), and PRSI. PRSI is the fun one: the employee rate changes during the tax year, so the engine can't store a single annual rate — it has to annualise a part-year rate change and apply the blend. There's also a new auto-enrolment pension (My Future Fund) landing in the same payslip. On €50,000, single with standard credits: €39,648 take-home after €3,200 net income tax, €1,033 USC and €2,119 PRSI.

New Zealand: the levy priced per hundred dollars

New Zealand is the cleanest — PAYE bands, no credits maze — except for the ACC levy, an accident-insurance charge priced per $100 of liable earnings up to a cap, which means it's a rate with a ceiling baked into its definition. On NZ$100,000: $22,878 tax, $1,750 ACC, $75,373 take-home before KiwiSaver enters the picture.

The rule that held across all four

Every parameter in these engines was verified against the official source (GOV.UK, the ATO, Revenue Ireland, Inland Revenue) before it was coded — and where an official figure didn't exist yet, the feature didn't ship. Australia's 2026-27 redundancy tax-free amounts weren't published when I built the site, so there is no redundancy calculator. An empty slot in the nav is a better product than a confident wrong number.

The engines are plain JavaScript, no dependencies, each with a test file of hand-computed cases including the boundary salaries — £100,000 on the taper edge, the exact dollar where a HELP band steps up. If you maintain anything that models other people's rules, I'd like to hear how you test the edges. That's where these systems keep their secrets.

Data sources

Top comments (0)