Retirement Calculators
I built this free, single-page calculator because retirement spending depends on more than a single withdrawal rate. Income composition, taxes, dividends, taxable brokerage sales, MAGI, ACA subsidies, payroll taxes, state taxes, and withdrawal rates interact, and I could not find a simple tool that brought those pieces together with realistic, composition-aware tax modeling.
It is designed as a one-year snapshot for income and tax planning, answering five related and interdependent retirement-planning questions:
- How much surplus or shortfall do I have?
- What withdrawal rate do I need?
- What portfolio size do I need?
- How much earned income do I need?
- How much investment income can I take while staying under my MAGI target?
Each calculator uses your inputs and solves for a different unknown. A value that is an input in one calculator may be the unknown that another solves for. For example, Withdrawal Rate is an input in most calculators, but Calculator 2 solves for the needed withdrawal rate.
If this calculator saves you time or helps you think through your own retirement scenarios, feel free to show your support.
✨ What makes this calculator different
Most online retirement calculators either ignore taxes entirely or apply a flat effective rate. Both can produce misleading numbers because real-world tax depends on the composition of your income — not just the total. This calculator is built around that composition.
- A rare five-way solver — surplus/shortfall, needed withdrawal rate, needed portfolio size, needed earned income, and maximum investment income under an ACA/MAGI target. Many tools answer one or two of these questions, but not all five in one compact interface.
- Current-year after-tax spendable income focus — useful for early retirees trying to see how taxable brokerage withdrawals, part-time W-2 income, dividends, Social Security benefits, and pension income translate into actual net spending.
- Composition-aware tax modeling — separates earned wages, Social Security benefits, Pension / Other Ordinary Income, ordinary dividends, qualified dividends, LTCG share-sale residual, ordinary share-sale income, Roth/cash no-tax treatment, and cost basis rather than hiding everything inside a black box.
- Progressive federal and state brackets — applies bracket math rather than flat tax rates, and stacks qualified dividends and long-term capital gains on top of ordinary income to determine the correct preferential federal LTCG rate.
- Investment-tax detail — applies cost basis only to the share-sale residual, treats dividends as fully taxable, computes NIIT where applicable, and models high-income state surtax when configured.
- Payroll-tax detail — computes Social Security, Medicare, Additional Medicare Tax, and state SDI on earned income only, so pension income, Social Security benefits, and portfolio income are not mistakenly treated as wages.
- ACA/MAGI visibility — a meaningful niche for early retirees balancing dividends, gains, HSA/401(k), Social Security, pension income, and earned income.
- California-ready but editable — includes California brackets, state treatment of qualified dividends/LTCG as ordinary income, HSA nonconformity, and high-income state surtax assumptions out of the box, while the Tax Settings panel can be edited for another state.
- No login, local storage only — unlike many modern planners that require accounts, subscription dashboards, or cloud-based data entry.
- Editable tax settings — users can inspect and adjust brackets, deductions, thresholds, payroll rates, NIIT, Social Security taxable percentage, state credits, and state assumptions, which builds trust for a calculator where tax assumptions are central.
🔢 The five calculators
1) Surplus Calculator
Given my portfolio, income, and spending — do I have extra money each year or a shortfall?
2) Needed Withdrawal Rate
What withdrawal rate would exactly fund my spending?
3) Needed Portfolio Size
How large does my portfolio need to be to support this lifestyle?
4) Needed Earned Income
If I'm still working, how much W-2 income do I need?
5) Max Under MAGI
How much investment income can I take while staying under my MAGI target?
Each calculator answers a different question about the same scenario. Calculator 1 shows where you stand today; 2–4 each adjust a single input to exactly cover your spending; 5 finds the most you can withdraw before hitting your MAGI target. On the All 5 Calculators Dashboard a single Shared Inputs panel drives all five at once — every card uses the same inputs, replacing only the one field it solves for. For independent inputs, open a calculator’s single view.
🧮 Understanding the Dashboard
The five calculators each answer a different retirement question, but they all describe the same financial situation — your portfolio, your income, your spending. The All 5 Calculators Dashboard puts all five side by side so you can see every answer for that one scenario at the same time.
On the left is the Shared Inputs panel. Type your numbers there once — filing status, portfolio value, expenses, dividends, and so on — and all five cards update together. You are not filling out five separate forms; you are describing one scenario, and each card responds to it.
Each card solves for one field, replacing what you typed
This is the key to reading the dashboard. Calculator 2 solves for your withdrawal rate, so it crosses out the withdrawal rate in the shared panel and shows the rate you would actually need. Calculator 3 solves for portfolio value and shows how large your portfolio needs to be. Calculator 4 solves for earned income. Calculator 1 keeps every field as you typed it — it shows where you stand today. Hover over any card to highlight the inputs it uses.
Dashboard vs. a single calculator: Use the dashboard when you want all five answers for one consistent scenario at a glance. Open a calculator’s single view when you want to give that one calculator its own independent inputs without affecting the others.
▶ How to use
- Click the Calculator tab
- Choose your filing status — MFJ or Single. Each single calculator has its own editable filing status; on the All 5 Calculators Dashboard, the Shared Inputs panel sets one filing status that applies to all five calculators.
- Enter your inputs — sample values are pre-loaded as a realistic example
- In Calculator 1, click Set WD rate = dividends only, no share sales if you want to model spending dividends without selling shares.
- Read the primary result box at the top of each calculator result panel
- Save scenarios using the + Save to Scenario Manager button in the active single-calculator view or dashboard card
- To customize for a different state, edit the Tax Settings tab. Changing the State Name alone only changes labels; you must also update the state brackets and assumptions.
- To track ACA health-insurance planning, enter your chosen MAGI Target in the calculator inputs, such as the applicable FPL-based limit for your household size. Each calculator then shows whether MAGI is over or under target.
- Your calculator inputs are saved automatically and reloaded on your next visit. To start fresh, use Reset calculator to sample data or Clear calculator to zero in a single-calculator view. In the dashboard view, use Reset dashboard calculators to sample data or Clear dashboard calculators to zero.
- In Tax Settings, bracket and rate changes require clicking 💾 Save as My Defaults to persist — HSA settings save automatically
Not tax or financial advice. Verify all results with a qualified CPA or financial advisor before making decisions. This tool is for planning and exploration only.
⭐ Key features
- Live recalculation — outputs update on every keystroke; no submit button needed
- MFJ / Single filing controls — each single calculator can use its own filing status, while the All 5 Calculators Dashboard uses one shared filing status for all five cards; both use the same tax tables
- Theme — use the "Switch to Aurora" / "Switch to Classic" button in the top bar to toggle between the Classic light theme and the Aurora dark theme
- Copy inputs — the Copy Calc 1 inputs to 2-5 button copies Calculator 1's inputs into Calculators 2, 3, 4, and 5 in the same view. The dashboard also includes Copy all input values from single calculator view to dashboard.
- Effective tax rate — shown below Total Tax in every calculator's breakdown
- Collapsible tax breakdown — click the "Tax Breakdown" title to collapse the detail rows
- Tax Settings panel — all brackets, rates, thresholds, and deductions are editable; changes apply instantly to all calculators
- Save as My Defaults — customize Tax Settings for your state, save them to your browser, and they reload automatically on every visit. Use Backup Tax Settings / Restore Tax Settings to move tax settings between devices.
- Scenario Manager — save, compare, sort, filter, and duplicate scenarios; export as JSON, CSV, or Excel
- Print-friendly — calculator print buttons create compact calculator reports. Scenario Manager printing is available for quick previews, but Export to Excel or CSV is recommended for the cleanest printed scenario tables
- MAGI target helper — enter your target in the calculator inputs; each calculator then shows whether your MAGI is over or under target, and by how many dollars.
ACA/FPL timing note
ACA premium tax credit calculations for a coverage year generally use federal poverty line (FPL) thresholds published before that coverage year begins. Current-year coverage can rely on the prior year's FPL guidelines because open enrollment and plan pricing occur before the new year. ACA subsidy rules can change, so verify the current rule and FPL threshold before relying on the MAGI target for planning.
- No account required — your inputs, scenarios, and settings are stored in your browser's local storage and never transmitted to any server
💵 Calculator 1 dividend-only shortcut
Set WD rate = dividends only, no share sales
Calculator 1 keeps one consistent definition: total desired withdrawal rate includes dividends plus share sales. The dividend-only shortcut sets the withdrawal rate equal to (ordinary dividends + qualified dividends) ÷ portfolio value. This models spending portfolio dividends with no share sales.
Scenario Manager impact
Scenarios save the resulting withdrawal rate, not the button click itself. For example, if dividends are $32,000 and portfolio value is $4,000,000, the saved withdrawal rate is 0.80%. Loading the scenario later restores that withdrawal rate and keeps the calculator consistent with the other calculators.
💡 Key concepts
Ordinary income
Wages, Traditional 401(k)/IRA withdrawals, interest, and ordinary dividends. Taxed at regular progressive federal rates and full state rates.
Long-Term Capital Gains (LTCG)
Profits from selling assets held more than a year. Federally taxed at preferential LTCG rates. Cost basis % applies only to the share-sale residual — not to dividends. A 60% cost basis means 40% of the sale residual is taxed as a realized capital gain.
Example: A $120,000 withdrawal with $5,000 ordinary dividends, $5,000 qualified dividends, and a $110,000 share-sale residual at 50% cost basis produces $55,000 of taxable gain. California then taxes $5,000 ordinary + $5,000 qualified + $55,000 gain = $65,000 CA-taxable investment income before deductions.
Qualified dividends
Dividends from certain stocks held long enough. Taxed federally at LTCG rates. Most states treat them as ordinary income.
Total Desired Withdrawal Rate
The percentage of your portfolio you withdraw per year — this includes dividends. If your portfolio is $1M and your withdrawal rate is 4%, your annual portfolio withdrawal is $40,000 (dividends + share sales combined, not in addition to).
🔢 How the math works
When you enter inputs, the calculator works through this chain:
- Compute total portfolio income: Portfolio × Withdrawal Rate
- Subtract your dividends (ordinary + qualified) — what's left is the implied "share sale"
- Categorize each income stream by tax treatment (ordinary vs. LTCG vs. tax-free)
- Apply federal brackets to ordinary taxable income
- Stack LTCG on top of ordinary income and apply preferential LTCG rates by threshold
- Apply state brackets to state-taxable income (state treats LTCG as ordinary; Social Security benefits are excluded)
- Compute payroll taxes on earned income only
- Subtract everything to get net income; compare to expenses to get surplus or shortfall
For Calculators 2, 3, 4, and 5, a bisection solver works backwards — it tries values of the unknown variable until the math balances at the relevant target, such as target spending or the ACA/MAGI target.
📋 Income types
| Input |
Federal treatment |
State treatment |
| Earned income (W-2) | Ordinary brackets | Ordinary brackets + payroll taxes |
| Social Security benefits | Taxable % included in ordinary brackets ( default, adjustable) | Excluded from state taxable income (California and most states); no state income tax or payroll tax on benefits |
| Pension / other ordinary income | Fully included in ordinary brackets | Fully included in ordinary brackets (no payroll tax) |
| Ordinary dividends | Ordinary brackets | Ordinary brackets |
| Qualified dividends | LTCG rates (stacked) | Ordinary brackets |
| Share-sale residual (LTCG) | LTCG rates on gain portion | Ordinary brackets on gain portion |
| Roth / cash / no-tax | Not taxed | Not taxed |
🏛 Tax coverage
Federal tax coverage
- Progressive ordinary income tax brackets for MFJ and Single filing status
- Federal standard deduction settings
- Long-term capital gains and qualified dividend stacking
- Net Investment Income Tax where applicable
- 401(k) and HSA deductions for federal taxable income and MAGI
- Configurable taxable percentage for Social Security benefits
Payroll tax coverage
- Social Security payroll tax on wages
- Medicare payroll tax on wages
- Additional Medicare Tax on wages where applicable
- State payroll/disability tax where configured
- No payroll tax on Social Security benefits, pension income, dividends, or portfolio withdrawals
State tax coverage
- Editable state name, bracket schedule, standard deduction, and exemption credit settings
- State treatment of long-term capital gains and qualified dividends as ordinary income unless manually adjusted
- Social Security benefits excluded from state taxable income (matches California and most states)
- State HSA conformity or nonconformity based on Tax Settings
- High-income state surtax where configured
- Exact rates, brackets, thresholds, deductions, credits, and state assumptions are shown and editable in the Tax Settings tab.
⚠️ Important nuances
Withdrawal rate includes dividends
If your withdrawal rate is 4% and your portfolio is $1M, the model assumes $40,000 of total portfolio income — including dividends. Dividends and share sales are different sources of the same $40k, not additions on top of it.
Why higher ordinary dividends increase the needed withdrawal rate
In Calculator 2, increasing ordinary dividends will increase the rate the solver returns. This isn't a bug — ordinary dividends are taxed at higher rates than LTCG. Shifting income from "share sale at preferential LTCG rates" to "ordinary dividend at regular progressive rates" creates more tax, so you need to withdraw more total to net the same spending.
Why 401(k) or HSA deductions may look offset in solver calculators
In Calculators 2, 3, and 4, the calculator solves backward to hit your target spending. A 401(k) or HSA contribution still reduces federal taxable income and MAGI directly, but the solver may increase the needed withdrawal, portfolio size, or earned income to keep net spending funded. If the extra solved withdrawal is taxed as ordinary income, the offset can be exact: 401(k) contribution reduces MAGI by $1; extra ordinary withdrawal increases MAGI by $1; net MAGI change = $0. So MAGI may appear unchanged even though the deduction is included.
State taxes vary widely
California is built in, but you can enter any state's brackets in the Tax Settings tab. For states with no income tax (TX, FL, NV, SD, WY, AK, TN, NH, etc.), set all state bracket rates to 0%.
Nine states (AR, HI, MT, ND, NM, SC, VT, WA, WI) tax LTCG differently from ordinary income — the calculator will overstate state tax for residents of those states. See the Read Me's "What this calculator does NOT model" section for details.
Social Security is excluded from state taxable income (correct for California and most states); the few states that tax Social Security use income-based phaseouts that are not modeled.
🗺 Customizing for your state
The calculator loads with California-style defaults, but the State Tax Settings are editable. Changing the state name only changes labels; to model another state, also update the standard deduction, exemption credit, bracket schedule, HSA state treatment, payroll/SDI rate, and high-income surtax settings. See the Tax Settings tab for the editable fields.
- If your state has fewer brackets, enter the real brackets from top to bottom in ascending lower-threshold order, then enter $0 and 0% in any unused bracket rows at the bottom.
- If your state has more brackets than the table allows or uses special worksheets, the state-tax estimate may require approximation or code changes.
- For states with no income tax, set the state bracket rates to 0%. Separate taxes outside the ordinary income-tax schedule may not be modeled.
📁 Scenario Manager
The Scenario Manager lets you build a library of "what if" cases side by side.
To save a scenario: run any of the five calculators in a single view or dashboard card, then click + Save to Scenario Manager and give it a name like "Base case — retire 2027".
To load a scenario: go to the Scenario Manager tab, find the row, and click Load — the saved inputs populate into the matching calculator view and the calculator recalculates. Click Duplicate to copy a scenario and modify it, or Delete to remove it.
To sort and filter: use the Sort buttons (Extra/Mo, Withdrawal Rate, Portfolio) and Filter buttons (Calc 1–5) above the table to focus on what matters. Null values always sort to the bottom.
To export or print: use Backup Scenarios for a restorable JSON backup. Use Export to CSV for raw spreadsheet data, or Export to Excel for a formatted .xlsx file with dollar/percent formatting. The Scenario Manager 🖨 Print option is useful for quick previews, but Excel/CSV is usually better for polished printed reports.
To back up and move scenarios only: use Backup Scenarios and Restore Scenarios to move saved scenarios between browsers or devices. Use Backup All Data in Tax Settings to move scenarios plus calculator inputs, Tax Settings, MAGI/HSA preferences, theme, and Scenario Manager column layout.
🔒 Your data never leaves your device. No account required. No login. Your inputs, scenarios, and settings are saved in your browser's local storage and never transmitted anywhere. If you clear your browser's site data, saved scenarios will be erased — use Backup Scenarios regularly to keep a scenarios-only backup, or Backup All Data for a full browser/device transfer.
💾 What saves automatically
- ✅ Calculator inputs — saved on every field change; restored on your next visit
- ✅ Scenarios — saved whenever you click "+ Save to Scenario Manager"
- ✅ HSA settings — saved whenever you change either HSA toggle in Tax Settings
- ✅ Dark mode preference — remembered across visits
- ✅ MAGI target settings — saved automatically when changed
- ❌ User changes to tax brackets and rates — not saved automatically; click Save as My Defaults in Tax Settings to persist them
✅ How the tax math was checked
Multiple independent checks
The tax engine was checked against multiple independent sources before release and after the later Social Security / pension, Additional Medicare Tax, and high-income state surtax changes:
- PSLmodels Tax-Calculator — an open-source Python library used by economists and tax-policy researchers to model federal tax law. The calculator's federal outputs were compared for the regression scenarios on the overlapping federal items: AGI/MAGI-style income, regular federal tax, NIIT, and total federal income tax.
- OpenTaxSolver US 1040 + Form 8960 / Form 8959 — open-source tax preparation software run from command-line input files. It was used as a separate federal check for regular federal tax, qualified-dividend/LTCG behavior, NIIT, and Additional Medicare Tax under matching test-year assumptions.
- OpenTaxSolver CA 540 — OpenTaxSolver's California Form 540 module. It was used to check the California tax-from-California-AGI layer: standard deduction, bracket tax, personal exemption credit, and final CA tax for the overlapping lines. Remaining high-income differences were explained by California exemption-credit phaseout, which is user-adjustable but not automated, and separate high-income surtax line handling.
- PolicyEngine US — an open-source microsimulation model of US federal and state tax-benefit rules. It was used as an independent cross-check on California results built from raw inputs and on federal results in a matching-year simulation.
- AARP's federal calculator and California FTB materials — selected federal cases were checked against AARP's federal calculator, including complex investment-income and NIIT cases. California bracket math and state constants were checked against California FTB materials.
Payroll taxes were checked against published Social Security, Medicare, Additional Medicare Tax, and state SDI assumptions. The regression and external checks covered both filing statuses, earned wages, Social Security taxable percentage, Pension / Other Ordinary Income, ordinary and qualified dividends, long-term capital gains, ordinary share-sale income, 401(k) and HSA deductions, NIIT, Additional Medicare Tax, California HSA nonconformity, high-income state surtax logic, and a dividends-exceed-withdrawal edge case.
These checks reduce the risk of errors, but this calculator is still an estimate and is not a substitute for professional tax advice.
🚫 What this calculator does NOT model
- Full Social Security benefit taxation formula — the calculator uses a fixed taxable percentage (default shown in Tax Settings, adjustable by the user) rather than automatically applying the IRS phase-in formula based on combined income. Earlier calculator versions treated the former combined SS / Pension field as fully taxable, so older saved scenarios with Social Security income may show different results after this update.
- State taxation of Social Security in the few states that tax it — California (built in) and most states fully exclude Social Security from state taxable income, which the calculator models by excluding Social Security from the state base. The roughly eight states that still tax Social Security (e.g. CO, CT, MN, MT, NM, RI, UT, VT) do so through income- and age-based phaseouts that are not modeled; for those states the calculator understates state tax on Social Security.
- Multi-year projections, inflation, sequence-of-returns risk, or Monte Carlo simulation
- RMDs, Roth conversions, or account sequencing optimization
- Itemized deductions — the standard deduction is assumed
- Alternative Minimum Tax (AMT)
- Tax credits beyond the basic state exemption credit
- ACA premium tax credit calculation or Form 8962 reconciliation — the calculator tracks MAGI against a user-entered target but does not calculate the actual subsidy or repayment amount
- Full federal-to-state adjustment worksheets or state-specific tax worksheets beyond the editable bracket, deduction, credit, HSA, payroll, and surtax settings
- State exemption-credit phaseouts — some states reduce or eliminate exemption credits at higher incomes using state-specific worksheets. The calculator does not automatically model those phaseouts; adjust the State Exemption Credit manually in Tax Settings if applicable.
- State LTCG preferential or separate state capital-gains taxes — some states (including AR, HI, MT, ND, NM, SC, VT, WA, and WI) tax long-term capital gains differently from ordinary income. Because this calculator generally treats LTCG as ordinary income for state purposes, state tax may be overstated or otherwise not match those states. For WA residents, set state income-tax bracket rates to 0%; Washington's separate capital gains tax is not modeled.
🔧 Technical notes
- Tax engine written in vanilla JavaScript; bisection solver runs 60 iterations per calculation for precision equivalent to less than a penny on any result
- All data stored in browser
localStorage — see "What saves automatically" above for details
- Print-optimized CSS included; use calculator header print buttons for calculator reports. For wide Scenario Manager tables, Export to Excel or CSV usually prints more cleanly than browser print.
📝 Calculation changelog
2026-06-14 — Fixed California tax on Social Security: California fully excludes Social Security benefits from state taxable income (Schedule CA 540 subtraction, R&TC §17087), but the calculator had been including the federally-taxable portion (up to 85%) in the California base. Social Security is now excluded from the state computation; the federal treatment (up to 85% taxable) is unchanged. California tax is lower and net income higher for any scenario with Social Security benefits.
2026-06-06 — Visual interface changes were made to the website, including layout and usability updates, but the underlying calculation engine was unchanged.
2026-06-03 — Added Additional Medicare Tax (Form 8959) on wages above the configured threshold. Previously not modeled; high-wage earners' payroll taxes were understated. The rate and thresholds are configurable in Tax Settings.
2026-06-03 — Added configurable high-income state surtax on state taxable income above the configured threshold. Previously not modeled; filers subject to a state high-income surtax could have understated state tax. The rate and threshold are configurable in Tax Settings and can be disabled there for states without this tax.
2026-06-03 — Added configurable Social Security taxable percentage in Tax Settings. Previously Social Security and pension income were treated the same way for tax purposes. The taxable percentage can now be adjusted in Tax Settings. Saved scenarios from the prior version that included Social Security income may show different taxes after this update.
2026-06-03 — Fixed Calculator 4 (Needed Earned Income): the bisection solver's lower-bound probe was missing the Pension / Other Ordinary Income value, causing Calculator 4 to overstate needed earned income when pension income was entered. Calculators 1, 2, 3, and 5 were unaffected.
2026-06-03 — Split the former combined SS / Pension input into separate Social Security Benefits and Pension / Other Ordinary Income fields. Pension / Other Ordinary Income is treated as fully taxable ordinary income with no payroll tax. Social Security Benefits use an adjustable Social Security Taxable % setting. Earlier calculator versions conservatively treated the former combined SS / Pension field as 100% taxable. The default is now 85% for Social Security benefits, and users can adjust the taxable percentage in Tax Settings to better match their income situation.
2026-06-01 — Added Calculator 1 “Set WD rate = dividends only, no share sales” shortcut. This sets the withdrawal-rate input so total withdrawal equals ordinary plus qualified dividends, allowing users to model spending dividends without share sales while preserving the calculator’s definition that withdrawal rate includes dividends plus share sales.
2026-05-30 — Fixed federal LTCG / qualified dividend tax for retirees with low ordinary income. When earned income and ordinary dividends fall below the standard deduction, the unused portion of the deduction now correctly reduces the LTCG taxable amount before rate stacking, matching the IRS qualified dividend and capital gain tax worksheet. Previously the calculator overstated federal capital gains tax in this scenario.
💬 Feedback & discussion
This calculator was shared on the
Bogleheads forum. If you have questions, found a bug, or want to suggest an improvement, that thread is the best place to reach me.
© All rights reserved. This calculator and its source code may not be copied, modified, redistributed, or used as the basis for other products without explicit written permission.