The arithmetic, in full

Every calculation retirementDIY.org performs, written out so that somebody could check it or reproduce it from scratch. This describes what the engine actually does, including the places where it departs from what a textbook would say — those are marked.

Companion to the calculator and its “How this works” summary. Last revised 28 September 2026.

  1. Conventions and timing
  2. Where returns come from
  3. The bond instrument
  4. Tax
  5. Guaranteed income
  6. What gets spent
  7. Funding the year
  8. Level 5: RMDs, conversions, IRMAA, survivors
  9. Closing the year
  10. Turning paths into answers
  11. What is not modelled
  12. What has been checked

1. Conventions and timing

The model steps one year at a time. Write A for the reader's current age, R for the retirement age, H for the plan age. The number of steps is

nY = H − A + 1

and the loop runs over k = 1 … nY−1, with the age during step k being

a = A + k − 1

Index 0 holds the opening balances, before anything happens. Every recorded balance at index k is the balance after that year's contributions, income, spending, withdrawals and growth. Flows happen during the year; balances are quoted at the end of it. Charts that plot a flow against an age therefore read it one index later than the balance for the same age.

Each path carries a cumulative inflation index f, starting at f = 1 and multiplied at the close of every year. So the first simulated year uses f = 1: today's dollars and that year's dollars are the same thing. All internal arithmetic is in nominal dollars of the year concerned, and “today's dollars” anywhere in the interface means a nominal figure divided by that path's f. Which f matters: a balance quoted at the end of year k is divided by the index after that year's inflation, fk, but a flow — income, spending, withdrawals, tax — was priced during the year at the index in force when it began, fk−1, and is divided by that. The spending and tax charts, the lifetime tax total and the spreadsheet's tax columns all plot a year's flows at the age that year starts.

Three modes fill the return series, and nothing else about the engine changes between them:

ModePathsReturns for year k
mc2,000drawn at random (§2)
histnY windows row i+k−1 of the historical table, so path i begins in the i-th year on record
stress1a fixed prescribed sequence

In historical mode the number of paths is the number of complete windows, nP = 155 − (nY−1) + 1, which for a 30-year plan over 1871–2025 is 126.

2. Where returns come from

Random draws

Stock and bond returns are lognormal. The figure the reader picks is the compound rate g, so no half-variance is subtracted from it:

μS = ln(1 + gS) μB = ln(1 + gB) zS ~ N(0,1) zB = ρ·zS + √(1 − ρ²)·z′, z′ ~ N(0,1) rS = exp(μS + σS·zS) − 1 rB = exp(μB + σB·zB) − 1 then, each year, r ← (1 + r)·(1 + i) / 1.025 − 1 for stocks, bonds and cash

The presets are what money grows at when inflation is 2.5%, so each year's nominal returns move with that year's inflation i and the return after inflation does not depend on it. Until 28 September 2026 returns were fixed in dollars while spending, benefits and brackets rose with inflation, so the inflation setting was a hidden second return dial: 2% to 3.5% swung the default plan by 30 points, of which inflation itself accounted for about 3. The stress tests' ordinary years are adjusted the same way; the backtests use each real year's own returns and inflation. The reader chooses the average inflation from five figures: the Fed's 2% target and, from this page's own record, 2.5% (1996–2025), 2.9% (1926–2025), 3.7% (1946–2025) and 5.4% (1966–1995, the worst thirty years). The worst decade, 8.7% from 1973, is a sequence rather than an average and is covered by the stress tests.

Caveat. The conventional way to parameterise a lognormal is by its arithmetic mean, which requires μ = ln(1+m) − σ²/2. This engine deliberately does not, because the number is presented to the reader as “the average stock return” and a reader means the rate their money grows at. The consequence is that the arithmetic mean of the draws is higher than the label: with g = 7.5% and σ = 17%, simulated returns average 9.08% and compound at 7.52%. Both figures are correct; they answer different questions.

σ is the standard deviation of the log return. The standard deviation of the simple return is larger, at (1+g)·eσ²/2·√(eσ²−1), which for σ = 17% and g = 7.5% is 18.7 points. Quoted spreads in the interface are the log figure.

Inflation and cash are normal, not lognormal, and are floored:

i = max(−3%, μi + σi·z) rC = max(0, μC + σC·z)

The floors prevent the tail of a normal distribution producing hyperdeflation or negative nominal cash. They bias both series very slightly upward.

Parameters

SymbolMeaningValue
gSstock compound return5.5%, 7.5% or 9.2%
σSstock log volatility17%
gBbond compound return4.0%
σBbond log volatility6%
ρstock/bond correlation0.10
μC, σCcash3.0%, 1.0%
σiinflation spread1.2 points

The generator

Uniforms come from mulberry32, a 32-bit counter-based generator seeded with an integer the reader can see and change; normals come from the Box–Muller polar transform, which produces two at a time and caches the spare. The seed travels in the scenario code and the CSV, so any published result is reproducible exactly.

Historical data

One row per year, January to January: stock total return, bond return, CPI inflation. 1871–2022 is built from Robert Shiller's dataset, where

