26 U.S.C. § 223 / IRS Pub 969

401(k) vs HSA: where the HSA fits in the priority stack

The HSA is the only triple-tax-advantaged account in the US tax code (per 26 U.S.C. section 223 and IRS Publication 969). Most personal-finance authorities place it second in the contribution priority order, after the 401(k) match and before the Roth IRA top-up. Here is why the order works, what the 2026 limits are, and how the HSA interacts with the 401(k) decision.

Authority feed: Figures sourced from IRS Publication 575, IRS Publication 590-A, and IRS Notice 2025-67. Last verified 2026-05-27; next IRS COLA notice expected 2026-11-11. Full methodology and source ledger.
The full priority stack

Where every dollar goes, in order

Each rung is grounded in its statutory authority and the rationale for its placement.

#Account2026 capStatuteWhy this position
1401(k) employer matchPlan-specific26 U.S.C. § 401(k); ERISA § 20350-100% guaranteed return on contribution. Vesting under ERISA § 203 caps the cliff at three years.
2HSA (if HDHP-eligible)$4,300 self / $8,550 family26 U.S.C. § 223Only triple-tax-advantaged account: deductible in, tax-free growth, tax-free out for qualified medical.
3Roth IRA$7,500 ($8,600 at 50+)26 U.S.C. § 408A(c)(2)Tax-free growth, no lifetime RMDs per § 408A(c)(5), contributions accessible any time per Pub 590-B ordering rules.
4401(k) to § 402(g) cap$24,50026 U.S.C. § 402(g)Pre-tax shelter for current marginal-rate dollars. Reduces current taxable income.
5Mega backdoor Roth (if plan permits)Up to § 415(c) headroom26 U.S.C. § 415(c); § 402A(g) (SECURE 2.0 § 604); IRS Notice 2014-54Voluntary after-tax 401(k) contributions then Roth conversion. Up to ~$39,500 of additional Roth space.
6Taxable brokerageNo cap26 U.S.C. § 1(h)Long-term capital gains rates (0/15/20%); step-up at death; full flexibility on withdrawal.

See HSAvsHRA.com for the full HSA-vs-HRA-vs-FSA comparison. See 529PlanCalculator.com for what comes after retirement is funded (college savings + SECURE 2.0 § 126 529-to-Roth rollover).

2026 HSA limits

Per IRS Revenue Procedure + IRS Pub 969

The HSA limits are published by IRS Revenue Procedure (typically in May of the prior year), separate from the 401(k) COLA notice. Confirm against IRS Publication 969.

Self-only HSA contribution
$4,300
26 U.S.C. § 223(b)(2)(A); up from $4,150 in 2025
Family HSA contribution
$8,550
26 U.S.C. § 223(b)(2)(B); up from $8,300 in 2025
HSA catch-up at 55+
$1,000
26 U.S.C. § 223(b)(3); not indexed for inflation
The triple-tax mechanic

Why the HSA beats the Roth IRA on tax efficiency

Both wrappers are powerful. The HSA wins on the deduction side; the Roth IRA wins on flexibility (no qualified-medical restriction).

HSA (26 U.S.C. § 223)

Deductible in / tax-free growth / tax-free out (qualified)

  • Above-the-line deduction per § 223(a) (no itemisation required)
  • Tax-free growth while in the account
  • Tax-free distribution for qualified medical (§ 223(f)(1))
  • After age 65: penalty-free non-medical distributions (taxed as ordinary income, just like a Traditional IRA)
Roth IRA (26 U.S.C. § 408A)

After-tax in / tax-free growth / tax-free out (qualified)

  • No deduction on contribution (after-tax dollars)
  • Tax-free growth and qualified withdrawals at 59-1/2 + 5-year rule per § 408A(d)(2)
  • Contributions withdrawable any time per Pub 590-B ordering rules
  • No lifetime RMDs per § 408A(c)(5)
  • Wider purpose (any spending, not just medical)
