savingsmath

Methodology: how every number on this site is calculated

Last reviewed October 17, 2026

This page describes how the calculator and the retirement payment plan turn your inputs into numbers. Everything runs in your browser; nothing is sent to a server. The same code that draws the charts is tested against published calculators and against the closed-form formulas below.

All results are illustrations. They show what would happen if the assumptions you choose held exactly, every year. Real returns, fees, tax rules and prices do not behave that neatly.

One simulation, month by month

Every result on the site comes from one simulation that steps through your plan one month at a time, from today (year 0) to the last year you choose (up to 80). Each month:

  1. A deposit made at the start of the month is added.
  2. The balance grows by one month’s growth factor.
  3. A deposit made at the end of the month is added.

The calculator’s default is a deposit at the end of every month. With yearly deposits, there is one deposit in the first month (start) or in the twelfth month (end) of each year.

The monthly growth factor for a yearly return r compounded n times a year (1, 4, 12 or 365) is:

monthly factor = (1 + r/n) ^ (n/12)

With monthly compounding (the default) that is simply 1 + r/12. The yearly return you enter is a nominal rate, so compounding more often grows money slightly faster. The effective yearly rate is:

effective yearly rate = (1 + r/n) ^ n − 1

10% compounded monthly is about 10.47% a year; 5% compounded monthly is about 5.12%.

With no deposits, the simulation gives exactly the textbook formula A = P × (1 + r/n) ^ (n × t). Our tests compare the two for a thousand random plans and require them to agree to within one part in a billion.

The example plan

The retirement calculator starts from this plan (the compound interest calculator starts from 10,000 and 100 a month): 1,000 to start, 200 at the end of every month, 10% a year, monthly compounding, 30 years:

  • Put in: 1,000 + 200 × 12 × 30 = 73,000
  • Balance after 30 years: 471,935
  • Interest: 471,935 − 73,000 = 398,935

Savings that rise every year

“Raise my savings with prices” raises the monthly saving once a year: in year k (counting from 0) each deposit is saving × (1 + raise) ^ k. With 200 a month and a 2.5% raise, the deposits in year 30 are about 409 a month.

Index funds and bonds

When you split your money, the calculator uses one weighted return:

mixed return = share in index funds × index return + (1 − share) × bond return

60% at 10% and 40% at 4% gives 7.6% a year. The mixed rate is used as if it were one steady return; the site does not model rebalancing between the two.

When interest overtakes your deposits

The chart marks the first year in which what the money has earned is larger than what you put in, that is, when balance − put in is greater than put in. For the example plan that happens in year 13. With inflation switched on, both sides are compared in today’s money.

Doubling time and the Rule of 72

The time it takes money to double at a yearly return r is ln 2 ÷ ln(1 + r). The Rule of 72 estimates it as 72 ÷ (r in %). At 10% the exact answer is 7.27 years and the rule gives 7.2; at 7% it is 10.24 years against 10.29. Money with a return of 0% or less never doubles, so no doubling time is shown.

Fund fees

Four fees can be switched on. They follow how funds usually charge them:

  • Management fee (TER): taken every year as a share of the whole balance. It lowers the yearly return: r − TER.
  • Performance fee: a share of each year’s gains, nothing in a losing year. It lowers the yearly return by performance fee × r when r is positive.
  • Entry fee: taken from the starting amount and from every deposit before it is invested. Each payment is multiplied by 1 − entry fee.
  • Exit fee: taken once from the balance when you sell. Each year’s balance is shown as if you sold that year: balance × (1 − exit fee).

So the yearly return after fees is:

return after fees = r − performance fee × max(r, 0) − TER

“Fees cost you” is the balance without any costs minus the balance after fees. It therefore includes the growth the fee money would have made had it stayed invested. On the example plan, a 0.2% TER costs about 19,987 (about 4% of the result). An expensive fund at 1.8% TER, 3% entry, 1% exit and a 10% performance fee costs about 219,894 (about 47%).

The fee badge compares fees with the result: low under 8%, watch out under 20%, high from 20%.

Tax on gains