rS = (PJan next + Dyear) / PJan − 1 i = CPIJan next / CPIJan − 1

with P the monthly-average S&P composite price and D the year's dividends. Shiller's file stops in 2023, so 2023–2025 come from the S&P 500 total return index (daily closes averaged per month, matching his convention), the Federal Reserve's GS10 series and CPI-U. Rebuilt over the 23 overlapping years, the second method reproduces the first exactly for bonds and inflation and to 0.23 points mean absolute for stocks.

In historical mode cash is not a separate series; it is set to inflation plus half a point.

3. The bond instrument

“Bonds” means a 10-year par Treasury bought each January at the prevailing yield y0 and sold a year later, when the prevailing yield is y1 and nine years remain:

P = y0·(1 − (1+y1)−9) / y1 + (1+y1)−9 rB = P − 1 + y0

The first term prices the remaining coupon stream, the second the principal, and the coupon received during the year is added. This is used to build the historical series. In random mode bonds are simply drawn from the lognormal above — there is no yield state, so a random path cannot reproduce the mechanism by which a rise in rates hurts now and helps later.

4. Tax

All thresholds are 2026 federal figures. Within a path they are multiplied by that path's f — with two deliberate exceptions noted below. The law indexes them by chained CPI-U, which has run about a quarter of a point a year below CPI-U; the model uses the path's own inflation for simplicity, so brackets decades out are slightly too wide and tax there slightly understated (timing audit X2, 28 September 2026). Write o for ordinary income other than Social Security, c for long-term capital gains, s for Social Security benefits, N65 for the number of people aged 65 or over (0, 1 or 2).

4.1 How much Social Security is taxable

Provisional income is

p = o + c + s/2

and the taxable portion follows the two-tier rule:

st = 0 if p ≤ T1 st = min(0.50·s, 0.50·(p − T1)) if T1 < p ≤ T2 st = min(0.85·s, 0.85·(p − T2) + min(0.50·s, 0.50·(T2−T1))) if p > T2

with T1, T2 = $32,000 and $44,000 filing jointly, $25,000 and $34,000 single.

These thresholds are not indexed, in the model or in the law. They have stood since 1984 and 1993. Over a thirty-year path with inflation, an ever-larger share of the benefit becomes taxable purely because prices rose. This is the single most consequential piece of non-indexation in the model, and it is faithful.

4.2 Deduction and taxable income

AGI = o + c + st D = (Dstd + N65·D65)·f + N65·max(0, 6000 − 0.06·max(0, AGI − Dphase)) if year ≤ 2028 taxable = max(0, AGI − D)

Dphase is $150,000 jointly, $75,000 single. The $6,000 senior deduction is written into law only through 2028, and the model drops it from 2029 exactly as the statute does. It is not multiplied by f, because the statute does not index it either.

4.3 The tax itself

Ordinary income fills the brackets from the bottom; long-term gains are then stacked on top and charged at the capital-gains schedule, which is evaluated as the difference between the schedule at the top and bottom of the gains slice:

taxableord = max(0, taxable − c) taxablecg = taxable − taxableord T = min( B(taxableord, brackets, f) + B(taxableord + taxablecg, cgSchedule, f) − B(taxableord, cgSchedule, f), B(taxable, brackets, f) ) + st · taxable

The min is the last line of the IRS Qualified Dividends and Capital Gain Tax Worksheet: the result is never more than ordinary rates on everything would have cost. It matters only in a narrow band where the 20% gains rate sits above the ordinary bracket the gains land in, and is worth at most about $57 a year; it was added on 28 September 2026.

where B integrates a marginal schedule whose thresholds have been scaled by f:

B(x, brackets, f) = Σj ratej · (min(x, hij·f) − loj·f)⁺
Caveat: state tax. st is a single flat rate applied to federal taxable income, including whatever part of Social Security is federally taxable. Real states differ enormously: some exempt Social Security entirely, some exempt pension income, some have their own brackets and deductions, and nine have no income tax at all. A flat rate is a deliberate simplification and will be wrong in the specifics for almost everybody.

4.4 Withdrawing enough to cover your own tax

A withdrawal is taxable, so covering a shortfall gap requires taking more than gap, which is itself taxed. The engine solves the fixed point

G = gap + [ T(o + Gtrad, g·Gbrok, s) − Tbase ] + pen·Gtrad

by direct iteration — at most 12 passes, stopping when successive estimates agree within fifty cents. Each pass re-runs the withdrawal ordering, because which pot the extra dollar comes from changes what it costs. g is the gain fraction of the brokerage account,

g = max(0, 1 − basis / brokerage)

so a brokerage sale realises gains in proportion to how much of the account is gain, and the remainder is a tax-free return of basis. Tbase is the tax that would have been due on income alone, before any withdrawal.

The iteration is a contraction whenever the marginal rate is below 100%, so it converges quickly; twelve passes is a safety net, not a typical cost.

4.5 The early-withdrawal penalty