The HSA-as-stealth-retirement-account hack

Pay medical bills out-of-pocket; let the HSA compound

The often-overlooked HSA strategy: don't reimburse yourself for medical expenses now. Save the receipts, let the HSA balance compound tax-free for decades, then reimburse yourself in retirement using the receipts (any age, any time, no statute of limitations on reimbursement under IRS Pub 969).

Example. You incur $10,000 of qualified medical expenses in your 30s and pay them out-of-pocket. Save the receipts. The $10,000 stays invested in your HSA at 7% for 30 years, compounding to roughly $76,000 tax-free under 26 U.S.C. § 223. At age 65 you withdraw the $10,000 reimbursement (tax-free, because the qualified-medical expense actually happened) and the remaining $66,000 in tax-free growth either: (a) pays new medical expenses tax-free under § 223(f)(1), or (b) gets withdrawn after 65 for any purpose, taxed as ordinary income like a Traditional IRA. There is no IRS deadline on reimbursing yourself per IRS Pub 969 'Distributions From an HSA'.

Frequently asked

HSA priority questions

Why is the HSA triple-tax-advantaged?+

Per 26 U.S.C. section 223 and IRS Publication 969: (1) contributions are deductible above-the-line under section 223(a) regardless of itemisation, (2) growth is tax-free inside the account, and (3) withdrawals for qualified medical expenses (defined at 26 U.S.C. section 213(d)) are tax-free under section 223(f)(1). No other US tax-advantaged account hits all three. The 401(k) is double-advantaged (deductible in, taxed out); the Roth IRA is double-advantaged (taxed in, free out).

Where does the HSA fit in the contribution order?+

Most personal-finance authorities place the HSA second in the priority stack: (1) 401(k) up to the full employer match (50-100% guaranteed return), (2) HSA if you have a qualifying HDHP, (3) Roth IRA up to $7,500 per IRS Notice 2025-67, (4) 401(k) back up to the $24,500 § 402(g) cap, (5) mega backdoor Roth if available, (6) taxable brokerage. The HSA earns its #2 slot because of the triple-tax advantage; the match earns #1 because of the guaranteed return.

What are the 2026 HSA limits?+

Per the IRS Revenue Procedure setting HSA limits (typically Rev. Proc. 2025-XX, published May 2025) and IRS Publication 969: self-only HSA contribution limit is $4,300 in 2026 (up from $4,150); family limit is $8,550 (up from $8,300). Catch-up at 55+ is $1,000 (not indexed, fixed under 26 U.S.C. section 223(b)(3)). The HDHP minimum deductible and maximum out-of-pocket are also set annually by the same Rev. Proc.

Can I have an HSA and a 401(k) at the same time?+

Yes. The HSA contribution limit (26 U.S.C. section 223(b)) is independent of the 401(k) employee deferral limit (26 U.S.C. section 402(g)) and the Roth IRA limit (26 U.S.C. section 408A(c)(2)). The only restriction on HSA eligibility is being enrolled in a qualifying High-Deductible Health Plan and having no other disqualifying coverage (per 26 U.S.C. section 223(c) and IRS Pub 969).

Why not put the HSA before the 401(k) match?+

The 401(k) match is a guaranteed 50-100% return (instant on contribution; vesting clock per ERISA section 203). The HSA's triple-tax advantage is structurally durable but does not match the day-one return of an employer match. So: match always first, then HSA, then Roth IRA. If your employer does not offer a 401(k) match, the HSA moves to #1 in the priority stack.

What if I am not on an HDHP?+

You cannot contribute to an HSA without qualifying HDHP coverage (per 26 U.S.C. section 223(c)(1)). Without HSA access, the priority order collapses to (1) 401(k) match, (2) Roth IRA, (3) 401(k) top-up. The HSA is a powerful but conditional tool. Some employers offer both an HDHP and a traditional PPO; the HDHP-with-HSA combination is usually preferable for healthy participants with capacity to absorb a higher deductible.