Tax is only ever taken from what your money earned, never from what you put in. There are two modes:

  • Taxed every year (like savings interest or bond coupons): when the return after fees is positive, it is multiplied by 1 − tax rate. Less money stays invested to compound.
  • Taxed when you sell (like accumulating funds): the money grows untaxed; each year shows the tax you would owe if you sold then: tax rate × max(balance − put in, 0), where the balance is after fees and the exit fee and “put in” is everything you paid in before entry fees.

The “tax” figure is the balance after fees minus the balance after tax. On the example plan at 19%, taxed every year costs about 156,475; taxed when you sell, about 75,798. The difference is the growth on tax that stays invested until the end.

This is a simplified model. Real tax rules have allowances, thresholds, holding periods and special accounts that differ by country. Treat these numbers as an estimate, not tax advice.

Inflation: today’s money

With inflation on, every amount is shown in today’s money: what it would pay for at today’s prices.

value in today's money = amount in year t ÷ (1 + inflation) ^ t

“Put in” is converted the same way, each deposit at the prices of the month it was paid. The gap between the statement balance and today’s money is what rising prices take. At 2.5% inflation the example plan’s 471,935 is worth about 224,992 in today’s money. If prices fall (negative inflation), money gains value instead.

The return after inflation used elsewhere on the site is (1 + r) ÷ (1 + inflation) − 1.

Where the money comes from

The money flow diagram splits the final balance by source:

  • Starting amount and savings: what you put in.
  • Interest on each: simple interest, as if the return were never reinvested. For the starting amount that is amount × r × years; for each deposit, deposit × r × the years it was invested.
  • Interest on that interest: everything else, the part that exists only because returns were reinvested.

For the example plan: the starting 1,000 earns 3,000 of simple interest and about 15,837 of interest on interest; the 72,000 of savings earn 107,700 of simple interest and about 272,398 of interest on interest. Together, interest on interest is about 288,000 of the 471,935.

On the right, the balance splits into fees, tax, rising prices and what you keep. With negative returns, a source shows what it lost instead of what it earned. Every box’s inflow equals its outflow.

Market risk

The straight-line result assumes the same return every year. “Include market risk” replaces it with a Monte Carlo simulation:

  • 2,000 possible paths, each with a random return every month.
  • Monthly returns are log-normal, with an annual volatility of 15%, typical of a broad stock index.
  • The returns are set so that the average growth equals the steady return you entered, with fees and tax applied the same way as in the straight-line result.
  • The band shows the 10th to 90th percentile of the outcomes (“8 in 10 outcomes”), with the median (50th percentile) as the line.

Because a few very good paths pull the average up, the median path ends below the straight-line result; in a typical run of the example plan it is somewhere around 370,000 rather than 471,935. The random numbers come from a seeded generator, so the same inputs always show the same band. Real markets can behave differently from this model: crashes cluster, and returns are not independent from month to month.

Then it could pay you

The payout block turns the final balance into a monthly amount:

  • 10 or 20 years: an annuity that uses the pot up over that time while the rest keeps growing at the yearly return (the return after inflation, when inflation is on). The monthly rate is the equivalent of the yearly rate, i = (1 + R) ^ (1/12) − 1, and the payment is

    monthly payment = pot × i ÷ (1 − (1 + i) ^ −months)
    

    At a 0% return the pot is simply divided by the number of months.

  • Indefinitely: the 4% rule, pot × 4% ÷ 12.

For the example plan at 10%: about 6,125 a month for 10 years, 4,420 for 20 years, and 1,573 indefinitely. With fees, tax or inflation on, the same factor is applied to what each of them took, so the bar shows what they cost per month.

Retirement payment plan

The retirement plan (step 2) takes three values from step 1, the starting amount, the monthly saving and the yearly return, and grows them monthly (deposits at the end of each month) until your retirement age. Step 1’s fees, tax and savings raise are not carried into this pot.

  • Pot at retirement: the balance at your retirement age, in today’s money when inflation is on.
  • Tax on withdrawals: only the gain part of each withdrawal is taxed. The gain share is 1 − put in ÷ pot. To spend a given amount after tax you withdraw spending ÷ (1 − tax rate × gain share).
  • FIRE number: 25 times a year of withdrawals, the same as yearly withdrawals ÷ 4%.
  • Progress: pot ÷ FIRE number.
  • Income at the 4% rule: pot × 4% ÷ 12, after tax on the gain share.
  • How long it lasts: from retirement to age 100, each month the pot grows at the return while retired (after inflation, when inflation is on) and your withdrawal is taken out. With inflation on, the withdrawal stays the same in today’s money, so it rises with prices on a statement. The plan “runs out” at the first age the balance reaches zero. The 4% rule line does the same with a withdrawal of 4% of the pot a year.
  • Age you reach the FIRE number: the first age at which your balance, if you kept saving as in step 1, reaches the FIRE number.
  • Monthly saving needed: the monthly deposit that would reach the FIRE number by your retirement age at step 1’s return.

