Monte Carlo Portfolio Simulator

Run thousands of simulated portfolio paths to see the full range of outcomes. Know your odds before you invest.

Portfolio Setup

$
$/mo

Return Assumptions

%
%
%

Simulation Settings

years

Withdrawals & Goals (optional)

$
Frequently Asked Questions

Monte Carlo Simulation for Investing: The Complete Guide

Everything you need to know about Monte Carlo analysis, portfolio simulation, and probabilistic financial planning.

A Monte Carlo simulation is a mathematical technique that uses random sampling to model the probability of different outcomes in a process that involves uncertainty. In the context of investing, it runs thousands of hypothetical portfolio scenarios — each with randomly generated returns drawn from a statistical distribution — to show the full range of possible outcomes rather than a single deterministic projection.

Why this matters more than a simple compound interest calculation:

  • Traditional calculators assume a fixed return (e.g., 10% every year). Real markets never deliver a consistent annual return. Some years you gain 30%, other years you lose 20%. The sequence and magnitude of those returns dramatically affect your final outcome.
  • Monte Carlo captures volatility risk. Two portfolios with the same average return but different volatility levels will produce vastly different ranges of outcomes. A Monte Carlo simulation makes this risk visible through confidence bands and percentile analysis.
  • It answers probabilistic questions. Instead of asking “What will my portfolio be worth?” you can ask “What is the probability my portfolio reaches $1 million?” or “What are the odds I run out of money in retirement?”

The name comes from the Monte Carlo Casino in Monaco, because the technique essentially “rolls the dice” thousands of times with your financial assumptions. Each simulation generates a unique path of monthly returns, and when you aggregate all those paths together, you get a realistic picture of uncertainty that no single-point estimate can provide.

Professional financial planners and institutional investors use Monte Carlo analysis as a core planning tool. This calculator brings that same analytical power to individual investors, running entirely in your browser with no data sent to any server.

The Box-Muller transform is a mathematical method for generating random numbers that follow a normal (Gaussian) distribution from uniformly distributed random numbers. This is critical for financial simulations because stock market returns approximately follow a normal distribution over short periods.

How it works under the hood:

  • Step 1: Generate two independent random numbers (U1 and U2) uniformly distributed between 0 and 1 using JavaScript's Math.random().
  • Step 2: Apply the Box-Muller formula: Z = sqrt(-2 * ln(U1)) * cos(2 * pi * U2). This transforms the uniform random numbers into a standard normal distribution (mean 0, standard deviation 1).
  • Step 3: Scale the result by the monthly volatility and shift it by the expected monthly return: monthlyReturn = expectedMonthly + monthlyVol * Z.

Why this matters for accuracy: The annual expected return is divided by 12 to get the monthly expected return, and the annual volatility is divided by the square root of 12 to get the monthly volatility. This square-root scaling is a property of random walks and reflects how volatility scales with the square root of time — a fundamental concept in financial mathematics.

Limitations to be aware of: Real market returns exhibit “fat tails” (extreme events happen more frequently than a normal distribution predicts) and negative skewness (large drops are more common than equivalently large gains). A normal distribution is a reasonable approximation for planning purposes, but it may slightly underestimate tail risk. For most investors, this trade-off between simplicity and accuracy is well worth it.

The confidence bands (also called a fan chart) are the shaded regions on the simulation chart that show the range of portfolio values at each point in time. They give you a visual picture of how uncertain your portfolio's future value is and how that uncertainty grows over time.

Here's what each percentile band tells you:

  • 10th Percentile (Bear Case): 90% of simulations ended above this value. This represents a pessimistic but not worst-case scenario — think of it as “what happens if markets mostly disappoint.”
  • 25th Percentile (Below Average): 75% of simulations beat this. A moderately below-average outcome that's useful for conservative planning.
  • 50th Percentile (Median): The middle outcome. Half of simulations did better, half did worse. This is your “expected” scenario in a probabilistic sense and is generally more useful than the mean for skewed distributions.
  • 75th Percentile (Above Average): Only 25% of simulations exceeded this. Represents a favorable market environment over your time horizon.
  • 90th Percentile (Bull Case): Only 10% of simulations reached this level. An optimistic scenario — don't plan around this, but it shows the upside potential.

