How the math works
This calculator uses IRS-published 2026 contribution limits (IR-2025-111, Notice 2025-67, Notice 2026-05) to model the maximum tax-advantaged stack for a W-2 employee with an HSA-qualified HDHP. The default assumes self-only HDHP coverage and a linear employer match formula; both can be overridden with real plan documents.
Federal tax saved is computed at your effective federal rate on the post-shelter taxable gross — a conservative estimate that avoids over-stating savings across multiple brackets. State tax savings are NOT modeled (they vary by state of residence; CA and NJ treat HSA differently).
What this tool does not fully model
- Roth IRA income phase-out. Direct Roth contributions phase out between $153,000 and $168,000 MAGI (single filers) in 2026. Above that, the backdoor Roth strategy is available — but requires rolling pre-tax IRA balances into your 401(k) to avoid the pro-rata rule. Calculator #16 (future) will add backdoor Roth logic.
- Roth catch-up mandatory threshold ($150K). Workers earning more than $150K FICA wages from the same employer in the prior year must take their 401(k) catch-up as Roth, not Traditional. Calculator #16 will add this warning.
- Solo 401(k) for 1099 workers. Self-employed retirement options differ substantially — profit-sharing up to 25% of net SE income. Calculator #19 (future).
- Mega backdoor Roth. After-tax 401(k) contributions + in-plan Roth conversion. Requires plan-specific support; Calculator #17 (future).
Worked example: $80,000 single, age 35, 4% match
At $80,000 with a typical 4% employer match, you have room to shelter $36,400 of your own contributions and capture $3,200 in free employer money — a total of $39,600 in tax-advantaged space. That is a 49.5% effective contribution rate and saves approximately $3,468 in current-year federal tax at the single-filing bracket. The breakdown: $24,500 to your 401(k), $4,400 to your HSA, $7,500 to your Traditional IRA, plus the $3,200 employer match that drops in automatically.
The single biggest lever you control is the 401(k) deferral rate. Vanguard's 2026 Vanguard How America Saves 2026 (2025 plan-year data (released June 2026)) data shows the average employee deferral rate is 7.6% and the median is 6.6% — so 6% is solidly median, but maxing out the $24,500 limit requires a 30.6% deferral at $80,000. If your employer offers an HSA-qualified HDHP, the HSA adds $4,400 of pre-tax shelter that is also triple-tax-advantaged (pre-tax in, tax-free growth, tax-free out for qualified medical expenses). The IRA at $7,500 is the third pillar — small in absolute terms but it diversifies the tax treatment and stays portable if you change jobs.
Worked example: $150,000 single, age 35, 6% match
At $150,000 with a generous 6% employer match ($9,000), the math shifts. Your own $36,400 of contributions still hits the IRS caps — $24,500 to 401(k), $4,400 to HSA, $7,500 to IRA — but the employer match brings the total tax-advantaged space to $45,400. The estimated federal tax savings rises to approximately $6,600 at the single-filing bracket. That extra $2,000 in tax savings versus the $80,000 worker is real money, but it also surfaces a new strategic question: are you maxing every available account?
At $150,000 you are also just below the Roth IRA direct contribution phase-out, which begins at $153,000 MAGI for single filers in 2026 ( IRS Notice 2025-67 (2026 tax year) ). If your income grows past $168,000 MAGI, direct Roth IRA contributions are no longer allowed and you would need to use the backdoor Roth IRA strategy — contribute to a non-deductible Traditional IRA, then convert to Roth. The pro-rata rule complicates this if you hold any other pre-tax IRA balances.
Worked example: $200,000 single, age 35, 5% match
At $200,000 you are above the Roth IRA direct contribution phase-out, so the calculator treats IRA contributions as Traditional (pre-tax) — this is the v1.0 simplification. The total tax-advantaged stack becomes $46,400 ($36,400 of your own + $10,000 employer match at 5%), with approximately $6,936 in current-year federal tax savings. Two new rules kick in at this income level: the mega backdoor Roth becomes accessible if your 401(k) plan supports after-tax contributions, and the SECURE 2.0 high-earner Roth catch-up rule applies.
The SECURE 2.0 mandatory Roth catch-up rule requires that any 401(k) catch-up contributions made by workers who earned more than $150,000 in FICA wages from the same employer in the prior year must go into a Roth 401(k), not a Traditional 401(k). This is a planning signal, not a limit — the catch-up dollars still reduce your taxable income, but only in retirement. The other strategic lever is the mega backdoor Roth: if your plan allows after-tax contributions plus in-service conversions, you can move an additional $37,500 or more per year into Roth treatment, on top of the $24,500 elective deferral.
Beyond the basics: high-earner strategy
Once you have maxed your $24,500 elective deferral and captured the full employer match, two additional strategies become relevant for high-income W-2 workers: the mega backdoor Roth and the SECURE 2.0 age 60-63 super catch-up. Neither is universally available — both depend on your employer plan design — but together they can push your annual tax-advantaged retirement contribution well above the $36,400 baseline shown in the worked examples above.
One more high-earner lever: if you are above the $168,000 (single) or $252,000 (MFJ) direct Roth IRA phase-out, you can still fund a Roth IRA via the backdoor Roth strategy — a non-deductible $7,500 Traditional IRA contribution + immediate conversion. The catch is the IRC §408(d)(2) pro-rata rule: if you hold any other pre-tax Traditional, SEP, or SIMPLE IRA balance, the conversion is partially taxable. The fix is to roll pre-tax IRA money into your 401(k) before December 31 to clear the pro-rata trap. The Backdoor Roth IRA Calculator runs the full Form 8606 line-by-line calculation, shows the pro-rata basis ratio visually, and estimates the cleanout savings — the same pattern as this calculator.
The mega backdoor Roth: $37,500 of additional Roth room
The mega backdoor Roth uses the gap between your elective deferral ($24,500 in 2026) and the IRS Section 415(c) annual additions limit ($72,000 in 2026), per IRS Notice 2025-67 (2026 tax year) . After subtracting your $24,500 deferral and your employer's match (say $9,000), you have roughly $38,500 of room that can go into the after-tax (non-Roth) bucket of your 401(k) — provided your plan allows it. If the plan also supports in-plan Roth conversions or in-service withdrawals to a Roth IRA, you can convert those after-tax dollars to Roth treatment immediately, and all future growth is tax-free.
Vanguard's 2024 plan-year data shows that only a minority of plans offer the after-tax contribution feature — but for those that do, it is the single most powerful tax-advantaged savings tool available to W-2 workers. The catch is that you must verify two specific plan features: (1) the plan allows voluntary after-tax (non-Roth) employee contributions beyond the elective deferral cap, and (2) the plan allows in-plan Roth conversions or in-service distributions to a Roth IRA. Many large employer plans (Microsoft, Google, and most Fortune 500 tech companies) offer both. Most small-employer plans do not. Pull your Summary Plan Description or call your benefits team — the question to ask is: "Does the plan allow voluntary after-tax contributions with automatic in-plan Roth conversion?"
The mega backdoor Roth produces no additional federal tax savings in the year of contribution (the after-tax dollars are already post-tax), but the entire growth from that day forward is sheltered. For a 40-year-old earning $200,000 with a generous plan, moving $37,500 a year into Roth for 25 years at a 7% return produces roughly $2.6 million of tax-free retirement income — versus the same dollars in a taxable brokerage account, which would face capital gains tax on every dollar of growth.
Age 60-63: The 4-year super catch-up window
SECURE 2.0 created a special 4-year window where workers aged 60, 61, 62, and 63 can contribute an enhanced catch-up of $11,250 to their 401(k) — 40% higher than the standard age-50+ catch-up of $8,000. This is the highest contribution limit ever allowed to a 401(k), per IRS Notice 2026-05 (2026 tax year) . Over the full 4-year window (assuming you are 60 at the start), the cumulative enhanced catch-up potential is $45,000 — almost enough to fully fund a year of retirement for someone in their 60s.
The strategic implication: if you are approaching age 60 and have any flexibility in your cash flow, this is the single best year to max out retirement contributions. The enhanced catch-up also stacks with the mega backdoor Roth for workers whose plans support both, producing a one-time 4-year opportunity to push $11,250 + $37,500 = $48,750 per year into Roth treatment (subject to plan design).
Your HSA is not a checking account
The Health Savings Account is the only triple-tax-advantaged vehicle available to US workers: contributions are pre-tax, growth is tax-free, and qualified withdrawals for medical expenses are tax-free. Yet the 2025 EBRI Consumer Engagement in Health Care Survey found that EBRI CEHCS 2025 (2011-2024 (most recent data: 2024)) two-thirds of HSA holders use their account primarily to pay for current or near-term out-of-pocket health expenses — not as a long-term investment vehicle. Only about 30% of accountholders view their HSA primarily as an investment vehicle. This is a meaningful missed opportunity for retirement savers.
The math on treating your HSA as a retirement account is compelling. Devenir's 2025 year-end HSA market survey found Devenir HSA 2025 (Year ending December 31, 2025) that the average HSA balance is $4,170, but accounts holding investments averaged over $24,000 — nearly 6× higher — because invested accounts benefit from both larger contributions and market growth. Approximately $85 billion of the $174 billion total HSA market is held in investments, and that invested share is growing 33% year-over-year. The accounts driving that growth are the minority (about 10% of accounts), but they are setting the pace.
Fidelity's 2026 estimate of out-of-pocket healthcare costs in retirement is $172,500 for a single individual — and that excludes long-term care, which can add substantially more. A $50,000 HSA balance invested over 20 years at a 7% return becomes roughly $193,000 — enough to cover a single retiree's healthcare expenses with room to spare. The HSA is the only account type where the entire balance is available tax-free for this exact purpose. Treating it as a checking account leaves that tax-free compounding on the table.
Practical guidance: if you can afford to pay current medical expenses out of pocket and let your HSA balance grow, do so. Most HSA custodians (Fidelity, HealthEquity, HSA Bank, Optum Financial, WEX) allow you to invest your balance in low-cost index funds once it exceeds a threshold (often $1,000-$3,000). Set the auto-invest feature once, then leave the account alone for 20+ years. At retirement, you can use the HSA for any medical expense — Medicare premiums, long-term care insurance, dental, vision, prescription drugs — and the withdrawals remain tax-free.
Why this matters: most Americans don't feel on track
The 2026 EBRI Retirement Confidence Survey found that EBRI RCS 2026 only 64% of Americans (workers plus retirees) say they feel confident they have enough money to live comfortably throughout retirement — down six percentage points from 2025. Among current workers, 59% said healthcare costs are hurting their ability to save for retirement. The structural barrier is real: only about KFF 2026 HSA State of Union (2025 EHBS data (referenced in 2026 commentary)) 40% of employers offer an HSA-qualified health plan, meaning roughly 60% of workers cannot use the HSA-as-retirement strategy even when they want to. If you have access to one, you are starting from a position that 6 in 10 workers do not have.
Where you live changes the math: California HSA non-conformity
Most US states conform to federal HSA tax treatment — meaning HSA contributions, growth, and qualified withdrawals are all tax-free at both federal and state levels. Two states do not: California and New Jersey. The California Franchise Tax Board has not conformed to the federal HSA deduction since HSAs were created in 2003, meaning California residents must reverse every federal HSA tax benefit on their state return via Schedule CA. California bills SB 230 (2024) and AB 781 (pending in 2026 session) would have changed this, but neither has been signed into law as of August 2026.
The cost is real and quantifiable. A California resident in the 9.3% marginal bracket who contributes the full $8,750 family HSA limit in 2026 pays approximately $814 more in California state income tax than a resident of a conforming state. Over 30 years of contributions and compound growth, the cumulative California HSA tax burden can exceed $100,000 for a high earner who fully funds the family limit and lets the balance grow.
There are three practical responses for California HSA holders:
- Max the HSA anyway. The federal tax savings still work. California tax is added on top, but the federal benefit usually exceeds it. The math: a $4,400 self-only HSA contribution saves $1,078 in federal tax (24.5% effective rate) and costs $409 in California state tax (9.3% marginal) — a net savings of $669 per year.
- Track California basis separately. California already taxed your contributions and earnings going in, so it does not tax qualified withdrawals coming out. Maintain a California cost-basis ledger — most HSA custodians do not do this for you.
- Plan retirement in a no-income-tax state. If you are approaching retirement and have accumulated a substantial HSA balance, relocating to a state with no income tax (Texas, Florida, Nevada, Washington, Tennessee) eliminates California tax on future HSA earnings and qualified distributions. The trade-off: California capital gains on prior contributions are already locked in.
For the 48 states (plus D.C.) that conform to federal HSA treatment, none of this matters — HSAs are tax-free at the federal and state level for the entire life of the account. If you live in any other state, use the calculator as-is.