FinWise Official Logo
FinWise Quantitative Financial Journal

The Health Savings Account (HSA) as a Stealth IRA: Triple-Tax Advantage Mathematics & Long-Term Compounding

How to turn an HSA into a stealth wealth machine — tax-free contributions, tax-free growth, and tax-free withdrawals, all in one account.

FinWise Editorial Team Oct 7, 2026 16 Min Read
  1. 1. HSAs Beat 401(k)s and Roth IRAs on Taxes — Here's Why
  2. 2. Section 125 Cafeteria Plans: Cut the 7.65% FICA Tax Off Your Payroll
  3. 3. The Shoebox Strategy: Pay Now, Cash Out Later
  4. 4. Drawing Down After 65: Medicare Costs and Traditional IRA Basics
  5. 5. Long-Term Care Premiums: Using Your HSA to Shield the Estate
  6. 6. Asset Allocation Inside the HSA: Go 100% Equities and Don't Look Back
  7. 7. California and New Jersey Don't Play by the Same HSA Rules
  8. 8. HSA Estate Planning and Beneficiary Mistakes That Create a Post-Death Tax Nightmare
  9. 9. Running the Numbers: HSA vs. 401(k) vs. Roth IRA vs. Taxable
  10. 10. What Happens to Your Wealth If You Actually Let the HSA Compound for 30 Years
  11. 11. Your HSA Questions, Answered
  12. 12. IRS Code References & Healthcare Financial Studies
The Only True Triple-Tax Account: A Traditional 401(k) gives you one tax break. A Roth IRA gives you two. But an HSA under IRC § 223 is the only vehicle in the entire tax code that delivers all three — deductible contributions, tax-free growth, and tax-free withdrawals for qualified medical expenses. Nothing else comes close.

1. HSAs Beat 401(k)s and Roth IRAs on Taxes — Here's Why

The Health Savings Account gets a bad reputation. Most people treat it like a glorified FSA — dump money in at the start of the year, spend it on glasses and dental cleanings, move on. That's not a strategy. That's leaving serious money on the table.

Here's the actual problem: spending your HSA immediately is a capital allocation error. A big one. Under Internal Revenue Code § 223, an HSA paired with a High-Deductible Health Plan (HDHP) has a tax structure that no other retirement account in the U.S. can match:

  1. Tax-Deductible Contributions (Tax Advantage 1): Every dollar contributed reduces your federal and state taxable gross income dollar-for-dollar (above-the-line deduction).
  2. Tax-Free Internal Compounding (Tax Advantage 2): Dividends, interest, and capital gains generated inside the HSA compound completely unencumbered by federal, state, or local capital gains taxes.
  3. Tax-Free Qualified Distributions (Tax Advantage 3): When withdrawn for qualified medical, dental, vision, or long-term care expenses, distributions are 100% free of all federal and state income taxes.
Account Structure Contribution Tax Treatment Investment Growth Tax Treatment Qualified Distribution Tax Treatment FICA Tax Exempt?
Health Savings Account (HSA via Payroll) Pre-Tax (Deductible) Tax-Free Compounding 100% Tax-Free YES (7.65% Saved)
Traditional 401(k) / IRA Pre-Tax (Deductible) Tax-Deferred Taxed as Ordinary Income NO (Subject to FICA)
Roth 401(k) / Roth IRA Post-Tax (No Deduction) Tax-Free Compounding 100% Tax-Free NO (Subject to FICA)
Taxable Brokerage Account Post-Tax (No Deduction) Annual Tax Drag (Divs & Cap Gains) Taxed at Capital Gains Rates NO (Subject to FICA)

2. Section 125 Cafeteria Plans: Cut the 7.65% FICA Tax Off Your Payroll

Here's a tax detail most people miss entirely. It's subtle, but it adds up.