pen = 0 if retired and R ≥ 55 (Rule of 55) pen = 0.10 if a < 59 pen = 0.05 if a = 59 pen = 0 otherwise
Caveat, and it is generous. The 5% at age 59 is a crude stand-in for the statutory rule, which turns on the half-birthday rather than the year. More importantly, the Rule of 55 waiver is applied to all pre-tax money. In law it applies only to the plan of the employer you separated from, never to an IRA. A reader retiring between 55 and 59½ whose savings are mostly in an IRA will see a rosier answer here than reality would give.

5. Guaranteed income

Three streams arrive whether or not they are wanted: Social Security, other income cards, and required distributions. Social Security is two benefits for a married plan, each from its own claiming age on the reader's age timeline (the model treats both spouses as the same age), and one for a single filer. Plans and codes from before 28 September 2026 held one household figure claimed at one age; they load with that figure whole and the spouse's at zero, so their results do not change.

s = ( ssAmt·c(ssAge)·[a ≥ ssAge] + ssAmt2·c(ssAge2)·[a ≥ ssAge2] ) · f · (survivor share, if widowed) c(age) = 1 − (5/9% · min(m, 36) + 5/12% · max(0, m − 36)) when claiming m months before full retirement age c(age) = 1 + 2/3% · months after it, up to 70

Each amount is entered at full retirement age, 67 for anyone born in 1960 or later and 66 plus two months a year for 1955-59, and c is the law's reduction for claiming early or its credit for waiting, whole years assumed: 70% at 62 and 124% at 70 for the 1960 cohort. Until 28 September 2026 the amount was entered at the claiming age and the age moved only the start date, so claiming early read as better; plans and codes from before then are converted on load, keeping the same cheque. A spousal benefit claimed early is reduced slightly faster in law (25/36% a month for the first 36 months) than the own-benefit schedule used here.

other: for each card, amount·f if it rises with inflation, else the amount as written, included when startAge ≤ a ≤ endAge, split into taxable and tax-free

Their net contribution is the gross less the extra tax they cause:

guarNet = s + rmd + othertaxed + otherfree − (Tbase − Twage)

where Tbase is the tax on wage + rmd + taxable other + the brokerage's coupon interest, with its qualified dividends as long-term gains and with Social Security (§10), and Twage is the tax on the wage alone. The difference isolates the tax caused by the retirement income rather than by employment.

Before retirement the model assumes a salary equal to the spending figure the reader entered, purely so that a withdrawal for a life event is taxed at a plausible marginal rate rather than from zero. No such salary is spent, saved or shown; it exists only as a tax base.

6. What gets spent

The figure the reader enters is after-tax spending, and it is used as such. The planned amount in year k is

planned = netSpend · f · (1 − d)max(0, a − 75) · (survivor share, if widowed)

with d the optional decline after 75. Under the two target-based rules that is the amount; under the three portfolio-based rules it is discarded and replaced:

RuleAmount spent
Steadyplanned
Guardrailsplanned · m, with m adjusted as below
Percent of portfolioW′ − extra(W′) + max(0, guarNet − x), W = P·rate
Divide by years leftW′ − extra(W′) + max(0, guarNet − x), W = P/(H−a)
VPWW′ − extra(W′) + max(0, guarNet − x), W = P·v(a)

A required minimum distribution counts toward the rule's withdrawal. P includes the year's RMD, W′ = max(0, W − RMD) is all that is drawn on top of it, and x is the part of the RMD beyond W, after its own tax, which is reinvested rather than spent (zero when the RMD is smaller). Until 29 September 2026 the RMD was added on top of the whole share, so from RMD age these rules spent roughly twice what they should.

For the three portfolio rules W is a withdrawal before tax, as the 4% rule and VPW define it, and extra(W) is the income tax and early-withdrawal penalty that drawing W in the usual order adds to the year's bill (section 7). The reader lives on what is left. Until 28 September 2026 the share was spent after tax with the tax drawn on top, which withdrew about 10% more than the rate shown.

P is the whole portfolio at the start of the year and v(a) is linearly interpolated from a table rising from 3.9% at 50 to 20.9% at 95. The percent rule is clamped to 2–8%. Note that under the portfolio rules the guaranteed income is added to the portfolio draw rather than subtracted from a target, so total spending rises with income rather than displacing withdrawals.

Guardrails

Each year the current withdrawal rate is compared with the rate in the first year of retirement:

wr = max(0, planned·m − guarNet) / P if wr > 1.2·wr0: m ← max(0.70, 0.9·m) if wr < 0.8·wr0: m ← min(1.50, 1.1·m)

with wr0 captured in the first retired year. The multiplier moves by 10% at a time and is bounded at 70% and 150% of plan. The test uses the previous multiplier and the new one is applied afterwards, so a cut takes effect in the year it is triggered.

7. Funding the year

The year's requirement is

need = spending + gift·f + lifeEventOutflow·f + irmaaSurcharge gap = need − guarNet

where the gift is the yearly amount given to people while alive, from the age chosen (Level 6; §10).

