How This Retirement Simulation Works
Quick answer: The calculator runs thousands of imagined retirements, one calendar year at a time. In each year it draws a set of random returns for stocks, bonds and gold that follow the averages, swings and tendencies to move together measured in a published historical dataset. It adds savings or takes out spending at the start of the year, applies that year's return, and carries on until the plan's final age. A run counts as a failure if the balance is at or below zero after a withdrawal. The default uses 5,000 runs and a fixed seed, so the same inputs always return the same answer. This page lays out each step, the numbers behind them and the places where the method is only an approximation.
Education, not financial advice. This page explains a method and shows what a model produced from stated assumptions. It does not tell you what to buy, sell, save or spend. For your own situation, ask a qualified professional.
The model in plain terms
If you have not met the idea before, what a Monte Carlo simulation is is covered in its own article. In short, the computer plays out the same retirement many times, giving each playthrough a different, random-looking series of market returns. Counting how many playthroughs finish with money left yields the figure you see in the Monte Carlo simulation retirement calculator, and the spread of balances along the way produces the shaded bands on the chart.
Everything runs in your browser. The inputs never leave the page. What follows describes exactly what that code does, so that you can judge the output for yourself and check our description against the results you see.
What happens in each simulated year
The order in which cash moves matters, so here is the order. Each run starts with the balance you enter, at the age you enter. Then, year by year:
- Before retirement, your yearly saving is added to the balance at the start of the year.
- From the retirement age, the year's spending is withdrawn at the start of the year. If your fixed income, such as Social Security, has begun by then, only the difference between spending and that income is taken from the portfolio.
- Failure check. If the balance is at or below zero after a withdrawal, the run is marked as failed in that year, its balance is held at zero, and the rest of its years are zero.
- Return. Otherwise the portfolio earns that year's return, and the new balance carries into the next year.
So money is added or removed first and then grows. A withdrawal never benefits from the same year's return. The model keeps one detail aside: every run uses the same number of random draws no matter how you split the portfolio, so two splits run with the same seed see identical markets. That is what lets the with-gold card compare a plan with and without gold on equal terms.
Spending is held flat in today's dollars. There are no taxes, no changing costs and no extra shocks. The page on what a Monte Carlo simulation cannot see takes up those omissions one at a time.
As an example of a check that anyone can do by hand: with zero returns and zero volatility, $1,000,000 and $40,000 a year runs out at the 25th withdrawal, at age 89 if you start at 65, and $30,000 a year over 30 years leaves exactly $100,000. The engine reproduces both, as described under the checks below.
How yearly returns are produced
Returns are real, meaning after inflation. The dataset gives nominal returns, so each is converted with the formula one plus the nominal return, divided by one plus the change in the consumer price index, minus one. Inflation is the FRED series CPIAUCNS, the percent change from a year ago, annual and not seasonally adjusted. As a result every dollar on the page is a today's-dollar figure and no separate inflation rate is needed.
For each asset the model needs three kinds of numbers: an average return, a volatility (how much the yearly return swings) and a correlation with each other asset (how much they tend to move together). It takes the arithmetic mean of the yearly real returns, their sample standard deviation and the Pearson correlations between the assets.
In each year the model draws three random numbers and combines them so that the resulting stock, bond and gold returns have the stated correlations; the standard device for that is a Cholesky factorization of the correlation matrix. Each return is then generated as a lognormal draw, a pattern in which the logarithm of one plus the return follows a bell curve. Its two parameters are chosen so that the draws reproduce the average and volatility you see below, and a lognormal return can never fall below a total loss of the amount invested. The portfolio return for the year is the weighted average of the three asset returns at the split you chose, which is the same as rebalancing back to that split at the start of every year.
The random numbers come from a small seeded generator (mulberry32) and the Box-Muller method that turns its output into bell-shaped values. Seeding means a given input and seed always return the same output. The default seed is 12345.
The data behind the assumptions
The numbers come from one file: Aswath Damodaran's Historical Returns on Stocks, Bonds and Bills workbook from NYU Stern, which carries annual returns for 1928 through 2025. We downloaded it and read it on 2026-11-04. The table below lists the columns we use and the choices we made.
| Id | What it says | Where | Status |
|---|---|---|---|
| dd-01 | The file is Aswath Damodaran's (NYU Stern) "Historical Returns on Stocks, Bonds and Bills" workbook and carries annual returns for 1928 through 2025. | https://pages.stern.nyu.edu/~adamodar/pc/datasets/histretSP.xls | STATED |
| dd-02 | The stock column is "S&P 500 (includes dividends)". | same | STATED |
| dd-03 | The bond column is "US T. Bond (10-year)". | same | STATED |
| dd-04 | A gold column is included, with a footnote that before 1971 gold prices were fixed under the gold standard and were mostly stable. | same | STATED |
| dd-05 | The gold sheet lists a yearly price per ounce, citing an average price for the year for pre-1970 data and LBMA gold prices for 1970 onward. | same, sheet 'Gold Prices' | STATED |
| dd-06 | Inflation is the FRED series CPIAUCNS, percent change from a year ago, annual, not seasonally adjusted. | same, sheet 'Inflation Rate' | STATED |
| dd-08 | The site converts each nominal return to a real return with (1 + nominal) / (1 + CPI change) - 1, and uses the arithmetic mean and sample standard deviation of the annual real returns, plus Pearson correlations. | data/assumptions.json | STATED (the site's own computation) |
| dd-09 | The default assumption set is 1971 to 2025 (55 years) for all three assets; the alternative is 1928 to 2025 (98 years). | data/assumptions.json | STATED (the site's own choice) |
Stocks are the S&P 500 including dividends, bonds are the 10-year US Treasury bond, and gold is the file's gold column. Two of the file's own notes shape how that column should be read. The file's footnote says that until 1971 the gold standard fixed the price, which therefore stayed mostly steady. And the gold sheet lists a yearly price, an average for the year before 1970 and London Bullion Market Association prices from 1970 onward. A yearly price smooths out the swings that happened inside each year.
The file also contains its own summary of geometric average returns, which we do not use; every figure on this site is computed from the yearly values. One more caveat: the file's own "Date updated" cell reads 2021-12-31 even though it carries data through 2025.
Two assumption sets and why one is the default
The calculator offers two sets of assumptions. The default set uses 1971 to 2025, 55 years, for all three assets. The alternative uses 1928 to 2025, 98 years. We made 1971 the default for one reason: from that year on, stocks, bonds and gold all moved with the market, whereas the longer set runs through earlier decades in which gold sat at a fixed price.
For the default set, the average real return is 8.4% for stocks, 2.5% for bonds and 7.4% for gold. The volatilities are 17%, 10% and 24%. Compounded over time, the yearly growth rates are lower than the averages: 7.0%, 2.0% and 5.0%. The correlations are 0.16 between stocks and bonds, -0.20 between stocks and gold, and -0.12 between bonds and gold.
For the alternative set, the averages are 8.6% for stocks, 1.8% for bonds and 4.1% for gold, with volatilities of 19%, 9% and 19%, compounded growth of 6.8%, 1.5% and 2.5%, and correlations of 0.09 (stocks and bonds), -0.07 (stocks and gold) and -0.01 (bonds and gold).
The gap between the two sets is not trivial. For the default plan, which is age 45, retiring at 65, planning to 95; $300,000 saved, $10,000 saved a year, $65,000 a year of spending in today's dollars, $24,000 a year of Social Security from 67, 60% stocks and 40% bonds, the score is 87% on the default set and 83% on the alternative, both under 60/40 with no gold. The page on good Monte Carlo success rate explains why two reasonable tools can report different numbers for what looks like the same plan. The comparison between a random simulation and a plain replay of past years is covered in Monte Carlo vs historical simulation.
What the outputs mean
The success rate is the number of runs that did not fail, divided by the number of runs. With the default plan, the count was 4,367 of 5,000. The chart bands show the balance at the 10th, 25th, 50th, 75th and 90th percentile at each age: at each age we sort the balances of all runs and read off the values a tenth, a quarter, half, three quarters and nine tenths of the way up. The band is a summary of the whole cloud of runs, not a path any one run follows.
Two extra measures help to read a failure. The median failure age is the middle age at which failed runs ran out, among only the runs that failed. The early-failure share is the portion of failures that happened within the first ten years of retirement. For the default plan the median failure age was 86 and the early share was 2%. All of these are summaries of simulated paths under the stated assumptions, and none is a forecast.
Checks we run on the engine
A model like this is easy to get slightly wrong without noticing, so the engine comes with a test file. It checks several things:
- Zero-volatility cases. With no randomness and no growth, the balance must fall by exactly the withdrawal each year. The two examples above, the 25th-withdrawal failure and the $100,000 remainder, are tested to the dollar.
- Closed forms. With a steady four percent real return and no randomness, the final balance must match the formula for start-of-year withdrawals computed separately. A matching test covers the savings years.
- Sampling moments. When we draw many one-year returns, their average and spread must come out close to the inputs.
- Determinism and independence. The same seed must give the same answer, a different seed a different one, and a plan with zero gold must ignore the gold parameters entirely.
- Direction. More spending must never give a higher success rate.
- Agreement across languages. The browser engine, written in JavaScript, and a twin written in Python use the same generator step for step. A test runs both on the same inputs and compares the results.
Passing these tests means the code does what we describe. It does not mean the description is the right model of retirement, which is a separate question.
Known limits of the method
Several simplifications are deliberate, and they are worth knowing before you lean on a number.
- Annual steps. Everything happens once a year. Within-year swings, monthly spending and the timing of withdrawals inside a year are invisible.
- Real returns. Inflation is built into the historical returns, not modeled as its own changing process, so a long stretch of different inflation cannot occur.
- Independent years. Each year's draw does not depend on the year before, so there are no multi-year slumps or trends beyond chance.
- Lognormal draws. A smooth bell-curve shape in logarithms is a convenient approximation of real return behavior, not a description of it.
- Costless annual rebalancing. The portfolio is restored to your split every year with no trading costs or taxes.
- A gold column built from yearly prices. As noted above, it smooths out swings and, before 1971, reflects a fixed price.
- Small samples. 55 and 98 yearly observations are few for estimating averages and correlations, and the outputs respond strongly to small changes in them. The page on gold in a retirement portfolio shows the effect for the gold assumption by running the calculator with the dataset's gold return and with gold earning nothing after inflation.
- Random noise. For the default plan, eight different seeds at 5,000 runs ranged 87% to 89%. Differences smaller than that are not informative.
To see how these limits translate into questions to ask of any calculator, read how to pick a Monte Carlo retirement calculator.
What this can't tell you
This page can't tell you whether the model is the right one for your situation. It documents what the code does and where the numbers came from, and it names the shortcuts. It can't tell you what the markets will do, and the reasons are structural: the method draws from a past it has measured, and it holds your plan still. If a question you care about falls outside annual returns, such as taxes, care costs or how you would behave in a downturn, the engine is silent on it. You can rerun the retirement Monte Carlo calculator with different inputs at any time to see how sensitive the output is.
Frequently asked questions
Does the calculator send my numbers anywhere?
No. The simulation runs in your browser, and the figures you type stay on the page. This page describes the engine, and none of that code depends on a server for the results you see.
Why does the same input always give the same answer?
The random numbers are seeded, so the generator starts from the same point each time. A different seed would give a slightly different score, by a point or two at the default number of runs.
Why 5,000 runs by default?
It is a balance between speed and noise. In our checks, results at 1,000, 5,000 and 10,000 runs differed by only a point or two for the default plan, so more runs smooth the figure a little without changing its meaning.
Is the model based on a published formula?
It uses standard pieces: lognormal returns, correlated draws and a seeded generator. The assumptions come from a published dataset we read on 2026-11-04. How those pieces are combined, and the cash-flow order, are our own choices, described above.