Monte Carlo Simulator
The Monte Carlo simulator takes a starting amount, yearly contributions and a number of years, then simulates thousands of random market paths using real S&P 500 returns (with dividends) or your own CAGR and volatility. You see the range of possible outcomes: the median, optimistic and pessimistic results, the chance of losing money, the chance of reaching a target, and the spread of annualized returns. Below, you can also learn how the Monte Carlo method works, try a small π experiment and build a simulation in Excel.
How to use the Monte Carlo simulator
- Enter the Starting amount, the amount Added each year (optional, added at the end of each year) and the number of Years. Add a Target if you want the chance of reaching it.
- Choose the Returns: S&P500 history (since 1993, SPY with dividends) or Custom, where you enter a CAGR and volatility.
- Press Calculate. You get the median final amount with its 10% to 90% range, the chance of losing money and of reaching your target, a chart of the range by year, the distribution of final amounts, and amounts and annualized returns by percentile.
- Each run uses a new random seed, so numbers change slightly. Press Run again for another run.
Example: 100,000 in the S&P 500 for 10 years, 10,000 runs: the median final amount is about 286,000, 10% to 90% of runs end between 141,000 and 513,000, the chance of a loss is about 3%, and the chance of reaching 200,000 is about 76%. With a custom CAGR of 5.5% and 18% volatility instead, the median drops to about 170,000 and the chance of a loss rises to about 16%.
What is the Monte Carlo method?
The Monte Carlo method estimates a result by running a large number of random trials. It was developed in the 1940s by Stanislaw Ulam, John von Neumann and others working on nuclear research, and named after the Monte Carlo casino in Monaco. It relies on the law of large numbers: one trial is luck, but after thousands of trials the distribution of results becomes stable.
The classic example is estimating π. Drop random points in a 1 × 1 square: the chance that a point falls inside the quarter circle is π ÷ 4, so (points inside ÷ all points) × 4 gets close to π. Try it below; more points usually give an answer closer to 3.1416.
The same idea works for many problems without a simple formula: engineering reliability, project schedules and costs, option pricing, portfolio risk, and investment returns and whether retirement savings will last.
How the investment simulation works
- Historical resampling: pick a random starting month in S&P 500 (SPY) monthly returns with dividends and chain 12 consecutive months into one year, drawing again for every year. This keeps the real booms and crashes (such as 2008 and 2020) without assuming returns are normally distributed.
- Custom: enter a CAGR (annualized return) and a volatility (annual standard deviation), for example 5.5% and 18%. Yearly returns follow a log-normal distribution, and the median growth rate of the simulation equals your CAGR. Enter the CAGR from a fund report, not the mean return: the more volatile an asset, the further its average return is above its CAGR. With 18% volatility, a 5.5% CAGR is about a 7% average yearly return.
- Each run grows the money year by year as (amount at the start of the year) × (1 + that year's return) + that year's contribution, and the simulator repeats this thousands of times to build the distribution of final amounts.
Why is the median lower than earning the average return every year? Volatility drags down compound growth: up 20% then down 20% is a 4% loss, not break-even. With the same average return, more volatility means worse results in most runs. Below the results, the simulator shows what you would have if you earned the average return every year.
Monte Carlo simulation in Excel
You can build a simple Monte Carlo simulation in Excel without code. For example, 100,000 invested for 10 years with a 7% average return and 18% volatility:
- Put the average return
7%in B1, the volatility18%in B2 and the starting amount100000in B3. - Row 6 is one run: in B6 enter
=$B$3*(1+NORM.INV(RAND(),$B$1,$B$2))(end of year 1), in C6 enter=B6*(1+NORM.INV(RAND(),$B$1,$B$2)), and fill right to K6 for 10 years. - Copy row 6 down to row 1005 for 1,000 runs.
- Summarize year 10 (column K): median
=MEDIAN(K6:K1005), pessimistic case=PERCENTILE.INC(K6:K1005,0.1), optimistic case=PERCENTILE.INC(K6:K1005,0.9), chance of a loss=COUNTIF(K6:K1005,"<"&B3)/1000. - Press F9 to draw new random numbers and run the simulation again.
This uses a normal distribution, the simplest approach. The simulator on this page uses a log-normal distribution or resamples real historical returns, which is closer to real markets.
Will my retirement savings last?
To check whether a saving and withdrawal plan lasts for life, use the FIRE Calculator. After calculating, open the Success rate (Monte Carlo) tab: it simulates thousands of market paths with the same inputs and shows the chance your money lasts. The page also has a 4% rule success rate table.
Limits of the simulation
- The past is not the future: the S&P 500 data starts in 1993, about 30 years that include a very strong period for US stocks, so results may be optimistic. Compare with a conservative custom return.
- Each year's return is drawn independently, so multi-year booms and busts are not modeled.
- Amounts are before inflation, taxes and fund fees.
FAQ
What is a Monte Carlo simulation?
A way to estimate results with many random trials. For investing, each run generates a random sequence of future yearly returns and calculates the final amount. After thousands of runs you see the distribution of outcomes, such as the median, the worst 10% and the chance of a loss.
Can a Monte Carlo simulation predict stock prices?
No. It generates many possible outcomes from an assumed return distribution to show risk and the range of results. It does not tell you which one will happen, and the results depend on the return assumptions you choose.
Why is the simulated median lower than the average return suggests?
Volatility erodes compound growth: up 20% then down 20% loses 4%. With the same average return, more volatility pushes the middle outcomes down, so the median is usually below what earning the average every year would give, while a few very good runs end much higher.
Why do I get a slightly different result each time?
Each calculation uses a new random seed, so the simulated market paths differ. More runs give more stable results; you can switch to 10,000 runs. The seed used is shown below the results.
How many simulations are enough?
For a rough range, 1,000 to 5,000 runs are enough. To compare small differences in probability, such as a 1% change in the chance of a loss, use 10,000. The more runs, the less the results vary.
Can I rely on S&P 500 historical returns?
Use them as a reference, but discount them. The simulator uses SPY (an S&P 500 ETF) returns with dividends since 1993, about 10.7% a year, which is above the longer-run average, so results lean optimistic. Compare with a conservative custom return such as a 5.5% CAGR and 18% volatility.
Can I do a Monte Carlo simulation in Excel?
Yes. Use RAND() with NORM.INV() to generate random yearly returns, one row per run, copy it down a thousand rows, then summarize with MEDIAN, PERCENTILE.INC and COUNTIF. See the Excel steps above.