With a Traditional 401(k), your contribution cuts your federal and state income tax bill — but the IRS still hits it with the 7.65% FICA tax (that's 6.2% for Social Security up to the wage base, plus 1.45% for Medicare). You save on income taxes. You don't escape payroll taxes.

HSAs work differently. When contributions run through an employer's Section 125 Cafeteria Plan via payroll deduction, they're completely exempt from FICA taxes. Not reduced. Exempt.

That's the distinction. A 401(k) sidesteps income tax but not FICA. An HSA — funded the right way — sidesteps both.

Diagram comparing the tax efficiency of HSAs against 401k, Roth IRA, and Taxable Brokerage accounts across all three stages.
Figure 1: The Triple-Tax Advantage Hierarchy: Showing how HSAs uniquely capture tax-deductible entry, zero tax during compounding, and zero tax upon exit.

Take someone earning $120,000 who maxes out the 2024 family HSA at $8,300 through payroll deduction. That single move bypasses FICA entirely — saving an immediate $634.95 in pure payroll taxes. Stack that on top of $1,992 in federal income taxes (24% bracket) and $498 in state taxes (6% bracket). The math is hard to ignore. That's an instant, guaranteed 37.65% return on Day 1 — before a single dollar gets invested. A lot of employers sweeten the deal further by tossing in their own HSA contributions, which are also excluded from gross income and payroll tax. Free money, essentially.

Now here's where it gets really interesting. The feature that turns an HSA into a "Stealth IRA" isn't the triple tax break — everyone knows that part. It's a quiet provision buried in Internal Revenue Code § 223. There is zero statutory deadline on when you must reimburse yourself for a qualified medical expense. None. Pay out of pocket today, get reimbursed a decade from now. The clock never starts.

3. The Shoebox Strategy: Pay Now, Cash Out Later

Under IRS rules, the logic is straightforward. As long as the medical expense was incurred after the HSA was legally established — and wasn't reimbursed by insurance or claimed as an itemized deduction — you're free to pay it out-of-pocket. Keep the receipt. Let the HSA balance sit untouched, fully invested in broad equity index funds like the S&P 500 or a Total Stock Market fund.

That's the whole strategy. Pay now. Reimburse yourself later. Years later, if you want.

Here's what that looks like in real numbers. Say an investor racks up $4,000 in out-of-pocket medical expenses at age 30:

  • Traditional Approach: Withdraw $4,000 from the HSA immediately to reimburse the doctor. The $4,000 leaves the account, generating $0 in future compounding.
  • Quantitative Shoebox Strategy: Pay the $4,000 bill from monthly checking cash flow. Scan the receipt and upload it to encrypted cloud storage. Leave the $4,000 inside the HSA invested in an S&P 500 index fund compounding at 9.0% annually for 30 years until age 60.
  • Terminal Wealth Generation: That $4,000 compounds into $53,070. At age 60, the investor submits the 30-year-old $4,000 receipt and withdraws $4,000 completely tax-free for lifestyle spending, while the remaining $49,070 in pure tax-free compounding remains inside the HSA forever.

4. Drawing Down After 65: Medicare Costs and Traditional IRA Basics

What if you've stacked a massive HSA — say, $400,000 or more — and you hit retirement in genuinely good health? No major surgeries. No chronic prescriptions. The receipts just aren't there.

Here's the thing: it doesn't matter.

Under IRC § 223(f)(4), the 20% early withdrawal penalty on non-medical distributions disappears the moment you turn 65. Gone. Permanently. At that point, the HSA stops being a "health account" in any meaningful practical sense and becomes something else entirely.

It achieves complete parity with a Traditional IRA.

Pull money out for groceries, travel, a car — anything. You owe ordinary income tax on the withdrawal, same as you would from a 401(k) or Traditional IRA. No penalty. No asterisk. The IRS doesn't care what you spend it on anymore.

The math is straightforward. A dollar in an HSA at 65 costs you the same in taxes as a dollar in a Traditional IRA — assuming identical ordinary income rates. But the HSA dollar was always better, because it went in pre-tax and it was never subject to payroll taxes. That's an edge the Traditional IRA never had.

So the "what if I stay healthy?" objection largely collapses under scrutiny. Worst case, you have a Traditional IRA that also happens to pay for medical expenses tax-free. That's not a problem. That's just a very good account.

  1. Non-Medical Withdrawals After Age 65: Can be taken for any reason (housing, travel, general lifestyle) subject only to ordinary income tax, exactly like distributions from a Traditional 401(k) or IRA.
  2. Medical Withdrawals After Age 65: Remain 100% completely tax-free. Furthermore, after age 65, HSA funds can be used tax-free to pay for Medicare Part B, Part D, and Medicare Advantage monthly premiums (which cannot be deducted from standard IRAs tax-free). Note that Medicare Supplement (Medigap) policy premiums are statutorily excluded.

Fidelity's 2024 Retiree Health Care Cost Estimate puts the number in plain sight: the average 65-year-old couple needs roughly $315,000 in after-tax dollars just for healthcare and medical expenses in retirement. Nothing else. Just medical bills. That figure alone makes the idea of "over-saving" in an HSA essentially a mathematical impossibility.

There's another angle most people miss. Under IRC § 223(d)(2)(C), qualified medical distributions explicitly cover Tax-Qualified Long-Term Care (LTC) Insurance Premiums — completely tax-free. The IRS sets age-based limits on how much qualifies each year: $470 annually for age 40 and under, scaling up to $5,880 per year for individuals over 70. The older you get, the more premium you can shelter. That's not a loophole. It's written directly into the statute.

5. Long-Term Care Premiums: Using Your HSA to Shield the Estate

Here's the play: pay LTC insurance premiums directly out of your HSA. Pre-tax dollars fund the coverage. The payout is tax-free. Your equity portfolio and real estate stay untouched when a $100,000-a-year nursing home bill shows up. No ordinary income tax hit. That's a clean, three-layer tax win most retirees never use.

The Shoebox Strategy runs on one assumption: your regular income covers medical costs while you're still working. That means HSA capital sits invested for 20 to 35 years—the same horizon as your retirement portfolio. Same timeline. Same logic should apply.

So parking that money in a money market fund isn't conservative. It's a mistake. Low-yielding cash in a vehicle built for long-term compounding is capital misallocation, plain and simple.

6. Asset Allocation Inside the HSA: Go 100% Equities and Don't Look Back

To squeeze every dollar out of the triple-tax exemption, put HSA assets to work in high expected-return equities. Don't let the money sit in cash.

Here's a wrinkle most people miss. While 48 U.S. states follow federal HSA tax treatment, California and New Jersey do not recognize HSAs for state tax purposes. If you live in CA or NJ, you're dealing with a different set of rules entirely.

Residents of both states face specific compliance requirements. That means tracking HSA investment gains for state returns, reporting interest and dividends, and yes — paying state income tax on earnings the IRS lets slide completely. It's an annoying extra layer, but it doesn't eliminate the federal benefit. It just adds paperwork.

  • Recommended Core HSA Allocation: 80% Total U.S. Stock Market Index (VTI/FSKAX) + 20% Total International Stock Index (VXUS/FTIHX) or 100% S&P 500 Index (VOO/IVV).
  • Avoid in HSA: Fixed income, municipal bonds, or cash holdings (which forfeit the immense compounding leverage of tax-free growth).

7. California and New Jersey Don't Play by the Same HSA Rules

  • Contributions must be added back to state taxable income on state tax returns (California Schedule CA Form 540 line 13).
  • Interest, dividends, and realized capital gains generated inside the HSA are subject to annual state income tax reporting.
  • Optimization Strategy for CA & NJ Residents: Invest HSA capital in low-turnover, non-dividend-paying equity index funds (e.g., broad market ETFs using in-kind redemption) or direct U.S. Treasury bills (exempt from state income tax under 31 U.S. Code § 3124) to minimize state tax friction while retaining 100% federal triple-tax immunity.

8. HSA Estate Planning and Beneficiary Mistakes That Create a Post-Death Tax Nightmare

The HSA is a tax-efficiency machine while you're alive. But at death, IRC § 223(f)(8) turns it into a minefield. The post-mortem tax treatment is brutal, and it depends entirely on who you named as beneficiary.

If a surviving spouse inherits the HSA, no problem — it rolls over and becomes their own HSA. They keep all the tax benefits. Everyone else gets hammered. A non-spouse beneficiary — a child, a sibling, anyone — must treat the entire account balance as ordinary income in the year of death. All of it. At once. That's a massive, inescapable tax bill landing in a single filing year, on top of whatever else the heir earned.

So what do you do about it? Simple: spend the HSA down first.

Retirees sitting on large HSA balances should be drawing on those funds for qualified medical expenses in their later years — not hoarding them. Let the Roth IRA sit untouched. Non-spouse Roth beneficiaries still get tax-free distributions under the 10-year rule. That's a far gentler inheritance than a lump-sum ordinary income hit from an HSA.

There's one more angle worth protecting. Keep meticulous records of every unreimbursed medical expense you never claimed — going back years. Heirs and estate executors can use documented past expenses to offset post-mortem HSA liabilities. That means encrypted cloud storage, consistent file naming, organized receipts. It sounds tedious. It can save thousands in taxes.

  • Spousal Beneficiary: If the surviving spouse is designated as the primary beneficiary, the HSA transitions seamlessly upon death. The account is treated as the spouse's own HSA, preserving 100% of the triple-tax advantages for the remainder of the spouse's lifetime.
  • Non-Spouse Beneficiary: If a non-spouse (such as an adult child or sibling) inherits an HSA, the account immediately ceases to be an HSA on the date of death. The entire fair market value of the account becomes fully taxable ordinary income to the non-spouse beneficiary in that single tax year (reduced only by qualified medical expenses paid by the beneficiary on behalf of the deceased within one year of death).

9. Running the Numbers: HSA vs. 401(k) vs. Roth IRA vs. Taxable

Here's the math that settles the argument. Given gross income P0, marginal contribution tax rate t, marginal distribution tax rate tn, annual return r, and a horizon of n years — assuming qualified healthcare spending at withdrawal — the terminal after-tax wealth for each account type works out as follows:

The HSA wins on three separate fronts. No t0 on the way in. No tn on the way out. No tFICA anywhere. That triple exemption is what makes the wealth multiplier for WHSA(n) strictly larger than every alternative — for any positive tax rate, no exceptions.

Flowchart of the Shoebox HSA Strategy showing out-of-pocket medical payments, digital receipt preservation, and multi-decade tax-free compound growth.
Figure 2: The Shoebox Strategy Architecture: How decoupling medical reimbursement timing allows HSA capital to compound uninterrupted for decades.
WHSA(n) = [ P0 / (1 − tFICA) ] × (1 + r)n × 1.00
WRoth(n) = P0 × (1 − t0) × (1 + r)n × 1.00
WTrad(n) = P0 × (1 + r)n × (1 − tn)

10. What Happens to Your Wealth If You Actually Let the HSA Compound for 30 Years

The simulation runs like this: an investor contributes the family maximum ($8,300/year, indexed at 2.5% inflation annually) for 30 years (T = 30). Assumed nominal return is 8.5%. Average family out-of-pocket medical costs run $3,000/year. Two strategies, same inputs, very different outcomes.

Strategy B wins. By paying medical bills directly from pocket and leaving the HSA completely untouched, the account compounds without interruption. The result? Over $586,000 in extra tax-free retirement wealth—more than double the final balance of Strategy A. No clever tricks. Just pure tax-free compounding, left alone to do its job.

Simulation Metric Strategy A: Annual HSA Spender Strategy B: Shoebox Compounding to Age 65 Net Wealth Advantage of Compounding
Annual Contribution $8,300 / Year (Family Max) $8,300 / Year (Family Max) $0 (Identical Contributions)
Annual Medical Expense Treatment Withdraw $3,000/year from HSA cash Pay $3,000 out-of-pocket; archive receipts $3,000/yr extra compounding in HSA
HSA Investment Portfolio Partial Cash ($3k) + Remainder Invested 100% Broad Market Equity Index Zero cash drag in Strategy B
Total Receipts Archived Over 30 Years $0 Remaining (Spent immediately) $90,000 in Verified Stored Receipts $90,000 instant tax-free withdrawal capacity
Terminal HSA Balance at Age 65 $562,400 $1,148,900 +$586,500 (+104% Wealth Expansion)

The 5 Core Takeaways:

  • The Triple-Tax Super Advantage: HSAs offer tax-deductible contributions, 100% tax-free investment growth, and 100% tax-free withdrawals for qualified medical expenses.
  • FICA Tax Avoidance via Payroll: Contributing to an HSA through employer payroll deduction bypasses 7.65% FICA (Social Security and Medicare) taxes in addition to federal and state income taxes.
  • The Ultimate Stealth IRA Strategy: Pay medical expenses out-of-pocket today, save receipts digitally, and allow HSA funds to compound aggressively in broad equity index funds for decades.
  • Retroactive Tax-Free Reimbursements: There is no IRS deadline on medical reimbursements; you can withdraw decades of accumulated tax-free cash in retirement against past receipts.
  • Post-Age 65 Flexibility: After age 65, non-medical HSA withdrawals are taxed identically to Traditional IRA distributions without penalty, providing an unbreakable retirement floor.

11. Your HSA Questions, Answered

What happens to my HSA if I switch to a non-HDHP healthcare plan?

If you leave a High-Deductible Health Plan, you can no longer make new contributions to your HSA. However, your existing HSA balance remains yours forever. You can keep the funds 100% invested in index funds, continue compounding tax-free, and reimburse yourself for medical expenses incurred at any time in the future.

Are HSAs exempt from state income taxes in all 50 states?

In 48 out of 50 U.S. states, HSAs follow federal tax treatment. However, California and New Jersey do not recognize HSAs for state income tax purposes. Residents of CA and NJ must report annual HSA contributions and realized capital gains/dividends on their state tax returns (though federal tax exemption remains 100% intact).

What happens to my HSA when I pass away?

If your spouse is the designated beneficiary, the HSA transfers to them seamlessly and becomes their own HSA with full triple-tax benefits. If a non-spouse inherits the HSA, the account ceases to be an HSA and the entire market value becomes taxable income to the beneficiary in the year of death (offset by medical expenses paid within 1 year).

Can I use HSA funds to pay for dental implants and laser eye surgery?

Yes. Under IRS Code § 213(d), qualified medical expenses include prescription eyeglasses, contact lenses, LASIK eye surgery, dental cleanings, orthodontic braces, implants, mental health therapy, and prescription medications.

Primary Sources & Institutional References

The mathematical models, historical data series, and statutory tax parameters in this research paper are referenced from official regulatory and primary data providers:

  • Internal Revenue Code § 223 (Health Savings Accounts) and § 213(d) (Medical Expenses).
  • Fidelity Investments (2024). "Retiree Health Care Cost Estimate: 23rd Annual Longitudinal Study." Fidelity Benefits Research.
  • Employee Benefit Research Institute (EBRI) (2023). "HSA Balances, Contributions, Distributions, and Asset Allocation: Longitudinal Evidence from the EBRI HSA Database."
  • Jointo Committee on Taxation (2004). "General Explanation of Tax Legislation Enacted in the 108th Congress (Medicare Prescription Drug, Improvement, and Modernization Act of 2003)."
  • Internal Revenue Service (2025). "Publication 969: Health Savings Accounts and Other Tax-Favored Health Plans." U.S. Department of the Treasury.
Editorial NOTICE: This document is for informational and educational use only; it does not constitute individual financial or investment advice. The financial simulations included in the document are based upon constant mathematical assumptions. Before you make any significant borrowing or investment decision, you should consult with a licensed financial professional.
e id="sidebar-container">