Retirement Tax Calculator
A free, single-page retirement income planner that answers four questions most calculators don't: how much surplus do you have, what withdrawal rate do you need, how large does your portfolio need to be, and how much do you need to earn — all with realistic, composition-aware tax modeling for federal and state.
☕ If this calculator is useful to you, please consider supporting ongoing development:
📊 Why this is different
Most online retirement calculators either ignore taxes entirely or apply a flat effective rate. Both produce misleading numbers because real-world tax depends on the composition of your income — not just the total. This calculator models that composition explicitly:
- Distinguishes ordinary income, qualified dividends, and long-term capital gains (LTCG) — each taxed differently at the federal level
- Applies progressive brackets (not flat rates) for both federal and state
- Stacks LTCG on top of ordinary income to determine the correct 0% / 15% / 20% rate
- Applies cost basis % to the share-sale residual only (dividends are always fully taxable)
- Computes NIIT (3.8% federal surtax) on investment income above the MAGI threshold
- Computes payroll taxes (Social Security, Medicare, state SDI) on earned income only
- Handles California brackets out of the box, with a Tax Settings panel to swap in any state
- Supports both MFJ (married filing jointly) and Single filing statuses
🔢 The four 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?
All four calculators sit on one tab so you can compare scenarios at a glance. Calculators 2, 3, and 4 use a bisection solver that iterates to a precise answer — the same approach used in professional financial modeling tools.
⭐ Key features
- Live recalculation — outputs update on every keystroke, no submit button needed
- MFJ / Single toggle — switches all four calculators and tax tables simultaneously
- 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; export/import as a file to move between devices
- Scenario Manager — save, compare, sort, filter, and duplicate scenarios; export as JSON, CSV, or Excel
- Persistent storage — scenarios and your custom Tax Settings defaults save automatically to your browser
- Print-friendly — click the 🖨 Print button on the Calculator or Scenario Manager tab to print or save as PDF; columns are sized for landscape
- No account required — calculator inputs and saved data are stored locally in your browser and are not sent to any server
🔢 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 0% / 15% / 20% rates by threshold
- Apply state brackets to all taxable income (state treats LTCG as ordinary)
- 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, and 4 ("Needed X"), a bisection solver works backwards — it tries values of the unknown variable until the math balances at your target spending.
💡 Key concepts
Ordinary income
Wages, Traditional 401(k)/IRA withdrawals, interest, and ordinary dividends. Taxed at regular federal rates (10–37%) and full state rates.
Long-Term Capital Gains (LTCG)
Profits from selling assets held more than a year. Federally taxed at lower rates (0%, 15%, or 20%). 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).
📋 Income types
| Input |
Federal treatment |
State treatment |
| Earned income (W-2) | Ordinary brackets | Ordinary brackets + payroll taxes |
| SS / Pension income | Ordinary brackets | 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 (2026, IRS Rev. Proc. 2025-32)
- 7-bracket ordinary income tax (MFJ and Single)
- LTCG rates: 0% / 15% / 20% with correct stacking
- NIIT: 3.8% on investment income above MAGI threshold ($250k MFJ / $200k Single)
- Standard deduction: $32,200 MFJ / $16,100 Single
- 401(k) and HSA contributions reduce federal taxable income and MAGI
Payroll
- Social Security: 6.2% up to $184,500 wage base
- Medicare: 1.45%
- State SDI: 1.3% (California default, editable)
State (California 2025 defaults, customizable)
- 9-bracket progressive schedule for MFJ and Single
- Standard deduction and exemption credit applied
- LTCG and qualified dividends taxed as ordinary state income
- HSA state deductibility configurable
⚠️ 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 0/15/20%" to "ordinary dividend at 10–37%" creates more tax, so you need to withdraw more total to net the same spending.
State taxes vary widely
California is built in, but you can enter any state's brackets in the Tax Settings tab. About 9 states (AR, HI, MT, ND, NM, SC, VT, WA, WI) tax LTCG differently from ordinary income — for those states this calculator will overstate state tax. For states with no income tax (TX, FL, NV, etc.), set all state bracket rates to 0%.
🗺 Customizing for your state
- Open the Tax Settings tab
- Replace the bracket lower thresholds and rates in the State (MFJ) and State (Single) sections with your state's schedule
- Update the state standard deduction, exemption credit, and SDI rate
- Type your state name — it appears in the tax breakdown labels on the calculator
- No state income tax? (TX, FL, NV, WA, etc.) — set all state bracket rates to 0%. The lower thresholds don't matter when rates are zero.
📁 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 four calculators, 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 — all inputs populate automatically 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–4) above the table to focus on what matters. Null values always sort to the bottom.
To export your scenarios: use Export JSON for a full backup you can import back later, Export CSV for raw numbers suitable for further analysis in any spreadsheet app, or Export Excel for a formatted .xlsx file with dollar signs and percentages applied. Click 🖨 Print to print the table or save it as a PDF — the most important columns are shown and sized for landscape.
To back up and move scenarios: use Export JSON and Import JSON to move scenarios between browsers or devices.
🔒 Your data never leaves your device. No account required. Nothing is sent to any server. Scenarios are saved in your browser's local storage — if you clear your browser's site data, saved scenarios will be erased. Use Export JSON regularly to keep a backup.
🚫 What this calculator does NOT model
- California Mental Health Services Tax (1% on CA taxable income over $1M)
- Additional Medicare Tax (0.9% on wages above $200k single / $250k MFJ)
- Social Security benefit taxation (the 85% inclusion rule)
- Multi-year projections, inflation, sequence-of-returns risk, or Monte Carlo simulation
- RMDs, Roth conversions, or account sequencing optimization
- Tax credits beyond the basic state exemption credit
- State LTCG preferences for the ~9 states that tax gains differently
▶ How to use
- Click the Calculator tab
- Choose your filing status at the top (MFJ or Single)
- Enter your inputs — sample values are pre-loaded showing a realistic example
- Read the gold-highlighted output cells for your results
- Save scenarios using the + Save to Scenario Manager button on each calculator
- To customize for a different state, edit the Tax Settings tab
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.
🔧 Technical notes
- Single
index.html file — no build step or server required. The calculator runs client-side; optional donation and Excel-export features may load third-party scripts.
- Tax engine written in vanilla JavaScript; bisection solver runs 60 iterations per calculation for precision equivalent to less than a penny on any result
- Scenario data stored in browser
localStorage under the key retirement_scenarios; custom Tax Settings saved under retirement_my_defaults
- Calculator inputs and saved scenarios are stored locally in your browser and are not sent to this app's server
- Print-optimized CSS included; use the 🖨 Print button or browser print to generate a PDF — landscape orientation with color preserved
© 2026 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.