How to use these for planning: Conservative planners focus on the 10th-25th percentile range. If your financial plan works even at the 25th percentile, you're in good shape for most market conditions. The median gives you a realistic central expectation. The 75th-90th percentile shows you the upside that becomes possible if markets perform well.

Notice how the bands widen over time — this is the compounding effect of uncertainty. In year 1, outcomes are fairly clustered. By year 30, the range between the 10th and 90th percentile can be enormous. This widening fan is a visual reminder that long-term projections carry significant uncertainty, which is precisely why Monte Carlo analysis is more honest than a single-line projection.

Choosing realistic assumptions for expected return and volatility (standard deviation) is the most important step in getting meaningful simulation results. Here are evidence-based guidelines for common portfolio types:

Historical benchmarks by asset class:

  • 100% U.S. Stocks (S&P 500): ~10% annual return, ~15% volatility. This is the default in our calculator and represents a broadly diversified equity portfolio.
  • 80/20 Stocks/Bonds: ~9% return, ~12% volatility. Slightly reduced risk with a modest return trade-off.
  • 60/40 Stocks/Bonds: ~8% return, ~10% volatility. The traditional “balanced” portfolio used by many retirement funds.
  • 100% Bonds (Aggregate): ~5% return, ~6% volatility. Much lower return but significantly less variance.
  • Aggressive Growth (Small Cap / Tech Tilt): ~12% return, ~20-25% volatility. Higher expected return comes with substantially wider outcome bands.

Key principles for setting assumptions:

  • Use nominal returns (before inflation) if you want to see nominal dollar outcomes, or real returns (after subtracting ~3% inflation) if you want purchasing-power outcomes. Our calculator lets you set an inflation rate separately to adjust contributions and withdrawals.
  • Be conservative. Future returns may be lower than historical averages due to higher current valuations. Many financial planners use 7-8% for equities rather than the historical 10%.
  • Volatility matters as much as return. A portfolio with 10% return and 25% volatility will have much worse 10th-percentile outcomes than one with 8% return and 12% volatility. Don't chase return without accounting for the wider dispersion.

Pro tip: Run the simulation multiple times with different return/volatility assumptions to build a “scenario matrix” — optimistic, base-case, and pessimistic. This gives you the most comprehensive view of your financial future.

Sequence-of-returns risk (also called sequence risk) is the danger that the order in which investment returns occur can dramatically affect your portfolio's longevity — even if the average return over the full period is exactly the same. This risk is especially dangerous during retirement when you are withdrawing from the portfolio.

Why the order of returns matters:

  • Accumulation phase (saving): Sequence risk is less critical. Poor early returns mean you buy more shares cheaply, and strong later returns amplify the larger base. A bad start can actually help if your contributions continue.
  • Distribution phase (retirement): Sequence risk is devastating. If markets crash early in retirement while you're withdrawing, you sell shares at depressed prices. Your portfolio may never recover even if markets subsequently boom, because you've permanently reduced the capital base.

A concrete example: Imagine two retirees with $1,000,000 portfolios withdrawing $50,000/year. Both experience the same set of annual returns over 20 years, but in reverse order:

  • Retiree A gets poor returns first (e.g., -15%, -10%, +5%) then strong returns later. After 20 years: portfolio depleted.
  • Retiree B gets strong returns first then poor returns later. After 20 years: $800,000+ remaining.

Same average return. Same total withdrawals. Completely different outcomes. This is exactly what Monte Carlo simulation captures — by randomizing the sequence of returns across thousands of simulations, you can see the full distribution of outcomes including the scenarios where sequence risk leads to portfolio ruin.

Mitigation strategies: The “4% rule” (withdrawing 4% of the initial balance annually, adjusted for inflation) was designed with sequence risk in mind. Other approaches include maintaining a 2-3 year cash buffer, using a dynamic withdrawal rate that adjusts to market conditions, or building a bond ladder to cover near-term spending needs.

