How Coastline calculates the numbers
Coastline projects one year at a time, from your current age to the end of the plan. Each year it computes income, taxes, spending, contributions, withdrawals and growth in that order, then carries the balances forward. Nothing is a rule of thumb applied to a lump sum — in the app, clicking any row in the results table opens that year's arithmetic, line by line.
This page documents the US engine: federal tax by filing status and the income tax of all 50 states and DC — what it implements, its conventions, what it simplifies, where its constants come from and how it is tested.
United States
The US engine computes:
- Federal ordinary income tax on inflation-indexed brackets by filing status, with the standard deduction or real itemized deductions (charitable giving, mortgage interest, SALT) — whichever is larger, working or retired:
max(itemized, standard). - FICA — Social Security at 6.2% up to the wage base, Medicare at 1.45%, plus the 0.9% additional Medicare surtax above the filing-status threshold — and self-employment tax (15.3% on 92.35% of net, half deductible) on business income.
- Long-term capital gains at 0/15/20%, correctly stacked on top of ordinary income rather than taxed in isolation, so a Roth conversion or a windfall can push gains into a higher capital-gains bracket exactly as it does in reality. The 3.8% NIIT applies to dividends and to brokerage, rental and home-sale gains above the MAGI threshold — not to an owner's sale of their own business.
- State income tax for all 50 states and DC (2026 Tax Foundation table) — each state’s schedules, its standard deduction and personal exemptions or exemption credits, Social Security exempt except in the eight states that still tax it, and Arizona’s age-65 exemption and 25% capital-gain subtraction. California’s 1% mental-health surcharge and the Massachusetts 4% millionaire surtax are modeled as real top brackets.
- Social Security benefit taxation (up to 85% of the benefit becoming taxable), the Child Tax Credit with its phase-out, the QBI / §199A deduction with its income phase-out, IRMAA Medicare surcharges, ACA premium subsidies, early-withdrawal penalties with the two escape hatches the engine models (a 72(t)/SEPP series paid from its own account, and a governmental 457(b), which is penalty-free on separation at any age), RMDs from the prior December 31 balance, and the student-loan forgiveness “tax bomb”.
Conventions
- Year 0 is the rest of this calendar year in a new plan: growth, interest and loan payments scale to the months left (or a full year, if you switch that off).
- Plan end: age 80 by default, for the table, the chart and the simulations.
- Dividends: 1.5% of the brokerage by default, taxed every year as qualified dividends (in AGI, NIIT and state tax), then reinvested.
- Social Security per spouse: each person's own benefit and claim age, plus the spousal top-up.
- RMDs: prior December 31 balance ÷ the Uniform Lifetime divisor, from 73 (75 if born 1960 or later).
- State tax by filing status: single, joint or head-of-household schedule.
- Deductions: retirees itemize when it beats the standard deduction; a QCD from 70½ is optional.
- Depreciation recapture on a rental sale: ordinary rates, capped at 25%.
- Historical simulation: 1928–2024 returns made real, then re-inflated at the plan's inflation; full windows only (97 − years + 1: 67 for a 65-to-95 plan).
- Student loans: IBR interest is simple; IDR payments use the prior year's AGI; PSLF counts W-2 years only.
- Homes don't appreciate in their purchase year.
- Brokerage basis: a new plan's blank basis is 65% of the balance.
- Cash is capped at 6 months of spending by default; the rest of the surplus goes to the brokerage.
What it simplifies. AMT is not modeled — it rarely binds under current law but can matter for a large ISO exercise. QBI takes the conservative treatment above the income threshold, which can under-credit a non-service business with large W-2 wages. State tax leaves out local and city income taxes and the state exclusions for pension and 401(k) income, so a retiree in a state with one pays less than shown. Breaking a 72(t) schedule charges the 10% recapture on every earlier penalty-free payment in that year; the IRS interest on the recapture is not modeled.
Projection, then simulation
The base projection is deterministic: one fixed return and inflation assumption, so the tax and cash-flow mechanics stay visible and reproducible. That answers “what does this plan do if markets behave average?”
Because markets do not behave average, the engine can re-run the same plan under Monte Carlo draws and historical-sequence simulation (every full window of real returns: 67 for a 65-to-95 plan), reporting the share of runs where the money lasts along with the median, 10th- and 90th-percentile outcomes. That is what captures sequence-of-returns risk — the reason two retirements with identical average returns can end very differently depending on when the bad years land. The simulator is the same code these pages use to compute their own market-risk figures at build time.
How these pages get their numbers
Every figure on every guide and tool page — including all of the ones above — is produced by running that same engine at build time. Where a page reports a “safe” spend or a required nest egg, it was found by binary search: repeatedly re-running the full projection until it found the largest spend, or the smallest portfolio, that survives the horizon. There are no hand-typed numbers and no figures borrowed from other calculators. If a number on this site is wrong, it is wrong because the engine is wrong, which is a thing that can be found and fixed.
How the engine is checked
A tax code is a lot of surface area to be quietly wrong on, so the check is the substantial part of the work. npm run verify runs 33 suite files; on the last full run the US and cross-engine suites reported 576 individual assertions passing and none failing. The expectations are hand-derived from the primary sources — someone computed the answer from the published rate tables and wrote it down — not captured from the engine’s own output, which would only prove it is consistent with yesterday’s bugs.
| Engine | Suites | Assertions | What they pin |
|---|---|---|---|
| United States | accuracy, helpers, sensitivity, Monte Carlo | 374 | brackets, FICA, capital-gains stacking, NIIT, 50 state schedules, RMDs, IRMAA, ACA |
| Cross-engine | regressions, HSA & filing changes, business loans, page helpers, strategy | 202 | every money bug ever fixed, pinned so it cannot silently return |
Alongside the counted assertions, the suite runs checks that report pass or fail rather than a tally: a fuzzer that throws 600 randomly-generated scenarios at the engine and asserts every projected row is plausible (no spurious net-worth jumps, no negative balances, no year taxed more than its income, no withdrawal larger than the balance); a reconciliation sweep across 800 more, re-deriving every year’s identities from its own components; share-code round-trips, which require that encoding and decoding a plan reproduces a byte-identical projection; determinism checks that two runs of the same plan agree exactly; and a regressions file that pins every money bug ever found so it cannot silently return.
Where the constants come from, and how they stay current
Tax brackets, deductions, contribution limits, benefit amounts and premium tiers all change annually. The US figures live in one constants file as a single source of truth, every value carries the URL it came from, and anything that could not be confirmed against a primary source is tagged in the file rather than silently invented. The file also carries an annual-update guide naming what to refresh when the IRS and the Social Security Administration publish the next year’s figures each autumn — because the failure mode for a calculator is not being wrong on launch day, it is going stale quietly. US constants are also editable in the app’s Constants Editor if you want to test a different assumption.
The sources are the publishers of the rules, not secondary summaries:
- United States — IRS Revenue Procedure 2025-32 (brackets, standard deduction, thresholds), IRS contribution limits, RMD rules, 72(t)/SEPP, the Social Security Administration for the wage base, COLA and bend points, and CMS for Medicare premiums and IRMAA tiers.
The limit that applies to every plan
Returns are a model, not a forecast. Nobody knows future returns, inflation, or what Congress and the state legislatures will do to tax law over thirty years. Results are estimates in today’s money under the assumptions you set, and they will not match reality exactly. What a good model can do is get the rules right, show its work, and be honest about its own edges — which is what everything above is for.
Engines in the code, not in the app →
Coastline is an educational modeling tool built by Tyler Richards, a dentist — not a licensed financial advisor — see about. It is not tax, legal or investment advice. Confirm any decision with a qualified professional.
Common questions
Does Coastline model real tax brackets, or just an effective rate?
Real brackets. The US engine computes federal brackets by filing status, FICA and self-employment tax, long-term capital gains stacked on top of ordinary income, NIIT, state tax for all 50 states and DC, Social Security benefit taxation and credits, with the standard deduction or real itemized deductions, whichever is larger.
Does Coastline work outside the United States?
Not at present. The calculator offers the United States only. The engines for other countries that remain in the code have no entry point in the app and their constants are not being updated; they are documented in the methodology archive.
What is not modeled?
By name: AMT, local income taxes and state pension exclusions (QBI is simplified). Consumption taxes, estate and inheritance taxes and stamp duties are outside the model.
How current are the numbers, and how do you know they are right?
The US figures live in one constants file with the source URL on every value and an annual-update guide naming the publication and the month it lands, and they are reviewed each year against the IRS, SSA and CMS releases. Correctness is checked by an automated suite of hand-derived assertions — 576 in the US and cross-engine suites, computed from the published rate tables rather than captured from the engine's own output — plus randomised fuzzing, a reconciliation sweep over every year of every projected plan, and share-code round-trips that require a byte-identical projection.