HSA in Retirement: The Ultimate Tax-Advantaged Strategy
Why an HSA Outperforms Every Other Account for Healthcare Costs — and How to Stack It With Your 401(k) and Roth IRA for Maximum Lifetime Tax Efficiency
Why an HSA Outperforms Every Other Account for Healthcare Costs — and How to Stack It With Your 401(k) and Roth IRA for Maximum Lifetime Tax Efficiency
Most FAANG engineers who have been contributing to an HSA for years think of it as a healthcare account — a place to park money for next year's medical expenses. That framing is costing them tens of thousands of dollars in lifetime tax savings.
An HSA is not a healthcare spending account. It is the most tax-efficient retirement vehicle ever created by the U.S. tax code, with a unique triple-tax advantage that no other account replicates: contributions reduce your federal taxable income, growth is permanently tax-free, and withdrawals for qualified medical expenses are never taxed. After age 65, the account gains a fourth dimension: the ability to pay Medicare premiums tax-free and to make non-medical withdrawals taxed as ordinary income — exactly like a traditional IRA — but with no required minimum distributions and no IRMAA impact.
A tech worker who maximizes HSA contributions from age 45 to 65 and invests the balance in a diversified index fund portfolio will accumulate, by conservative estimates, $250,000–$400,000 in a completely IRMAA-neutral, RMD-free, tax-free healthcare reserve. That capital can pay for every Medicare premium, dental bill, prescription, and long-term care expense they face in retirement — in tax-free dollars — while their taxable IRA distributions go toward everything else.
This guide covers the complete strategic picture: how to build an HSA balance worth having, how to stack it with your 401(k) and Roth IRA, how to coordinate it with Medicare and IRMAA, and the specific playbook for doing this as a California tech worker.
Why the HSA Triple-Tax Advantage Is Genuinely Unique
Every tax-advantaged account offers one or two of three possible tax benefits. The HSA offers all three simultaneously for healthcare expenses.
Contribution deduction. HSA contributions reduce your federal adjusted gross income in the year contributed — whether you contribute through payroll deduction (which also eliminates FICA taxes on that amount) or directly to your HSA custodian. The 2026 contribution limits are $4,400 for self-only HDHP coverage and $8,750 for family coverage, with an additional $1,000 catch-up contribution if you are 55 or older by year-end. See HSA Contribution Limits for the full mechanics and proration rules.
Tax-free growth. Dividends, interest, and capital gains inside your HSA are not taxable at the federal level — ever, regardless of how long they compound or how large the gains become. A $4,400 contribution invested in a total market index fund that compounds at 7% annually for 20 years grows to approximately $17,000 — all of it tax-free upon withdrawal for healthcare.
Tax-free withdrawals. When you withdraw HSA funds to reimburse qualified medical expenses — which include everything from prescriptions and dental work to Medicare premiums and long-term care insurance — no federal tax is owed. Not at contribution time, not during growth, and not at withdrawal. This is categorically different from a traditional IRA, where withdrawals are always taxable, and a Roth IRA, where contributions are after-tax but future medical withdrawals are treated the same as any other Roth withdrawal.
For a senior engineer at Apple or Google earning $400,000 in the 37% federal bracket, the contribution deduction alone on a family HSA is worth $3,237 in federal tax savings per year. Over 20 years of maximizing contributions, before investment growth, that is $64,750 in federal tax savings — plus the permanent tax-free compounding on top.
The California exception. California is one of only two states (along with New Jersey) that does not recognize HSA contributions as tax-deductible at the state level. HSA investment earnings are also taxable as ordinary income in California each year. This reduces — but does not eliminate — the HSA advantage for California residents. The federal deduction and permanently tax-free federal withdrawals remain fully intact, and the IRMAA neutrality of HSA withdrawals (covered in detail below) is worth substantial money to high-earning California retirees regardless of state tax treatment. The math still strongly favors maximizing your HSA if you live in California; the calculus is simply closer than it would be in a state with an income tax that conforms to federal HSA rules.
California practical warning: The most common mistake among California HSA holders is treating the account like a standard tax-deferred account and ignoring state tax obligations until retirement. California's Franchise Tax Board (FTB) requires you to report and pay state income tax on HSA investment earnings — dividends, interest, and capital gains — every year, not at the point of withdrawal. If you hold index funds inside your HSA and reinvest dividends, those dividends are taxable in California in the year received. Failing to report this annually can result in FTB penalties and interest. Keep records of your HSA's annual earnings (your custodian's year-end statement will show this) and include them on your California return each year.
The Stacking Strategy: HSA + 401(k) + Roth IRA
The most powerful version of HSA optimization is not using it in isolation — it is sequencing contributions across all three major tax-advantaged vehicles to minimize lifetime taxes. The right order depends on your employer's 401(k) match, your current tax bracket, and your projected retirement income.
Step 1: Capture the full 401(k) employer match first. This is always the highest-return first move. A dollar-for-dollar match is an immediate 100% return before any investment performance. Contribute enough to your 401(k) to capture every dollar your employer matches — this takes priority over everything else.
Step 2: Max your HSA before adding more to your 401(k). Once you have the full employer match, your next dollar of savings should go into the HSA rather than additional 401(k) pre-tax contributions. The reason is mathematical: both accounts provide a current-year deduction, but the HSA generates permanently tax-free growth and withdrawals for a predictable, guaranteed expense category (healthcare in retirement), while the 401(k) will eventually produce taxable RMDs that interact with Social Security taxation and IRMAA surcharges.
In 2026: contribute $8,750 (family) or $4,400 (self-only) to the HSA — $9,750 or $5,400 if you are 55 or older.
Step 3: Max your Roth IRA (or Roth 401(k)) for general tax diversification. Roth contributions do not reduce taxable income today but generate permanently tax-free withdrawals in retirement. For a tech worker likely to face high income in retirement from stock vesting, Social Security, and investment returns, tax diversification — having some money in pre-tax accounts, some in Roth, and some in the HSA — provides maximum flexibility to manage taxable income in any given retirement year.
Step 4: Fill the remainder of the 401(k) up to the federal limit. In 2026, the 401(k) deferral limit is $24,500, or $32,500 for those 50 and older ($35,750 at ages 60–63 under the SECURE 2.0 super catch-up of $11,250). After HSA and Roth contributions, any remaining savings capacity should go here.
Important for high earners — Roth catch-up requirement (2026). Beginning January 1, 2026, SECURE 2.0 mandates that employees age 50 and older who earned more than $150,000 in FICA wages in the prior year must make all catch-up contributions on a Roth (after-tax) basis. For a FAANG engineer earning $400,000–$530,000, this applies universally — the pre-tax catch-up deduction is no longer available. The upside: those catch-up dollars now grow and withdraw tax-free. The risk: if your employer's 401(k) plan does not offer a Roth feature, you will be unable to make catch-up contributions at all until the plan is amended. Verify your plan's Roth availability before relying on catch-up capacity in your 2026 savings plan.
Step 5: Taxable brokerage for everything above the tax-advantaged limits. A California FAANG engineer saving $150,000 per year will exhaust all tax-advantaged contribution room long before exhausting their savings capacity. The taxable brokerage fills the remainder, with long-term capital gains rates and tax-loss harvesting providing partial mitigation.
| Account | 2026 Limit (family) | Tax on contributions | Tax on growth | Tax on withdrawal |
|---|---|---|---|---|
| HSA | $8,750 (+$1,000 at 55+) | Deductible | Tax-free (federal) | Tax-free (medical) |
| 401(k) pre-tax | $24,500 employee deferral (+$8,000 at 50+); $72,000 combined with employer¹ | Deductible | Tax-deferred | Taxable (always) |
| Roth IRA | $7,500 (+$1,100 at 50+) | After-tax | Tax-free | Tax-free |
| Taxable brokerage | Unlimited | After-tax | Taxable annually | LTCG rate |
¹ The $72,000 combined limit (IRC §415) includes employee deferrals, employer match, profit-sharing, and after-tax contributions. With catch-up: $80,000 at 50+, up to $83,250 at ages 60–63. Relevant for FAANG employees with large employer match or Mega Backdoor Roth access.
The IRMAA Interaction: Why HSA Withdrawals Are Uniquely Valuable After 65
IRMAA — the Income-Related Monthly Adjustment Amount — is the Medicare surcharge that applies to Part B and Part D premiums when your Modified Adjusted Gross Income (MAGI) from two years prior exceeds certain thresholds. In 2026, IRMAA begins at $109,000 for individual filers and $218,000 for married filing jointly.
For a retired FAANG engineer managing a large traditional IRA or 401(k), every dollar of RMD or voluntary withdrawal adds to MAGI — potentially pushing Part B premiums from the standard $202.90/month up to $689.90/month per person at the highest IRMAA tier. A couple at the top tier pays $1,379.80/month just for Part B, before Part D, before Medigap. That is $16,557.60/year in Medicare premiums alone.
HSA withdrawals for qualified medical expenses — including Medicare premiums — do not appear in MAGI. They are not taxable income at the federal level and do not flow through Form 1040. This creates a compounding benefit that no other retirement account can match:
- You use tax-free dollars (from the HSA) to pay Medicare premiums instead of pre-tax IRA dollars
- The IRA withdrawal you avoid does not add to your MAGI
- Your MAGI stays lower, which keeps you in a lower IRMAA tier in subsequent years
- Lower IRMAA tier means lower Medicare premiums in the year after next
- The cycle continues: lower MAGI → lower IRMAA → lower premiums → lower MAGI
A couple managing their MAGI carefully near the first IRMAA threshold ($218,000 MFJ) who uses $24,480/year in HSA funds to cover Part B premiums (2 × $202.90 × 12 months) keeps $24,480 of IRA distributions out of their MAGI. At the 22% federal bracket, that represents $5,385 in annual federal tax savings — in addition to avoiding the IRMAA surcharge itself.
A Roth IRA withdrawal to pay the same Medicare premium is also federal-tax-free and equally MAGI-invisible for IRMAA purposes — qualified Roth withdrawals do not appear in MAGI. The HSA advantage over the Roth is therefore not at the withdrawal stage, but at contribution: HSA contributions are pre-tax (reducing your taxable income today), while Roth contributions are made with after-tax dollars. For a high-income earner in the 32–37% bracket, this upfront deduction represents thousands of dollars in annual federal tax savings that the Roth cannot provide.
See Using Your HSA After 65 for the specific rules on which Medicare premiums qualify, the 6-month retroactive Medicare enrollment trap, and how to avoid excess contribution penalties during the transition to Medicare.
HSA vs. Roth IRA: The Definitive Comparison for Healthcare Funding
This comparison comes up repeatedly in retirement planning discussions and is worth settling clearly. Both accounts offer tax-free growth and tax-free qualified withdrawals. For healthcare expenses specifically, the HSA wins on every dimension.
Current-year deduction. HSA contributions are deductible (pre-tax). Roth IRA contributions are after-tax. For a tech worker in the 32% or 37% federal bracket, this difference is substantial — a $4,400 HSA contribution costs $2,992–$2,772 in after-tax dollars, while a $7,500 Roth contribution costs $7,500.
MAGI treatment of withdrawals. HSA withdrawals for qualified medical expenses are MAGI-invisible — they do not appear on Form 1040 at all. Qualified Roth IRA withdrawals are also excluded from MAGI for IRMAA purposes and do not trigger surcharges. The HSA advantage over the Roth here is therefore not about IRMAA treatment of withdrawals — both are invisible — but about the upfront deduction: HSA contributions reduce your taxable income today, while Roth contributions are made with after-tax dollars. For a high-income tech worker in the 32–37% federal bracket, this current-year deduction makes the HSA strictly superior for dollars earmarked for healthcare costs.
Required minimum distributions. Traditional IRAs and 401(k)s are subject to RMDs beginning at age 73 (or 75 for those born in 1960 or later). Roth IRAs have no RMDs during the original owner's lifetime. HSAs also have no RMDs — and like Roth IRAs, the balance passes to beneficiaries, though spouses receive more favorable treatment than non-spouse beneficiaries.
Non-medical flexibility after 65. After age 65, HSA withdrawals for non-medical expenses are taxed as ordinary income with no penalty — identical to a traditional IRA. Roth IRA withdrawals after 59½ are always tax-free regardless of purpose. For non-medical spending, the Roth is superior. For medical spending, the HSA wins. The strategic implication: dedicate your HSA specifically to healthcare expenses in retirement and use Roth funds for everything else.
The practical conclusion: If you can fully fund both, fund both. If forced to prioritize, fund the HSA first for dollars earmarked for healthcare, and fund the Roth for general tax diversification. Never use the HSA as a substitute for the Roth when the funds will be needed for non-healthcare purposes.
The "Pay Out of Pocket, Reimburse Decades Later" Strategy
This is the most powerful HSA strategy available to a high-income earner in their 40s and 50s — and the least utilized.
The IRS places no time limit on when you must reimburse yourself from an HSA for a qualified medical expense. As long as the HSA account existed at the time the expense was incurred, and you have documentation (an Explanation of Benefits, a receipt, or a provider statement), you can reimburse yourself years or decades later.
A senior engineer at Microsoft who opens an HSA at age 43 and pays all medical expenses out-of-pocket — co-pays, deductibles, dental, prescriptions — for 22 years until age 65 accumulates a running total of unreimbursed qualified expenses. At a modest $3,000–$5,000 per year in out-of-pocket healthcare spending, that is $66,000–$110,000 in documented, reimbursable expenses. At age 65, she can withdraw that entire amount tax-free from her HSA — not as a distribution for current healthcare, but as reimbursement for past expenses that were never claimed.
The compounding effect: every dollar that was NOT withdrawn from the HSA during the working years continued compounding tax-free. The HSA balance at age 65 is dramatically larger than if she had used it to pay every expense along the way. And she still has the right to extract all of that capital tax-free at retirement.
Requirements for this strategy:
- The HSA must have been open at the time each expense was incurred
- You must have documentation for each expense (keep receipts and EOBs in a dedicated folder)
- Each expense must not have been previously reimbursed from any other tax-advantaged account
- The expenses must have been qualified medical expenses under the rules applicable at the time they were incurred
This strategy is most effective when combined with investment discipline — keeping the HSA fully invested in a low-cost index fund portfolio rather than holding it in cash.
How Much to Target in Your HSA by Retirement
Fidelity's annual estimate of average healthcare costs in retirement for a 65-year-old couple is approximately $300,000–$330,000 in 2026 dollars, covering Medicare premiums, supplemental insurance, out-of-pocket costs, and dental and vision — but excluding long-term care. This is the baseline target for an HSA retirement reserve.
For a California tech worker retiring at 65 with IRMAA surcharges on top of standard Medicare, the number is higher. A couple at the second IRMAA tier pays $405.80/month each for Part B alone in 2026, plus Part D surcharges, plus dental, vision, and out-of-pocket medical — a realistic total above $15,000–$20,000/year in healthcare premiums and expenses before any significant medical event.
A pragmatic target for the HSA: $300,000–$400,000 in real (inflation-adjusted) dollars by age 65. This is achievable with consistent maximization from the mid-40s.
| Starting age | Annual family contribution (2026 limit) | 7% growth to age 65 | Result |
|---|---|---|---|
| Age 40 | $8,750 | 25 years | ~$570,000 |
| Age 45 | $8,750 | 20 years | ~$380,000 |
| Age 50 | $9,750 (with catch-up at 55+) | 15 years | ~$240,000 |
| Age 55 | $9,750 | 10 years | ~$135,000 |
These projections assume full annual contributions, consistent index fund investing at a 7% nominal return, and no withdrawals during the accumulation phase. For someone who has been spending down their HSA annually on healthcare costs, the balances will be lower — but the strategic pivot to the "pay out of pocket" approach at any point in this range captures much of the long-term value.
The Sequence-of-Withdrawals Decision in Retirement
In retirement, the order in which you draw down different account types has a significant impact on your lifetime tax burden. The HSA belongs at a specific place in this sequence.
The general framework (subject to individual circumstances):
- Taxable brokerage account — draw down taxable accounts first in years when you have low income, taking advantage of the 0% long-term capital gains rate (available up to approximately $96,700 MFJ in 2026). This depletes the account with the least tax-sheltering and resets cost basis.
- HSA — for all qualified medical expenses — use HSA funds to pay Medicare premiums, dental, vision, prescriptions, and out-of-pocket medical costs throughout retirement. These withdrawals are tax-free and MAGI-invisible. Never pay a qualified medical expense from a taxable or IRA account as long as your HSA has funds.
- Traditional IRA / 401(k) — draw these down strategically through Roth conversions in the gap between retirement and RMD start age (73 or 75), and then via RMDs. The goal is to minimize the IRA balance at RMD start to reduce the forced income in later years. See How RMDs Affect Your Retirement Tax Rate for the full analysis of how RMD income stacks with Social Security, IRMAA, and NIIT.
- Roth IRA — last to touch. Roth funds have no RMDs, grow tax-free indefinitely, and produce no MAGI impact. They are the most efficient legacy asset and the best buffer for large unexpected expenses.
The critical rule: Always pay qualified medical expenses from the HSA first, never from the IRA. Every dollar of IRA money used for a medical expense is a taxable distribution that adds to MAGI. The same dollar from the HSA is tax-free and MAGI-neutral. The lifetime tax difference on this decision for a couple with $300,000 in cumulative healthcare costs in retirement can exceed $60,000–$80,000 in federal taxes depending on bracket and IRMAA situation.
For a complete breakdown of how each account type interacts in the withdrawal sequence, see Retirement Withdrawal Order: Which Accounts First.
The Roth Conversion Window and HSA Interaction
Between retirement and the start of RMDs (age 73 or 75), there is often a window of several years when income drops significantly — no W-2 income, Social Security not yet claimed, RMDs not yet required. This is the ideal time for Roth conversions: moving money from a traditional IRA to a Roth IRA and paying tax at today's lower rates to avoid higher taxes on RMDs later.
The HSA plays a direct role in this window. Roth conversions add to MAGI — they are ordinary income. If you are also managing IRMAA thresholds during this period, the HSA creates space: by covering all medical expenses from the HSA rather than the IRA, you free up MAGI headroom for larger Roth conversions without crossing into the next IRMAA tier.
Example: A 68-year-old retired Apple engineer manages her income carefully near the first IRMAA threshold ($109,000 single). She has $18,000 in annual healthcare expenses — Medicare premiums, dental, and prescriptions. If she pays those from an IRA, she needs $18,000 in additional distributions that consume her IRMAA headroom and are taxable. If she pays from the HSA, she preserves $18,000 in MAGI capacity for a Roth conversion — converting pre-tax IRA money to Roth at the 22% rate rather than letting it compound into a larger RMD taxed at 32% a decade later.
See Roth Conversion: When and How Much for the full conversion strategy and timing framework.
Step-by-Step Playbook: Ages 40–75
Ages 40–54: Accumulate aggressively
- Enroll in an HSA-eligible HDHP at open enrollment — prioritize this over a PPO if the premium savings and HSA contribution capacity are significant
- Contribute the maximum ($8,750 family / $4,400 self-only in 2026) every year without exception
- Invest the entire HSA balance in a diversified low-cost index fund — not a money market fund
- Pay all medical expenses out of pocket; keep receipts and EOBs in a dedicated folder or digital archive
- Do not reimburse yourself — let the balance compound
Ages 55–64: Maximize the catch-up
- Add the $1,000 catch-up contribution — in 2026, $9,750 family or $5,400 self-only
- Continue investing; resist the temptation to use the HSA as a healthcare debit card
- Start accumulating your reimbursable expense total — run a rough calculation of undocumented expenses going back to when the HSA opened
- Stop HSA contributions approximately 6 months before you plan to apply for Medicare to avoid the retroactive Part A enrollment trap (see Using Your HSA After 65 for the exact mechanics)
Ages 65–72: Deploy strategically
- Begin using HSA funds to pay Medicare Part B, Part D, and Medicare Advantage premiums — these are qualified expenses and tax-free
- Do not pay medical expenses from the IRA if your HSA has funds
- Optionally, reimburse yourself for accumulated past expenses — this converts the HSA balance to tax-free cash while preserving MAGI neutrality
- Coordinate with Roth conversions: use HSA for all healthcare costs to maximize the MAGI space available for Roth conversions before RMDs begin
Ages 73+: Integrate with RMD management
- RMDs from traditional accounts create mandatory taxable income — structure HSA withdrawals to offset the IRMAA impact
- Continue paying all qualified medical expenses from the HSA; never pay a medical bill from the IRA while the HSA has funds
- If the HSA balance exceeds projected lifetime healthcare needs, it can be used for non-medical withdrawals at ordinary income rates — identical to IRA treatment but without RMD requirements
California Note: The Math Still Works
California's non-conformity to federal HSA rules reduces the net advantage but does not eliminate the strategic case for maximizing HSA contributions. Here is the California-specific accounting for a resident in the 9.3% state bracket:
What California taxes:
- HSA contributions are not deductible on the California state return — no state tax savings at contribution
- HSA investment earnings (dividends, capital gains) are taxable as California ordinary income each year
- Qualified HSA withdrawals are tax-free federally but the earnings portion may have already been taxed at the state level during accumulation
What California does not change:
- The full federal deduction on contributions (worth $1,628 annually at the 37% bracket on a $4,400 contribution)
- The permanent federal tax-free growth and withdrawal treatment
- The IRMAA invisibility of HSA withdrawals — a California resident managing IRMAA saves identically to a resident of any other state
- The no-RMD treatment of HSA balances
Rough California adjustment: The annual California state tax drag on HSA earnings at a 7% return on a $100,000 balance is approximately $651/year (9.3% × $7,000 in earnings). This is real cost, but it is significantly outweighed by the federal benefits on a fully invested account over a 20-year horizon.
The net conclusion for California: the HSA is still the best account for healthcare expenses in retirement. The gap relative to a no-state-tax state is real but not decision-changing at the contribution maximization level.
Common Mistakes to Avoid
Treating the HSA as a healthcare debit card. Using HSA funds to pay every routine medical expense defeats the compounding strategy entirely. The goal is to build a retirement reserve, not to get a tax discount on this year's co-pays.
Investing the HSA in a money market or stable value fund. An HSA invested in cash is a wasted opportunity. A $50,000 HSA balance in a money market earning 4% versus the same balance in a total market index fund at 7% long-term is a difference of approximately $37,000 over 15 years — all of which is tax-free.
Missing the 6-month Medicare lookback. Contributing to an HSA in the 6 months before Medicare enrollment triggers an excess contribution penalty. Stop contributions well before applying for Medicare, not just before your 65th birthday. See Using Your HSA After 65.
Not keeping receipts. The delayed reimbursement strategy requires documentation. An IRS audit of a large HSA withdrawal decades after the expense was incurred requires proof. Keep every EOB, receipt, and provider statement — digitally is fine.
Paying medical expenses from the IRA when the HSA has funds. This is the most expensive mistake in retirement. Every dollar of IRA money spent on a medical bill was a taxable distribution. The same expense from the HSA was free. The difference is the marginal tax rate plus potential IRMAA consequences.
Forgetting employer contributions count toward the limit. If your employer adds $1,000 to your HSA, your maximum personal contribution for 2026 drops from $4,400 to $3,400 (self-only). Exceeding the total combined limit triggers a 6% excise tax. Always check your employer's HSA contribution before setting your payroll election.
This article is for educational purposes only and does not constitute tax, legal, or financial advice. HSA rules, contribution limits, and Medicare regulations change annually. State tax treatment varies. Always consult a financial advisor or tax professional before making decisions about your HSA strategy, Medicare enrollment timing, or retirement account withdrawals.
See How Your HSA Fits Into Your Full Retirement Plan
Nauma models your HSA balance, projected healthcare costs, Medicare premiums, IRMAA thresholds, and retirement account withdrawals together — so you can see exactly how much your HSA is worth in lifetime tax savings and what sequence of withdrawals minimizes your total tax burden.
Get Started for Free