If the gap is negative, income exceeded the requirement. Any unspent required distribution goes to the brokerage account, counted entirely as basis since its tax has been paid; any remaining surplus goes to cash at Level 3 and above, or to the brokerage below it. Nothing is discarded.

If the gap is positive, it is funded by withdrawing G from the pots in one of three orders:

OrderSequence
Conventionalcash → brokerage → pre-tax → Roth
Pre-tax firstcash → pre-tax → brokerage → Roth
Proportionaleach pot supplies its own share of the total, with any shortfall in one pot made up from the others in conventional order

Each pot supplies whatever it has, up to what is still needed. If the pots together cannot supply G, and the shortfall exceeds one dollar, the path is marked as having run short: the age is recorded, all balances are set to zero, and that year's spending is recorded as zero.

Caveat. Failure is absolute and terminal. A path that falls a hundred dollars short in one year is treated identically to one that falls short by everything, and it never recovers even if Social Security would have arrived the following year. The headline percentage is therefore the share of paths that never once fell short, not a measure of how badly or how late they did.

8. Level 5

8.1 Required minimum distributions

Applied at every level, since they are law rather than strategy; Level 5 only adds a switch that turns them off, to show the difference they make. (Until 28 September 2026 they applied only from Level 5, which left a large pre-tax balance untouched below it in any year something else paid the bills.) At Levels 1 and 2 the whole of the single pot is treated as pre-tax. From the statutory age — 73, or 75 for anyone born in 1960 or later — the year's distribution is the pre-tax balance divided by the IRS Uniform Lifetime Table factor:

rmd = balancepre-tax / divisor(a)

It is removed from the pre-tax account before anything else happens, taxed as ordinary income, and treated as income that covers spending first. Whatever is not needed is reinvested in the brokerage account as basis. The divisor falls from 26.5 at 73 to 2.0 at 120, which is roughly 3.8% of the balance at 73, 5% at 80 and 8% at 90.

8.2 Roth conversions

After the year's spending is settled, the conversion c is the largest amount, up to the pre-tax balance, that keeps ordinary taxable income inside the chosen bracket:

max(0, taxable(o + withdrawn + c, gains, s) − gains) ≤ bracketTop(rate, f)

found by bisection, since the left side only ever rises with c. The bracket is an ordinary-income bracket, so only ordinary taxable income occupies it: gains and qualified dividends stack on top at their own rates. It is a search rather than a subtraction because a converted dollar is not always one dollar of taxable income: while the standard deduction is unused the first dollars are taxed at nothing, once Social Security is partly taxable each dollar can make up to 85 cents more of it taxable, and the senior deduction phases out. Subtracting, as the model did until 28 September 2026, undershot in the first case and spilled into the next bracket in the others. Where the conversion pushes gains out of the 0% band, the extra tax is part of the bill below.

Its tax is the increase in the year's bill, and it must be payable from outside the retirement accounts:

purse = max(0, cash + brokerage − keep · spending)

If the tax exceeds the purse, the conversion is scaled down by the ratio and retried, up to eight times. Nothing is converted unless the tax can be paid, which is the point: a conversion funded from the converted money itself is a much weaker move and the model will not pretend otherwise.

The tax is taken from cash first, then the brokerage. Selling in the brokerage realises gains, which are taxable in their own right, so the bill is circular — a larger sale owes more tax, which needs a larger sale. Writing g for the brokerage gain share and c for the conversion, the bill solves

owed = tax(o + c, gains + max(0, owed − cash) · g, s) − tax(o, gains, s)

by the same fixed-point iteration the withdrawal uses, to within fifty cents or eight passes. The realised gain stacks above ordinary income at long-term rates, so it does not consume the ordinary bracket room the conversion is filling, and it enters the MAGI series, which is why a conversion can raise a Medicare surcharge two years later by more than the conversion alone would suggest. The brokerage basis falls proportionally with the balance.

Caveat: this was wrong until recently. Until 27 September 2026 this sale was untaxed: the balance and basis fell but no capital-gains tax was charged, while the ordinary withdrawal path taxed the identical sale. Conversions therefore looked cheaper than they are. On a couple retiring at 62 with $3M and filling the 24% bracket, the correction added about $78,000 of lifetime tax and took roughly $319,000 off median wealth at 95. Any figure quoted from this tool before that date overstates the case for conversions by about that much.

8.3 Medicare surcharges

IRMAA is charged on income from two years earlier, so the model keeps a MAGI series and looks back:

