The short version
The calculator walks through your retirement one month at a time. In each month it adds investment growth, takes out your withdrawal, and then nudges next month’s withdrawal upward for inflation. It repeats that until the balance first reaches zero, and reports how many months that took. If the balance never reaches zero it stops after 1,200 months, which is 100 years, and tells you the money did not run out.
It could have been done with a single annuity formula, which would be faster and shorter. We use an explicit loop on purpose: a loop can handle a Social Security benefit that starts in eight years, or a tax gross-up, or any future feature, without the arithmetic becoming unexplainable. Transparency is worth more here than elegance.
Turning annual rates into monthly ones
You enter annual figures, but the projection runs monthly, so both rates are converted by compounding rather than by dividing by twelve. Dividing would slightly overstate growth.
monthlyReturn = (1 + annualReturn / 100) ^ (1 / 12) - 1monthlyInflation = (1 + annualInflation / 100) ^ (1 / 12) - 1
A 6% annual return becomes roughly 0.4868% a month, which compounds back to exactly 6% over twelve months. A 3% inflation rate becomes about 0.2466% a month.
What happens inside each month
The order of these five steps is fixed, and it matters:
- Outside income is determined. If the Social Security block is on and you have reached the benefit start age, the monthly benefit counts as income for this month. Otherwise income is zero.
- A tax allowance is added. If the tax block is on, the withdrawal is multiplied by
1 + taxRate / 100: the figure you entered, plus the same percentage again as an allowance for the tax on the withdrawal. This is deliberately a simple add-on, not an exact gross-up — dividing by1 − taxRate / 100would be the exact inverse, and at typical effective rates the two differ by a few percent of the withdrawal. We use the simpler form and say so, rather than imply a precision the model does not have. - Income is subtracted. The net amount taken from the portfolio is the grossed-up withdrawal minus any income. If income exceeds the withdrawal, this number goes negative and the portfolio grows.
- The balance is updated.
balance = balance × (1 + monthlyReturn) - netWithdrawal. Growth is applied first, then the money comes out, which is equivalent to withdrawing at the end of the month. - Next month’s withdrawal grows. If inflation adjusting is on, the withdrawal is multiplied by
1 + monthlyInflationready for the following month.
The month counter increments, the new balance is recorded for the chart, and if the balance has reached zero or below the loop stops there. That stopping month, converted to years and months, is the headline number on every calculator page.
The 4% rule comparison
Alongside your own scenario, the calculator runs a second, identical projection with exactly one thing changed: the withdrawal is set to 4% of your opening balance, divided by twelve. Every other input, including your return, your inflation rate, your tax setting and your Social Security settings, is held constant between the two runs.
That is deliberate. Because only one variable differs, the gap in years between the two results is attributable to the withdrawal rate alone, which makes it a genuinely fair comparison rather than a marketing number. The 4% rule guide explains what the benchmark does and does not claim.
Input limits, and why they exist
- Balance must be greater than zero. There is nothing to project otherwise.
- Withdrawal must be zero or more. Negative withdrawals would be contributions, which this tool does not model.
- Annual return is limited to between -20% and 30%. Outside that range the projection stops describing any plausible portfolio.
- Inflation is limited to between 0% and 20%.
- Effective tax rate is limited to between 0% and 60%.
Out-of-range or unparseable entries produce a plain inline message next to the field. The calculator will not show you a blank result, an error page, or an impossible number. If a field is temporarily invalid, your last valid result stays on screen so you never lose your place.
What the calculator does not do
These limitations are real and worth understanding before you rely on any figure here.
- Returns are perfectly smooth. Every month earns the same rate. Real markets do not work that way, and the order in which good and bad years arrive changes outcomes significantly. This is the single largest simplification in the model.
- No Monte Carlo simulation. There is one deterministic projection, not a thousand randomised ones. That makes the arithmetic inspectable, and it means the result is a comparison of choices rather than a probability of success.
- Social Security does not receive a cost-of-living increase. Your withdrawal grows with inflation but the benefit stays flat in nominal dollars. Real benefits do get annual adjustments, so enabling Social Security makes the projection slightly conservative.
- Spending is assumed to be steady. Real retirement spending often starts high, dips through the middle years, then rises again with healthcare costs.
- No required minimum distributions. From age 73 the IRS forces withdrawals from most pre-tax accounts, which can exceed what you planned to spend and raises your taxable income. Model a higher effective tax rate to approximate the effect.
- One blended tax rate. There are no brackets, no state-by-state rules, no capital gains treatment and no calculation of how much of your Social Security is taxable.
- No fees. Advisory fees and fund expenses are not modelled. Subtract them from your return assumption: a 6% return with 1% of total fees should be entered as 5%.
Deterministic projection vs Monte Carlo simulation
Search for retirement calculators and you will meet the other major approach: Monte Carlo simulation. The two methods answer different questions, and it is worth knowing which one you are looking at before you trust a number.
What SavingSpan does (deterministic). One path, computed exactly: the same return every month, the same rules every month, an answer you can reproduce with a spreadsheet — the annual proof table under every result exists precisely so you can check it. Change one input and the change in the answer is caused by that input alone, which is what makes the tool useful for comparing decisions. The cost of that clarity is that the single path is not what real markets deliver: returns arrive in an order, and the order matters. The stress panel is our answer to that — fixed, stated shocks (a bad first two years, higher inflation, a benefit cut, living to 100) rather than randomness, so the stressed numbers stay checkable too.
What Monte Carlo does. Instead of one return path, it generates hundreds or thousands of them, drawing each year’s return at random from an assumed distribution, and reports the share of paths in which the money lasted — often phrased as a “probability of success.” That captures sequence risk in a way a single path cannot. Its weakness is the mirror image of ours: the output depends on assumptions you cannot see (the return distribution, its volatility, whether bad years cluster), the same inputs can produce a different percentage on every run, and a single percentage can look more precise than the guesses underneath it.
Neither method predicts your retirement. Ours is built for the question this site exists to answer — how long will the money last under assumptions I can inspect, and which of my choices changes that most? If you also run a Monte Carlo tool, treat its percentage as a second opinion about risk, not as a verdict on the plan.
For the full side-by-side treatment of the two methods — what a success rate actually counts, and how to use both without fooling yourself — see Monte Carlo, explained honestly. And if a balance from an old job has never made it into your projection at all, the step-by-step search is in finding a lost 401(k) or pension.
Where the numbers go
Nowhere. Every calculation runs in your browser using JavaScript that ships with the page. There is no server, no database, no account and no analytics on your inputs. Nothing you type is transmitted, which is also why there is nothing to sign up for.
This tool is for educational purposes only and is not financial advice. If a decision hangs on these numbers, take them to a licensed professional who can see your whole picture. Read more about who publishes this, or tell us if you think the maths is wrong. We would rather know.