For the defaults (age 30, retiring at 60, spending 1,200 a month in retirement, 10% a year): pot 471,935, FIRE number 360,000, progress 131%, income at the 4% rule 1,573 a month, FIRE number reached at 58.

Coast FIRE

For the Coast FIRE examples:

FIRE number  = yearly spending ÷ withdrawal rate
Coast number = FIRE number ÷ (1 + real return) ^ years to retirement

The age at which you reach Coast FIRE is the first age at which your savings, growing at the real return (compounded monthly at the equivalent monthly rate, deposits at the end of each month), are at least the Coast number for the years left. With a 0% real return the Coast number equals the FIRE number.

Precision and rounding

  • Plain numbers, full precision. All maths uses standard double-precision floating-point numbers. Nothing is rounded inside a calculation; amounts keep all their digits until they are shown. Over the longest plans the site allows, the accumulated error stays around a ten-trillionth of the balance, far below a cent.
  • Stable formulas for small rates. Growth factors are computed with log1p and expm1 so tiny daily rates do not lose digits.
  • Rounding only for display. Numbers are rounded once, when formatted for your language and currency.
  • Parts add up. Where parts are shown next to their total (table rows, money flow labels, “put in + interest = balance”), they are rounded with the largest-remainder method, so the rounded parts always add up to the rounded total.
  • Checked inputs. Every input has bounds (for example 0 to 80 years, a return between −20% and 30%, inflation between −5% and 20%). Values outside them are never calculated.
  • Currency. Switching currency changes the symbol and the suggested amounts, never the numbers you typed. There is no exchange-rate conversion.

How we test it

The calculations are covered by automated tests that run on every change. They include these reference cases from published calculators:

Case Expected
10,000 at 4%, daily compounding, 1 year interest 408.08
10,000 at 4%, daily compounding, 10 years 14,917.92
5,000 at 5%, monthly compounding, 5 years 6,416.79; effective rate 5.12%
10,000 at 5%, yearly compounding, 20 years 26,532.98
5,000 at 7%, monthly compounding, 70 years 661,958; 117,533 in today’s money at 2.5% inflation
5 a day (5 × 365 ÷ 12 a month) at 7%, 30 years 185,537

Other tests check that balances always equal what was put in plus growth minus costs, that money flow parts add up to the total, that every rate set to 0 returns exactly what was put in, and that extreme inputs (80 years, the largest amounts, negative returns, falling prices) give finite numbers.

Sources for historical figures

The site quotes two historical figures. Both describe the past: they help put the defaults in context, but past returns do not predict future ones.

  • Long-run stock returns, about 8.5% a year. Source: MSCI, factsheet of the MSCI World index, gross returns with dividends reinvested, in US dollars, annualised from the end of 1987 to April 2025. The index covers large and mid-sized companies in 23 developed countries, so it is a fair picture of a broad world index fund. The figure is an average over almost four decades that include deep falls and long rises; single years were far above and below it, and it comes before fees, tax, inflation and currency changes.
  • The 4% rule. Sources: a 1994 study in the Journal of Financial Planning, and the 1998 Trinity University study published in the AAII Journal. Both tested every 30-year period in past US market data, mostly with portfolios of US shares and bonds. They show how often a 4% first-year withdrawal, raised with prices, would have lasted in the past; they do not show that it will last in the future, in other countries, or for retirements longer than 30 years.

Limits

  • Returns, inflation, fees and tax are constant for the whole plan, except in the market-risk band.
  • Tax rules are simplified to one rate and two modes.
  • Pensions, social security, other income and one-off expenses are not included.
  • The 4% rule is a rule of thumb from historical US data, not a promise.

If you find a number that looks wrong, please tell us through the contact details on the About page.

Educational content, not financial advice.