The number of simulations affects the statistical reliability of your results. More simulations produce smoother, more stable percentile estimates, but with diminishing marginal benefit. Here's a practical guide:

  • 100 simulations: Useful for quick, rough-cut analysis. Percentile estimates will be noisy — running the same simulation twice may give noticeably different 10th/90th percentile values. Adequate for getting a general sense of the range.
  • 500 simulations: A good balance between speed and accuracy. Percentile estimates stabilize significantly. The median and 25th/75th percentile values will be quite consistent across runs. Good for most planning purposes.
  • 1,000 simulations (recommended): The standard for personal financial planning tools. Provides stable estimates across all percentiles including the tails (10th and 90th). This is the default in our calculator because it balances precision with browser performance.

The math behind convergence: Statistical precision improves proportionally to the square root of the number of simulations. Going from 100 to 1,000 simulations (10x more) improves precision by roughly 3.2x. Going from 1,000 to 10,000 (another 10x) only improves precision by another 3.2x. This is why 1,000 is the sweet spot — you get most of the benefit without excessive computation time.

When to use more or fewer: If you're particularly interested in tail events (like the 5th or 1st percentile for worst-case planning), more simulations help because extreme percentiles require more data points to estimate accurately. For exploratory analysis where you're testing many different input combinations, 100 simulations per run is fine since you're looking at broad patterns rather than precise values.

Probability of ruin (also called the failure rate) is the percentage of simulated scenarios in which your portfolio balance drops to $0 before the end of your time horizon. It is the single most important metric for retirement planning because it directly answers the question: “What are the odds I run out of money?”

How to interpret different ruin probabilities:

  • 0-5%: Excellent. Your withdrawal rate is very sustainable given your expected returns and volatility. Most financial planners target this range.
  • 5-10%: Acceptable for many retirees, especially if you have flexibility to reduce spending in bad markets or have supplemental income (Social Security, pensions, part-time work).
  • 10-20%: Caution zone. You may need to reduce withdrawals, work longer, or adjust your investment strategy. One in five scenarios leads to financial distress.
  • 20%+: High risk. Strongly consider reducing your withdrawal amount, extending your working years, or finding ways to increase income in retirement.

Key factors that drive ruin probability:

  • Withdrawal rate: The most influential variable. The classic “4% rule” (withdraw 4% of initial portfolio annually, adjusted for inflation) historically has a roughly 5% failure rate over 30 years for a 60/40 portfolio.
  • Volatility: Higher portfolio volatility increases ruin risk even at the same expected return, because of sequence-of-returns risk.
  • Time horizon: Longer retirement periods increase the probability of encountering a devastating sequence of bad returns.
  • Inflation: If withdrawals are inflation-adjusted (as they are in this calculator), rising prices steadily increase the dollar amount withdrawn.

If this calculator shows no withdrawals are set, the probability of ruin will be 0% (or very close to it) since a portfolio with ongoing contributions and no withdrawals effectively cannot hit zero in a normal distribution model.

Inflation is a critical variable in long-term portfolio simulations because it erodes the purchasing power of both your portfolio balance and your future withdrawals. This calculator handles inflation in two important ways:

How inflation is applied in the simulation:

  • Contributions grow with inflation: Your monthly contribution amount increases each year by the inflation rate. This reflects the realistic assumption that as prices rise, you'll typically be earning more and contributing more in nominal dollars.
  • Dollar withdrawals grow with inflation: If you set a fixed-dollar annual withdrawal, it is adjusted upward each year by the inflation rate to maintain constant purchasing power. This mimics the way retirees need to spend more nominal dollars over time to maintain the same lifestyle.
  • Percentage withdrawals are unaffected: If you choose a percentage-based withdrawal, inflation does not apply because the withdrawal amount is always recalculated as a percentage of the current portfolio value.

