Retirement Spending Simulator

Model retirement outcomes with deterministic projections and Monte Carlo analysis across 10,000 simulated lifetimes.

This tool projects portfolio balances from the current age through life expectancy, accounting for inflation-adjusted spending, Social Security, pensions, Required Minimum Distributions (RMDs), and taxes across three distinct account types. It answers the fundamental question: "Will my money last?"

Quick Start

1. Enter Assumptions

Fill in the left panel with age, portfolio balance, expected return, spending, and income details. Hover over ? icons for guidance on each field.

2. Run Simulation

Click Run Simulation (10,000 runs) to generate both a deterministic baseline and Monte Carlo probability bands.

3. Review Results

Check the four metric cards at the top, then explore the Projection, Cash Flow, and RMD Schedule tabs for detailed breakdowns.

4. Save & Compare

Use Save to export assumptions as a JSON file. Use Load to restore a previous scenario and compare outcomes.

Tip: All dollar amounts entered in the input panel are in today's dollars. The simulator automatically adjusts for inflation each year using the specified inflation rate.

How It Works

The simulator models two distinct life phases year by year:

Phase Years What Happens
Accumulation Current Age → Retirement Age Portfolio grows via investment returns and annual contributions. No withdrawals occur.
Decumulation Retirement Age → Life Expectancy Spending begins. Income streams (SS, pension) offset needs. Remaining shortfall is drawn from the portfolio using a tax-aware withdrawal waterfall.

Two projection methods run simultaneously:

Input: Personal

Input: Portfolio & Accounts

Simple vs. Detailed Mode

Toggle between two input modes at the top of the Portfolio section:

Account Type Tax Treatment Subject to RMDs?
Pre-Tax (Traditional 401k/IRA) Withdrawals taxed as ordinary income at the effective tax rate Yes
Roth (Roth 401k/IRA) Withdrawals are completely tax-free No
After-Tax (Brokerage) Only investment gains are taxed at the capital gains rate No

Other Portfolio Fields

Note: When switching from "By Account Type" back to "Simple," the detailed balances and contributions are automatically summed into the simple fields.

Input: Spending

Spending is automatically inflation-adjusted each year of the projection. A $5,000/month budget today becomes approximately $6,720/month in 10 years at 3% inflation.

Input: Retirement Income

Social Security

Pension

Choose between two payout types using the Monthly / Lump Sum toggle:

Input: Taxes

Important: The simulator uses a flat effective rate, not marginal tax brackets. This simplification works well for planning purposes but may slightly over- or under-estimate taxes for edge cases near bracket boundaries.

Results: Projection Chart

Purpose: Visualize portfolio balance from the current age through life expectancy, showing both the deterministic baseline and Monte Carlo probability bands.

Why is the Deterministic line higher than the Median? This is expected behavior caused by volatility drag. A portfolio averaging 7% with 12% volatility compounds closer to ~6.3% in practice. The deterministic line assumes zero volatility, so it always outperforms the median Monte Carlo path. See the Monte Carlo section below for the mathematical explanation.

Results: Cash Flow Chart

Purpose: Show exactly where money comes from and where it goes each year. Uses a "Perfect Mirror" design where total sources always equal total uses.

Reading the Chart

Left Y-Axis (Stacked Bars):

Right Y-Axis (Dashed Line): Portfolio balance trajectory for context.

Tip: During accumulation years, "Working Income" is the computed plug value representing the income needed to fund contributions and any spending. After retirement, if the portfolio cannot fully fund spending needs, this category becomes "Shortfall (Unfunded)."

What is "Portfolio Deposit / Reinvestment"?

When RMDs force a larger withdrawal than needed for spending, the after-tax surplus is reinvested into the after-tax brokerage account. This appears as a downward (use) bar to maintain the perfect balance between sources and uses.

Results: RMD Schedule

Purpose: Display a year-by-year table of Required Minimum Distributions from the pre-tax account, based on the IRS Uniform Lifetime Table III.

Column Description
Age The year of the distribution
Year-Start Balance Prior year-end pre-tax balance used for the RMD calculation
Distribution Period IRS divisor from the Uniform Lifetime Table for that age
RMD Amount Balance ÷ Distribution Period
Effective Rate RMD as a percentage of the starting balance

The first RMD year is highlighted in green for quick identification.

Results: Metric Cards

