Coastline Open the calculator →
Methodology

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:

Conventions

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.

Assertions by engine, as the suites themselves report them.
EngineSuitesAssertionsWhat they pin
United Statesaccuracy, helpers, sensitivity, Monte Carlo374brackets, FICA, capital-gains stacking, NIIT, 50 state schedules, RMDs, IRMAA, ACA
Cross-engineregressions, HSA & filing changes, business loans, page helpers, strategy202every 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:

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.

Run this with your real numbers
Run it yourself — click any row in the results to see the math for that year.
Open the free calculator →

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.

Keep exploring