surcharge(k) = tier(MAGI[max(1, k−2)], thresholds of that year's filing status) → annual amount · f · persons now

The two years before the plan starts have no income on record, so year 1's MAGI stands in for them. It is not known until year 1 ends, so year 1's own surcharge is charged a year late, in year 2, beside year 2's; until 28 September 2026 neither year was charged at all. The thresholds follow the filing status of the return being looked back at, so in the first two years after a death a joint return is judged against the joint thresholds, while only the survivor pays.

It is a step function, not a taper: one dollar over a threshold costs a full year of the higher premium, per person. The 2026 figures are used (CMS; SSA POMS HI 01101.020): the Part B adjustment over the $202.90 standard premium plus the Part D adjustment, $1,148 to $6,936 a person a year, from $109,000 single or $218,000 joint. The lower thresholds are indexed by f; the top one, $500,000 or $750,000, is fixed in law through 2027 and indexed after. MAGI here is AGI including the taxable part of Social Security; no tax-exempt interest is modelled, so nothing else is added back. Only the surcharge is modelled — the standard premium everybody pays belongs in the spending figure.

8.4 Survivor years

From the chosen age the Social Security benefit falls to the chosen share, other income falls to its chosen share, and spending falls to its chosen share. From the following year the filing status becomes single, so brackets narrow and the standard deduction roughly halves: the law allows a joint return for the year a spouse dies, and qualifying surviving spouse status needs a dependent child, which the model does not have. The Social Security taxation thresholds fall from the joint pair to the single pair, which are not half of them — part of why a survivor often pays more tax on less income.

9. Closing the year

After every flow, growth is applied and the inflation index advances:

r = w·rS + (1 − w)·rB pre-tax, Roth, brokerage ×= (1 + r) · (1 − fee) cash ×= (1 + rC) f ×= (1 + i)

with w the stock share and fee the reader's yearly fees as a share of savings (Level 2, default 0; Level 1 assumes none). It is one blended figure - fund costs, plan fees and any adviser - taken off the invested accounts after the year's growth; a flat fee belongs in spending instead. Added 28 September 2026: returns were gross of all costs before, with no way to enter them. At 1% it lowers the share of futures that last by roughly 10 to 20 points across the example plans. Rebalancing to the target mix is implicit and exact every year, at no cost and with no tax.

Caveat: withdrawals precede growth. The whole year's spending is taken before any return is applied, which is equivalent to withdrawing on 1 January. Real spending happens through the year. This is conservative — it removes money before it can earn — by roughly half a year's return on the amount withdrawn.
Basis grows only with money already taxed. The brokerage balance compounds and its cost basis does not, so the gain fraction rises over time exactly as it should. What does raise the basis is money that has already been taxed: contributions, money coming in from life events, surplus income put back, and the yearly dividends and interest, which are taxed as they are paid and treated as reinvested (§10). The basis is capped at the balance.
No savings survive a failure, but income does. A path that has run short receives no further contributions, so its balances stay at zero for the rest of the plan. The failure year itself keeps its contribution, which arrived before the shortfall. From then on, in retirement, Social Security and other income keep arriving: each year records them, the tax on them, and spending equal to what is left after that tax, so the charts show the floor a reader would really live on. The path still counts as having run short. Until 28 September 2026 spending and income were recorded as zero after a failure, which drew destitution where the default plan still has about two-thirds of its planned spending.

10. Turning paths into answers

Success

A path succeeds if it never ran short. The headline figure is the share of paths with no recorded failure age — out of 2,000 futures in random mode, or out of the number of historical windows in backtest mode.

Sampling error. With 2,000 paths the standard error near 50% is √(0.25/2000) ≈ 1.1 points. Measured: 25 different seeds (1 to 25) on the default plan at Level 1 spread from 55.1% to 59.8%, standard deviation 1.2 points. Differences smaller than about two points are noise.

Percentile bands

For each year independently, the values across all paths are sorted and the 5th, 10th, 25th, 50th, 75th, 90th and 95th percentiles taken, with linear interpolation between order statistics:

pct(p) = x⌊t⌋ + (x⌈t⌉ − x⌊t⌋)·(t − ⌊t⌋), t = (p/100)·(n−1)
Caveat, and it is the most misread thing in the whole tool. A percentile band is not a path. The 10th-percentile line is the 10th-worst outcome in each year taken separately, and different paths occupy that position in different years. No single future traces the band. Charts that do follow one future — the one-future chart, the stress tests — are labelled as such.

Ranking a path

To pick a typical, lucky or unlucky future, paths are ordered by ending balance in today's dollars, with failures pushed below all survivors and earlier failures below later ones:

score = endingBalance / f − [failed] · 10⁹ · (200 − failureAge)

Spending that lasts in 90% of futures

The largest whole $1,000 of spending that still succeeds in at least 90% of futures, up to $5,000,000. Success can only fall as spending rises, so the search keeps the highest figure known to pass and the lowest known to fail, and stops when they are $1,000 apart. It starts from the success rate already worked out at the planned spending, steps away from it until the 90% line is crossed, then aims each guess at the crossing by interpolating between the two nearest results, bisecting instead when an end sits at 0% or 100% or interpolation stalls on one side. It narrows in on the first 150 futures, which are exactly the first 150 of the full run because every future is drawn in turn from the same random sequence, then confirms on all 2,000, stepping $1,000 at a time from the rough answer until a figure that passes sits next to one that fails. The answer is the same as a plain bisection on all 2,000 would give, for the cost of about three full runs instead of fifteen. Everything else about the plan is held fixed. It is not reported for the portfolio-based spending rules, where the question is meaningless because the rule itself decides spending and no amount can ever fail.

Brokerage distributions

A taxable account owes tax every year on what it distributes, whether or not anything is sold. On the balance held at the start of each year, split by the same stock share as the rest of the portfolio:

qualified dividends = brokerage · w · 1.5%   coupon interest = brokerage · (1 − w) · 4%

The dividends are stacked as long-term gains and the interest as ordinary income, both inside the same yearly tax calculation as everything else, so they push Social Security across its thresholds, consume bracket room a conversion would otherwise have filled, and enter the MAGI series that sets a Medicare surcharge two years later. Neither is subtracted from the balance: both are already inside the year's total return and are assumed reinvested. What the plan loses is the tax, which it has to find like any other cost. Because the distribution has now been taxed, it raises the basis, capped at the balance, so the same money is never taxed again when the shares are sold.

1.5% is a forward figure for the dividend yield, not today's: the S&P 500 paid 1.05% in September 2026 against a 1.61% long-run average, and a broad total-market fund yields slightly more than the index. It is deliberately far below the 4% of the deep past, because buybacks have structurally replaced a good deal of dividend payout. The bond side needs no separate constant: a par bond's coupon is its yield, so the taxable income is the 4% bond assumption, and unlike the bond's total return it never goes negative in a year when rates rise. Neither figure is under the reader's control, for the same reason volatility is not.

The bond side dominates. At a 60/40 mix the taxable income is about 0.9% of the account from stocks and 1.6% from bonds, and the bond half is taxed as ordinary income rather than at long-term rates. That is the arithmetic behind holding bonds in a sheltered account, and it is large enough to change conclusions: adding this moved the preferred Roth conversion setting on a $3M plan from filling the 12% bracket to filling the 24%, because money sitting in a brokerage now leaks tax every year while money in a Roth does not.

Ending wealth after tax

Every balance the page draws is a face value, and pre-tax money has never been taxed, so an ending total mixes dollars that are not worth the same. The after-tax figure prices the pre-tax balance at the rate one more dollar of ordinary income would cost that household in its final year, federal and state together, obtained numerically from the same tax function:

m = [ tax(o+δ, g, s) − tax(o, g, s) ] / δ,  δ = 1000·f
mg = [ tax(o, g+δ, s) − tax(o, g, s) ] / δ
net = trad·(1 − m) + roth + cash + brokerage − max(0, brokerage − basis)·mg

where o is that year's ordinary income including any conversion, g its gains and qualified dividends, m the marginal ordinary rate and mg the marginal long-term rate, both clamped to [0, 1]. The brokerage is charged the long-term tax on its unrealised gain because the household would owe it to sell; that rate is genuinely zero for a low-income household, since the 0% band is real. One figure is kept per path and the median is reported beside the face-value balance, in whichever dollars the page is showing. A path that ran short contributes zero to both.

Caveat: this is a rate, not a liquidation. A marginal rate prices the balance as though it were drawn gradually. Emptying the account in a single year would push through higher brackets and cost more; spreading it across a longer retirement would cost less. It is also your rate: money left to someone is taxed at the heir's rate, which cannot be known in advance, so read this as what the balance is worth to the household rather than what a beneficiary would receive. The figure exists because the face value silently flatters any choice that leaves more money still untaxed, which is exactly the choice the conversion and withdrawal-order comparisons are asked to rank — and on this measure the option paying the least lifetime tax is frequently not the one that leaves the most.

Giving while alive

A gift is a cost the plan has to find, so it is added to the year's requirement alongside spending and any life event, and funded by the same withdrawals in the same order, carrying whatever income tax and early-withdrawal penalty those withdrawals actually trigger. It is deliberately not treated as consumption: it is excluded from the spending series, so that series still answers what the reader lives on, and it is outside the spending rule, because a guardrail cutting a promised gift is not what a guardrail is for.

need = spending + gift + life events + Medicare surcharge

Gift tax is not modelled. The 2026 annual exclusion is $19,000 per recipient and the lifetime exemption $15M a person, so few plans approach either.

What this cannot see. Giving away shares that have grown is not the same as giving away cash: the recipient takes over the giver's cost basis and owes the gain, where the same shares left until death would have had that gain erased by the step-up. The model funds a gift from the accounts in the usual order and does not track which asset went to which person, so it neither rewards nor penalises that choice. The help says so at the input. It is also why the arithmetic here can make gifting look cleaner than it is.

Qualified charitable distributions

Money moving straight from a traditional IRA to a charity, from age 70 — the law says 70½ and this model counts whole years throughout. Capped at the 2026 ceiling of $111,000 a person, indexed, which the model applies once per household rather than once for each spouse (the cautious reading), and at the balance available. Two things make it worth more than withdrawing the money and claiming a deduction, and both fall out of where it sits in the calculation rather than being special-cased.

First, it never enters income. It is subtracted from the pre-tax balance before any of the tax machinery runs, so it does not raise taxable income, does not push Social Security across its provisional-income thresholds, and does not reach the MAGI series that sets a Medicare surcharge two years later. A deduction can do none of that, because by then the income has already counted.

Second, it satisfies the required minimum distribution dollar for dollar. The requirement is worked out first, on the balance before the gift, and only the unsatisfied remainder becomes taxable income:

taxable RMD = max(0, required − QCD)

On a $3M plan giving $40,000 a year this way, lifetime tax falls by about $327,000. A second, less obvious consequence: because the gift replaces a distribution that would otherwise have moved money out of the pre-tax account and into a taxable one, the estate left behind is more pre-tax-heavy than it would have been, and carries more income tax for beneficiaries. Both effects are real and the model shows both.

What beneficiaries receive

A different question from the one above, and not a rescaling of it, because three things change at death. The brokerage's cost basis steps up to market value, so its growth is never taxed. Pre-tax money is taxed at the heir's rate rather than the owner's. And a charity pays nothing on pre-tax money at all. Writing c for the charitable share of the pre-tax pot and h for the heir's rate:

to charity = trad · c
tax = trad · (1 − c) · h
to heirs = trad · (1 − c) · (1 − h) + roth + brokerage + cash + home equity

And h is worked out rather than chosen. Since 2020 most beneficiaries must empty an inherited retirement account within ten years, so what they inherit arrives as a decade of extra ordinary income stacked on whatever they already earn. For n people sharing a pot P, each taking P/n across ten years on their own income y:

h = 10 · n · [ tax(y + P / n / 10) − tax(y) ] / P

with tax including the reader's flat state rate as a stand-in for the beneficiaries', P in today's dollars and tax on this year's brackets, whatever the page is showing: projecting an heir's tax return decades out would be false precision on top of a guess, and pricing a future-dollar pot on today's brackets would push it into brackets it would never reach.

which is why the number of heirs changes the answer at all: the same pot divided four ways is four smaller slugs, each of which may stay inside the bracket that person was already in. On a $1.5M pot left to people earning $120,000 the federal part of the rate falls from 21.5% to 18.5% going from one heir to four; on a $6M pot, from 28.0% to 21.5%. The state rate adds the same few points to every one of these, since the inherited income sits above the heirs' deduction. It is equally why the effect sometimes vanishes: on that $1.5M pot left to someone earning $250,000 the federal part is 24.0% however it is divided, because every slug lands inside one bracket. Note also that h is evaluated on the amount actually inherited, so giving part of the pot to charity lowers the rate on what is left.

Those three sum to the ending balance by construction, and they are reported from a single path — the middle future by ending balance, the same one the account charts draw — rather than as three independent medians. Three medians would not add up, because the path sitting at the middle of what heirs receive is not the path sitting at the middle of what charity receives, and three figures presented as the split of one balance have to sum to it.

Note that to heirs can exceed the owner's own after-tax figure, and frequently does. The brokerage is the reason: the owner owes long-term gains tax to sell those shares and a beneficiary does not. Whether that outweighs the heir's rate on the pre-tax pot depends entirely on the mix of accounts, which is the comparison the level exists to make.

Caveat: the inputs to h are guesses, and this is not estate planning. Computing the rate removes the arithmetic from the reader but not the uncertainty: who inherits, what they earn at the time, where they live and what the brackets look like decades hence are all unknown, and asking for an income rather than a bracket only puts the same guess in a form the tax code can use. The right use of it is to move the inputs and see which way the answer leans, not to trust any single figure. The reader's own state rate stands in for the beneficiaries' (added 28 September 2026, so the heirs' figure is not flattered against "Worth after tax", which charges it). What it does not model: a beneficiary's own deductions, other investment income or their own state's rules, the year they actually inherit, or the fact that a spouse, a minor child, a disabled beneficiary or anyone within ten years of the account holder's age may stretch withdrawals across a lifetime instead of ten years. Everything that actually governs who inherits — wills, trusts, beneficiary designations, titling, probate, state law — is legal machinery this page does not touch and does not model. On most retirement accounts the beneficiary form overrides the will, and this tool has never seen yours.

The home

From Level 3 the reader can enter a home: its value today V, the mortgage still owed today M and the years left on it Y. It is counted, and by default not sold: unless a sale is added (below), the plan cannot spend it, so it changes neither the success rate nor the spending that lasts, and it is kept out of Total savings. At index k of a path with cumulative inflation CIk:

equityk = max(0, V · CIk − M · max(0, 1 − k / Y))

so the value keeps pace with that path's inflation, flat in today's dollars, and the balance is paid down evenly, in dollars, to nothing after Y years (with Y = 0, nothing is owed). A real loan pays mostly interest at first, so this flatters equity slightly in the early years. The payments are not modelled as a cost: before retirement they come out of the salary, and after it they are taken to be inside the yearly spending the reader entered. The note under the mortgage question gives the balance at retirement, M · max(0, 1 − (R − A) / Y), and the payoff age A + Y.

At death the equity goes to heirs in full: inherited property takes a new cost basis at its value on the day of death, so no income tax is owed on the gain, and estate tax is out of scope here as everywhere. It is drawn as its own block on Assets by class and its own band on the Level 6 chart, it is included in what heirs receive and in the share of futures clearing the reader's target at the plan age, and a future that ran short still leaves it. Home prices over long stretches have run a little ahead of inflation nationally and a long way behind it in some places and decades; inflation is the neutral assumption.

Selling it is a Level 4 life event, the one whose amount the model works out, once per plan. In its year k, priced at the index in force when that year began, like every other event:

freed = V · CIk−1 · (1 − 0.06) − M · max(0, 1 − (k−1) / Y) − N · CIk−1

with 6% for agents and closing and N the next home's cost in today's dollars (zero for a renter). A positive amount goes into the brokerage as basis, like money coming in; a negative one, a dearer next home, is paid for like any other cost that year. From index k the next home is the equity counted, owned outright at N · CI. The gain is taken to be inside the exclusion for a main home, $250,000 single and $500,000 married, so no tax is charged on it; moving costs, and rent for a renter, are the reader's to put in spending. The card, the arrow on the charts and the events key show freed in today's dollars at the plan's average inflation, an estimate, since each future's prices differ.

11. What is not modelled

12. What has been checked

Against the Trinity study

Restricting the data to 1926–1995 gives 41 overlapping 30-year windows, exactly as many as theirs. At a 4% inflation-adjusted withdrawal with no tax either side:

PortfolioThis modelTrinity
100% stocks38 of 41 (92.7%)39 of 41 (95%)
75% stocks39 of 41 (95.1%)40 of 41 (98%)
50% stocks38 of 41 (92.7%)39 of 41 (95%)

One window apart at every allocation. The systematic difference is the bond instrument: Trinity used long-term high-grade corporates, this uses 10-year Treasuries, which earn less. The gap is invisible where stocks dominate and widens as bonds take over, which is the observed pattern.

Against FI Calc

$1,000,000, 30 years, constant inflation-adjusted spending, 1871 data, no tax either side: 100% / 96.8% / 91.3% / 77.8% at $35,000 / $40,000 / $45,000 / $50,000, against their 100% / 96.8% / 91.2% / 79.2%. The remaining gap at $50,000 is their default 5% cash sleeve.

Against Portfolio Visualizer (Monte Carlo)

FI Calc checks the backtests only; this checks the projections. Portfolio Visualizer's Monte Carlo tool, "Forecasted Returns" model, was given this model's own assumptions converted to the arithmetic means and standard deviations it asks for: stocks 9.06% and 18.7% (the moments of a lognormal whose log has mean ln 1.075 and spread 0.17), 10-year Treasuries 4.19% and 6.26%, parameterized inflation 2.5% and 1.2%, annual rebalancing, $1,000,000, 30 years, inflation-adjusted annual withdrawals, pre-tax returns. It draws 5,000 futures; ours are 20,000 (ten seeds of 2,000), run with every dollar in a Roth and no state tax so no tax is charged. Measured 29 September 2026.

Spending100%: oursPVours, end-of-year60/40: oursPVours, end-of-year
$35,00087.388.087.592.692.193.0
$40,00080.679.981.084.885.585.7
$45,00072.874.074.573.475.476.1
$50,00064.467.666.960.565.064.4

The gap that grows with spending is withdrawal timing. With both spreads set to 0.01% the tool reports a median ending balance of $4,589,365 at $50,000; the recurrence Bt+1 = Bt(1+r) − W(1+i)t+1, spending taken after the year's growth at that year's end prices, gives $4,589,342, while this model's Bt+1 = (Bt − W(1+i)t)(1+r) gives $4,019,793. The "end-of-year" columns come from an independent re-implementation of section 2's return model, which reproduces this engine's own figures under its own convention and then switches only the timing: all eight land within 1.1 points of Portfolio Visualizer, inside the sampling error of 5,000 futures (about 0.6 points). Three smaller differences remain and pull against each other: their returns are normal rather than lognormal (a fatter left tail, which is harsher), their stocks and bonds are correlated with inflation at the historical −0.08 and −0.15 where this model scales nominal returns with inflation, and their stock-bond correlation is the historical 0.07 against this model's 0.10.

The distribution against 155 years of returns

StatisticHistoryLognormal
Standard deviation of log returns0.1660.170
Skewness−0.730
Excess kurtosis+1.070
Years beyond 2σ77.1
Years beyond 3σ20.42

The body of the distribution is well calibrated and the far tail is not. 1931 (−42.5%) is a −3.66σ event that 155 independent draws reproduce only 2% of the time, while the best year on record is only +2.18σ — an asymmetry a symmetric-in-logs distribution cannot represent. Against expectation, losing years in the record do not cluster more than independent draws would produce: 6 runs of two consecutive losses against 7.8 expected, 1 run of three against 2.7. Volatility clustering is a daily and monthly phenomenon that washes out by annual aggregation.

Model against itself

Set the compound return to history's own 9.2% and the random projections return 64% where the backtest of the same plan says 67%. Feeding the model history reproduces history to within three points, and the residual runs in the direction the tail and skew findings predict.

retirementDIY.org — for planning and education, not financial advice. © 2026 Brad Boyce. The engine is a single readable file; this document describes it as it stands, and where the two ever disagree, the code is what runs.