Four summary cards appear above the chart tabs. Each card is color-coded green (success), yellow (warning), or red (danger) based on the result.

Metric What It Measures Green / Yellow / Red
Success Rate Percentage of 10,000 Monte Carlo runs where the portfolio lasted through life expectancy ≥ 80% / ≥ 50% / < 50%
Years Funded Number of retirement years the median portfolio balance remains above zero, shown as "X / Y" where Y is total years needed ≥ 90% / ≥ 60% / < 60%
Shortfall Age The first age at which the 25th percentile (pessimistic) balance hits zero — the earliest stress point. "None" if the portfolio survives in all scenarios. None / — / Age shown
Median Ending Balance The 50th percentile portfolio balance at life expectancy > $0 / — / $0

Accumulation Phase

During working years (Current Age to Retirement Age), each account bucket grows independently via investment returns and receives its designated annual contribution.

Mathematical Details: Compound Growth

Each year, each account bucket is updated as:

$$B_t = B_{t-1} \times (1 + r) + C$$
  • $B_t$: Balance at end of year $t$.
  • $B_{t-1}$: Balance at end of the prior year.
  • $r$: Annual expected return (e.g., 0.07 for 7%).
  • $C$: Annual contribution to that specific bucket.

The after-tax brokerage account also tracks cost basis — the cumulative sum of contributions (not growth). This is used later to determine what portion of a withdrawal is taxable gain vs. return of principal.

Decumulation Phase

Each retirement year follows a specific sequence: calculate income streams, inflate spending, compute RMDs, grow all buckets, then execute the withdrawal waterfall to fund any remaining shortfall.

Income Streams

Mathematical Details: Social Security & Pension

Social Security begins at the specified start age and is inflation-adjusted annually from the simulation start:

$$SS_y = SS_{\text{monthly}} \times 12 \times (1 + i)^y$$
  • $SS_y$: Annual Social Security income in year $y$.
  • $SS_{\text{monthly}}$: Monthly benefit entered in today's dollars.
  • $i$: Annual inflation rate.
  • $y$: Years since simulation start (not since retirement).

Monthly Pension (with optional COLA) inflates from the pension start date:

$$P_y = P_{\text{monthly}} \times 12 \times (1 + i)^{(\text{age} - \text{pensionStartAge})}$$
  • $P_y$: Annual pension income at the given age.
  • $P_{\text{monthly}}$: Monthly pension entered in today's dollars.
  • If COLA is disabled, the multiplier is 1 (no inflation adjustment).

Inflation-Adjusted Spending:

$$\text{Spending}_y = \text{AnnualSpending} \times (1 + i)^y$$

Example: A $60,000/year budget today becomes approximately $80,635 in 10 years at 3% inflation.

Withdrawal Waterfall

After income streams (Social Security, pension) offset spending, any remaining need is funded from the portfolio in a strict tax-optimized priority order:

1
Pre-Tax (RMD Obligation) — The mandatory RMD amount is withdrawn first. If the after-tax proceeds exceed the spending need, the surplus is reinvested into the after-tax brokerage account.
2
Pre-Tax (Additional) — If spending needs remain after the RMD, additional pre-tax withdrawals are made. Withdrawals are "grossed up" to cover the tax owed on the withdrawal itself.
3
After-Tax Brokerage — Only the gain portion is taxed at the capital gains rate. Cost basis is reduced proportionally with each withdrawal.
4
Roth — Tax-free withdrawals. Preserved as long as possible to maximize tax-free compounding.
5
Fund SS & Pension Taxes — After the main waterfall, taxes on Social Security (IRS provisional income formula) and pension income are calculated and funded via the same waterfall priority.
Mathematical Details: Gross-Up & Gain Ratio

Pre-Tax Gross-Up: To net a specific dollar amount from a pre-tax account, the gross withdrawal must account for taxes:

$$\text{GrossNeeded} = \frac{\text{NetNeed}}{1 - \text{TaxRate}}$$
  • NetNeed: The after-tax dollars required to cover remaining spending.
  • TaxRate: The effective tax rate on ordinary income.

Example: To net $10,000 at a 15% tax rate, the gross withdrawal is $10,000 / 0.85 = $11,765.

After-Tax Brokerage Gain Ratio: Only the gain portion of a brokerage withdrawal is taxable:

