Financial software

Building a UK retirement calculator that tells the truth

Most retirement calculators answer the wrong question. They tell you how big your pot is. What you actually want to know is what you get to spend.

/10 min read

Gross is a vanity number

A pension pot figure feels precise and means very little on its own. Two people with identical pots can have materially different retirements depending on where they live, how their income is structured, when they draw it, and in what order they spend from which account.

So the model we built outputs net spend per year — money available after tax, in today's terms — and treats the pot as an input rather than the answer. That single reframing changed most of the interface as well as most of the maths.

Why UK tax modelling is difficult

The UK does not have one income tax. Scotland sets its own bands and rates for non-savings income while savings and dividend income remain UK-wide, so a single taxpayer can be sitting in two different band structures at once.

Then there are the effective-rate cliffs that no rate table shows: the personal allowance taper, the high income child benefit charge, the pension annual allowance taper, and the interaction of the marriage allowance with band boundaries. Between them they create marginal rates well above any headline rate, in narrow income ranges people routinely walk into by accident.

Retirement adds more: the tax-free lump sum, how drawdown income stacks on top of the state pension, the personal savings allowance, the starting rate for savings, dividend and capital gains allowances, and the fact that ISA withdrawals are invisible to all of it.

The engineering consequence is that you cannot compute tax with a formula. You need an ordered pipeline of rules operating on a typed income breakdown, with each rule able to see the running totals produced by the ones before it.

How the engine is structured

Income is decomposed by type — employment, self-employment, savings interest, dividends, pension, and tax-free — because every downstream rule cares about type, not just amount.

Rules are pure functions applied in a defined order for a given tax year and jurisdiction. Each returns both a number and an explanation, which is what lets the interface show the working rather than just a total. A calculator that cannot explain itself does not get trusted, and rightly so.

Tax year parameters live in versioned data, not in code. Rates change annually, thresholds freeze and unfreeze, and Scotland diverges further most years. Keeping the parameters separate means a new tax year is a data change plus tests, not a refactor.

Everything is computed in real terms with an explicit inflation assumption, because a plan denominated in nominal pounds thirty years out is theatre.

Salary sacrifice and the accumulation side

Salary sacrifice is one of the few genuinely free improvements available to a UK employee, and it is badly served by most tools. Reducing gross pay before tax and National Insurance changes take-home pay by less than the amount sacrificed, and it can move someone back below a threshold that was costing them an outsized marginal rate.

Modelling it properly means computing take-home pay twice and showing the delta, rather than quoting a contribution percentage. Seeing that an extra hundred pounds into a pension costs sixty pounds of take-home pay is the moment the tool becomes useful.

Withdrawal sequencing is where the value is

In decumulation the interesting question is not how much to withdraw but from where. Drawing from ISAs, pensions and general savings in different orders produces different lifetime tax bills from identical starting positions.

The engine models a year at a time: fill the personal allowance with taxable income, use tax-free sources to top up spend without crossing a band, keep an eye on the years before and after state pension age when the shape of income changes abruptly.

We deliberately stopped short of advice. The tool shows what happens under stated assumptions and makes those assumptions editable and visible. Anything that started to look like a recommendation was cut.

Testing something with no obvious oracle

Financial calculators fail quietly. A wrong number looks exactly like a right one, so tests carry more weight than usual.

We test rules individually against published worked examples, test boundaries exhaustively — a pound either side of every threshold, in every jurisdiction — and run property-based checks for invariants like monotonicity: earning more should never reduce net income except where the rules genuinely say it does, and where they do, the test asserts the size of the cliff.