HSA vs Brokerage: Which Should You Invest In?

If you're trying to build wealth and have access to both an HSA and a regular brokerage account, you've probably wondered: which one should I prioritize?
The short answer is almost always the HSA - but like everything in personal finance, there's nuance. Let's break down exactly why the HSA is so powerful and when a brokerage account might actually be the better choice.
The Triple Tax Advantage Explained
The HSA (Health Savings Account) is often called the most tax-advantaged account in existence. Here's why:
- Tax-deductible contributions - Money goes in pre-tax, reducing your taxable income
- Tax-free growth - No taxes on dividends, interest, or capital gains while invested
- Tax-free withdrawals - Pay $0 in taxes when used for qualified medical expenses
No other account offers all three benefits. A traditional 401(k) gives you #1 and #2, but you pay taxes on withdrawals. A Roth IRA gives you #2 and #3, but contributions aren't deductible. The HSA is the only account that can be completely tax-free from start to finish.
See the Difference Yourself
Want to see exactly how much the tax advantage is worth? Use our calculator below to compare an HSA to a brokerage account with your own numbers.
Triple Tax Advantage Breakdown
Avoided 27% income tax on $88,000.00 contributed
Avoid annual tax drag from dividends and rebalancing (not quantified)
No 15% capital gains tax on $105,006.78 in growth when used for medical expenses
Important Notes
- • HSA contribution limits for 2026: $4,400 (individual) / $8,750 (family)
- • Non-qualified withdrawals before 65 incur 20% penalty + income tax
- • After 65, non-qualified withdrawals are taxed as income (no penalty)
- • Must have a High Deductible Health Plan (HDHP) to contribute
You can also explore the full HSA Calculator page for more details on how the math works.
The Math: HSA vs Brokerage
Let's walk through a concrete example. Say you have $4,400 (the 2026 individual HSA limit) to invest each year for 20 years, assuming a 7% annual return.
Brokerage Account Path
With a brokerage account, taxes hit you at multiple points:
| Step | What Happens | Amount |
|---|---|---|
| Earn income | You earn $4,400 | $4,400 |
| Pay income tax | Taxed at 27% marginal rate | -$1,188 |
| Amount invested | What actually goes into the account | $3,212 |
| After 20 years | Grows at 7% annually | $12,428 |
| Capital gains tax | 15% on ~$9,216 gain | -$1,382 |
| Final value | What you actually keep | $11,046 |
HSA Path
With an HSA, taxes are avoided entirely:
| Step | What Happens | Amount |
|---|---|---|
| Earn income | You earn $4,400 | $4,400 |
| Pay income tax | $0 - contributions are pre-tax | $0 |
| Amount invested | Full amount goes in | $4,400 |
| After 20 years | Grows at 7% annually | $17,018 |
| Withdrawal tax | $0 - qualified medical expenses | $0 |
| Final value | What you actually keep | $17,018 |
That's a 54% difference - from the exact same starting income. Over a full career of maxing out your HSA, this difference compounds to hundreds of thousands of dollars.
When to Prioritize the HSA
The HSA should typically come first in your investment priority order if:
You're eligible. You must be enrolled in a High Deductible Health Plan (HDHP) and not covered by Medicare or claimed as a dependent.
You can afford to pay medical expenses out of pocket. The optimal HSA strategy is to pay current medical bills from your checking account and let your HSA investments grow. You can reimburse yourself later - there's no time limit.
You want maximum tax efficiency. If tax optimization is important to you (especially for those pursuing FIRE), the HSA is unmatched.
The Ideal Priority Order
For most people, this is the optimal order for investing:
- 401(k) up to employer match - Free money
- HSA to the max - Best tax treatment available
- 401(k) or Roth IRA to the max - Depends on your tax situation
- Brokerage account - After tax-advantaged space is full
When the Brokerage Account Wins
Despite the HSA's advantages, there are real situations where a brokerage account makes more sense:
You're not eligible for an HSA
If you don't have a High Deductible Health Plan, you simply can't contribute to an HSA. In this case, the brokerage account is your flexible, accessible option for investing beyond retirement accounts.
You need liquidity before age 65
HSA withdrawals for non-medical expenses before age 65 incur income tax PLUS a 20% penalty. If you might need access to this money for non-medical reasons before 65, a brokerage account offers more flexibility.
You've already maxed everything else
If you're maxing your 401(k), HSA, and IRA, the brokerage account is where the rest goes. There are no contribution limits, and you have full flexibility on withdrawals.
You have very low medical expenses
If you're young and healthy with minimal medical costs, you might not accumulate enough medical receipts to withdraw your HSA tax-free. That said, after 65, the HSA becomes essentially a traditional IRA (taxed as income, no penalty), so this is a minor concern.
The HSA as a Stealth Retirement Account
Here's a strategy many people miss: use your HSA as a long-term retirement account.
The approach:
- Pay all current medical expenses out of pocket
- Keep every receipt (digitally is fine)
- Let your HSA investments compound for decades
- Reimburse yourself in retirement for all those past expenses - tax free
There's no time limit on reimbursement. A medical expense from 2026 can be reimbursed from your HSA in 2050 - after 24 years of tax-free growth.
Example timeline:
- Age 30: Pay $2,000 dental bill out of pocket, keep receipt
- Age 30-55: HSA investments grow tax-free
- Age 55: That $2,000 receipt is now worth ~$10,000+ of tax-free withdrawals
Even if you run out of receipts, after age 65 you can withdraw for any purpose (just pay income tax, no penalty). It essentially becomes a traditional IRA with a medical expense bonus.
2026 HSA Contribution Limits
Make sure you're maximizing your contributions if eligible:
| Coverage Type | Under 55 | 55 and Older |
|---|---|---|
| Individual | $4,400 | $5,400 |
| Family | $8,750 | $9,750 |
The extra $1,000 for those 55 and older is called the "catch-up contribution."
Common Questions
Can I have both an HSA and a brokerage account?
Absolutely. Most people building wealth have multiple account types. The question is just which to prioritize when you have limited dollars to invest.
What if my employer doesn't offer an HSA?
You can open one yourself through providers like Fidelity or Lively, as long as you have a qualifying HDHP. You'll contribute with after-tax dollars but can deduct them on your tax return.
Should I invest my HSA or keep it in cash?
If you have enough cash elsewhere to cover potential medical expenses, invest your HSA for long-term growth. Many HSA providers offer the same index funds available in 401(k)s and IRAs.
What counts as a qualified medical expense?
Most medical, dental, and vision costs qualify: doctor visits, prescriptions, glasses, dental work, and more. The IRS maintains a full list in Publication 502.
The Bottom Line
For most people eligible for an HSA, it should be a top priority - right after capturing any 401(k) employer match. The triple tax advantage creates a significant wealth-building edge that no other account can match.
The brokerage account remains essential for its flexibility and lack of contribution limits, but it shouldn't compete with the HSA for your first investment dollars.
Use our HSA Calculator to see exactly how much the tax savings are worth in your specific situation. The numbers might surprise you.
Personal finance is personal
Your situation may differ. If you're not eligible for an HSA, or if you need more liquidity, the brokerage account might be the right choice. But if you can use an HSA and you're not maxing it out, you're leaving real money on the table.

Written by
Caleb ElliottSoftware engineer and personal finance writer documenting my own FIRE journey. I save ~50% of my income and build the tools I wish existed to help others reach financial independence faster.
Learn more →