$$\text{GainRatio} = \frac{\text{Balance} - \text{CostBasis}}{\text{Balance}}$$
$$\text{EffectiveTaxRate} = \text{GainRatio} \times \text{CapGainsRate}$$
  • GainRatio: Proportion of the account that represents unrealized gains (0 to 1).
  • CostBasis: Cumulative contributions (original invested dollars, not growth).
  • CapGainsRate: Long-term capital gains tax rate.

Example: A $200,000 brokerage account with $120,000 cost basis has a gain ratio of 0.40. At a 15% cap gains rate, the effective tax rate on withdrawals is 6%.

Required Minimum Distributions (RMDs)

The IRS requires annual minimum withdrawals from pre-tax retirement accounts starting at a specified age (73 for those born 1951–1959; 75 for those born 1960+). The simulator uses the Uniform Lifetime Table (Table III), effective 2022+.

Mathematical Details: RMD Calculation
$$\text{RMD} = \frac{\text{Prior Year-End Balance}_{\text{PreTax}}}{\text{Distribution Period}(\text{age})}$$
  • Prior Year-End Balance: The pre-tax account balance at December 31 of the prior year.
  • Distribution Period: A divisor from the IRS table that decreases with age, forcing larger withdrawals over time.

Sample Distribution Periods:

AgePeriodEffective Rate
7326.53.8%
7524.64.1%
8020.25.0%
8516.06.3%
9012.28.2%
958.911.2%

RMD Surplus Handling: If the after-tax value of the RMD exceeds the net spending need, the surplus is reinvested into the after-tax brokerage account (with cost basis updated). This prevents forced over-withdrawal from distorting the projection.

Social Security Taxation

Up to 85% of Social Security benefits may be subject to federal income tax, depending on "provisional income." The IRS thresholds have not changed since 1983/1993 and are not inflation-indexed.

Mathematical Details: IRS Provisional Income Formula

Step 1 — Calculate Provisional Income:

$$\text{Provisional Income} = \text{Other Taxable Income} + 0.5 \times \text{SS Benefits}$$
  • Other Taxable Income: Pre-tax withdrawals + pension income (Roth withdrawals and return of after-tax basis are excluded).
  • SS Benefits: Total annual Social Security benefits.

Step 2 — Apply Thresholds:

Filing Status Lower Threshold (50% tier) Upper Threshold (85% tier)
Single$25,000$34,000
Married Filing Jointly$32,000$44,000

Step 3 — Determine Taxable Amount:

  • Below lower threshold: $0 of SS is taxable.
  • Between thresholds: Taxable = lesser of 50% of SS benefits or 50% of excess over the lower threshold.
  • Above upper threshold: Base amount from the 50% tier, plus 85% of excess over the upper threshold.

The IRS caps the taxable amount at 85% of total benefits regardless of income level.

Key Implication: Because these thresholds are not inflation-indexed, more retirees fall into the 85% tier over time. A retiree with modest income today may find 85% of SS benefits taxable in 15–20 years due to inflation alone.

Monte Carlo Simulation

The Monte Carlo engine runs 10,000 independent simulations, each with randomized annual returns. This produces a probability distribution of outcomes rather than a single prediction.

How to Interpret the Results

Mathematical Details: Log-Normal Returns & Volatility Drag

Random Return Generation (Box-Muller Transform):

Two uniform random numbers $U_1, U_2 \in (0, 1)$ are transformed into a standard normal variable:

$$Z = \sqrt{-2 \ln(U_1)} \times \cos(2\pi U_2)$$

This is then converted to a log-normal return to ensure returns cannot fall below -100%:

$$\mu_{\log} = \ln(1 + r) - \frac{\sigma^2}{2}$$
$$R_{\text{year}} = e^{\mu_{\log} + \sigma \times Z} - 1$$
  • $r$: Expected annual nominal return (e.g., 0.07).
  • $\sigma$: Annual standard deviation / volatility (e.g., 0.12).
  • $\mu_{\log}$: Log-space mean, adjusted downward by $\frac{\sigma^2}{2}$ to correct for volatility drag.
  • $R_{\text{year}}$: The randomized annual return for one simulation year.

Volatility Drag Explained

The $-\frac{\sigma^2}{2}$ term is the mathematical expression of volatility drag — the phenomenon where variance reduces geometric (compounded) returns below arithmetic (average) returns.