Important note about return assumptions: The expected return you enter should be the nominal (before-inflation) return. The simulator does not subtract inflation from returns — instead, it applies inflation directly to cash flows. This approach is more accurate because it captures the interaction between volatile returns and growing cash flows, rather than simply reducing the return by a flat rate.

Historical context: U.S. inflation has averaged approximately 3% per year over the long term. The default 3% inflation rate in this calculator is a reasonable baseline for most planning scenarios. If you are concerned about persistently higher inflation, try running simulations at 4-5% to stress-test your plan.

Monte Carlo simulation is one of the most powerful tools available for probabilistic financial planning, but it has important limitations that every user should understand:

Statistical assumptions:

  • Normal distribution assumption: This calculator uses normally distributed random returns. Real markets exhibit “fat tails” — extreme events (crashes and euphoric rallies) happen more frequently than a bell curve predicts. Events like 2008 or March 2020 are more likely in reality than the model suggests.
  • Constant parameters: The expected return and volatility are held constant throughout the simulation. In reality, these parameters change over market cycles. Bull markets tend to have lower volatility; bear markets tend to have higher volatility and lower returns.
  • No serial correlation: Each month's return is drawn independently. Real markets exhibit momentum (returns tend to persist in the short term) and mean reversion (extreme valuations tend to normalize over the long term). These effects are not captured.

Real-world factors not modeled:

  • Taxes: Investment gains are subject to capital gains taxes, which reduce your effective return. Tax-advantaged accounts (401k, IRA) defer or eliminate these taxes, but the simulation doesn't differentiate.
  • Fees: Management fees, fund expense ratios, and advisory fees all reduce your net return. You should subtract estimated fees from your expected return input.
  • Behavioral factors: The simulation assumes you stick to your plan regardless of market conditions. In practice, many investors panic-sell during crashes or chase performance during bubbles, significantly worsening their actual outcomes.
  • Life events: Job loss, medical expenses, divorce, or inheritance can dramatically alter your financial trajectory in ways no simulation can predict.

The bottom line: Monte Carlo simulation is best used as a directional planning tool, not a crystal ball. It excels at showing you the range of possible outcomes, identifying whether your plan is robust or fragile, and helping you understand how changing assumptions (withdrawal rate, asset allocation, time horizon) shifts the probability distribution. Treat the results as a framework for thinking, not a guarantee.

The real value of Monte Carlo simulation lies not in the specific numbers it produces, but in the decisions it helps you make. Here's a practical framework for turning simulation results into actionable investment strategy:

Step 1: Establish your baseline. Run the simulation with your current portfolio value, contribution rate, expected return, and planned withdrawal. Note the median outcome and the 10th percentile (your “bad-luck” scenario).

Step 2: Test the levers. One at a time, adjust each input to see which has the biggest impact:

  • Increase contributions by $200/month. How much does this shift the median outcome and narrow the confidence bands?
  • Reduce volatility by switching to a more diversified portfolio. Move from 15% vol to 12% vol. The median may drop slightly, but the 10th percentile often improves significantly.
  • Extend the time horizon by working 2-3 more years. This simultaneously adds contributions, delays withdrawals, and gives compounding more time. It's often the single most powerful lever.
  • Reduce withdrawals by 10-20%. For retirement scenarios, this is the most direct way to reduce ruin probability. Even a small reduction in spending can dramatically improve your odds.

Step 3: Set your risk tolerance threshold. Decide what probability of ruin you can tolerate (most planners recommend under 10%) and what minimum 10th-percentile outcome you need to feel comfortable. Adjust your plan until both criteria are met.

Step 4: Build in guardrails. Rather than locking in a fixed withdrawal rate, plan to adjust spending based on portfolio performance. If markets drop significantly early in retirement, reducing withdrawals temporarily can dramatically improve long-term outcomes. Monte Carlo helps you identify the trigger points where adjustments become necessary.

Step 5: Revisit annually. As your portfolio grows, your actual returns are realized, and your time horizon shortens, re-run the simulation with updated inputs. Monte Carlo planning is a living process, not a one-time exercise.

Ready to build a professional valuation model?