$$r_{\text{geometric}} \approx r_{\text{arithmetic}} - \frac{\sigma^2}{2}$$

Example: A portfolio with 7% arithmetic return and 12% volatility:

$$r_{\text{geometric}} \approx 0.07 - \frac{0.12^2}{2} = 0.07 - 0.0072 = 0.0628 \approx 6.3\%$$

This is why the deterministic line (which uses the full 7%) always appears higher than the Monte Carlo median (which compounds at approximately 6.3%).

Percentile Calculation

After all 10,000 iterations complete, balances at each age are sorted and percentiles are extracted via linear interpolation:

$$P_k = \text{sorted}[\lfloor \text{idx} \rfloor] + \text{frac} \times (\text{sorted}[\lceil \text{idx} \rceil] - \text{sorted}[\lfloor \text{idx} \rfloor])$$
  • $\text{idx}$: $(n - 1) \times k$, where $n$ is the number of simulations and $k$ is the desired percentile (e.g., 0.25).
  • $\lfloor \cdot \rfloor$, $\lceil \cdot \rceil$: Floor and ceiling functions.
  • frac: The fractional part of idx, used for interpolation between adjacent sorted values.

Saving & Loading Scenarios

Scenarios are saved as JSON files to the local file system — no server or account required.

Tip: Use descriptive names like "Conservative_65_retire" or "Aggressive_60_retire" to easily compare different planning scenarios side by side.

Glossary

Accumulation Phase
The period from the current age to retirement age during which contributions are made and the portfolio grows without withdrawals.
After-Tax Brokerage Account
A taxable investment account where contributions are made with after-tax dollars. Only investment gains are taxed upon withdrawal, at the capital gains rate.
Box-Muller Transform
A mathematical method for generating normally distributed random numbers from uniformly distributed random numbers. Used to produce randomized annual returns in the Monte Carlo simulation.
COLA (Cost of Living Adjustment)
An annual increase to a payment (e.g., pension) to keep pace with inflation.
Cost Basis
The original amount invested in an after-tax account. When withdrawing, only the amount exceeding the cost basis (the gain) is subject to capital gains tax.
Decumulation Phase
The period from retirement age through life expectancy during which the portfolio is drawn down to fund spending.
Deterministic Projection
A single-path forecast using the exact expected return every year with no randomness. Serves as a baseline for comparison.
Distribution Period
The IRS-defined divisor used to calculate RMDs. Decreases with age, resulting in progressively larger required withdrawals.
Effective Tax Rate
A blended, flat rate representing the overall tax burden on ordinary income. Simpler than modeling marginal brackets but sufficient for planning purposes.
Inflation Rate
The annual rate at which purchasing power decreases. Applied to spending, Social Security, and COLA-adjusted pensions.
Log-Normal Distribution
A probability distribution where the logarithm of the variable is normally distributed. Used for modeling investment returns because it prevents returns from falling below -100%.
Monte Carlo Simulation
A technique that runs thousands of randomized scenarios to produce a probability distribution of outcomes, rather than a single deterministic prediction.
Percentile
The value below which a given percentage of observations fall. The 25th percentile means 25% of simulated outcomes were lower.
Pre-Tax Account
A tax-deferred retirement account (Traditional 401k/IRA) where contributions reduce taxable income but withdrawals are taxed as ordinary income. Subject to RMDs.
Provisional Income
An IRS calculation used to determine how much Social Security is taxable: other taxable income plus 50% of SS benefits.
RMD (Required Minimum Distribution)
The minimum annual withdrawal the IRS requires from pre-tax retirement accounts starting at age 73 or 75, depending on birth year.
Roth Account
A retirement account (Roth 401k/IRA) funded with after-tax dollars. Qualified withdrawals are completely tax-free and not subject to RMDs in this model.
Success Rate
The percentage of Monte Carlo simulations where the portfolio balance remained above $0 at life expectancy.
Volatility (Standard Deviation)
A measure of how much annual returns vary from the average. Higher volatility means wider swings in portfolio value and greater uncertainty in outcomes.
Volatility Drag
The mathematical reduction in compounded (geometric) returns caused by return variance. A portfolio averaging 7% with 12% volatility compounds closer to ~6.3%.
Withdrawal Waterfall
The priority order in which accounts are tapped during retirement: Pre-Tax (RMD first) → After-Tax Brokerage → Roth. Designed to minimize lifetime tax burden.