How does an HSA work?
Last updated August 2026
Short answer
Most people treat an HSA as a way to pay this year's medical bills with pre-tax money, which works but wastes most of what the account can do. Used differently, it is arguably the most tax-efficient investment account available.
The triple tax advantage, stated plainly
Every other account gives you two of three breaks. An HSA gives all three:
Going in. Contributions are deductible, or come straight out of payroll pre-tax, which also avoids payroll taxes.
While invested. Dividends, interest and gains are never taxed year to year.
Coming out. Withdrawals for qualified medical expenses are entirely tax free, at any age.
A traditional 401(k) taxes the withdrawal. A Roth IRA taxes the contribution. A taxable brokerage account taxes the growth. The HSA is the only one that skips all three, which is why it is worth funding before almost anything except a full employer match.
It is an investment account, not a debit card
This is the part most people miss. HSAs typically hold cash by default, often earning close to nothing, and many providers require a minimum balance before investing is enabled.
If you can pay routine medical costs from ordinary income, leaving the HSA to compound turns it into a long-horizon investment account with better tax treatment than your 401(k). The trade-off is real, because money spent on today's bills is money that stops growing.
Receipt banking: the deferred reimbursement trick
There is no deadline for reimbursing yourself. If you pay a $2,000 medical bill out of pocket in 2026 and keep the receipt, you can reimburse yourself from the HSA in 2046, tax free, as long as the expense was incurred after the account was opened.
That means twenty years of untaxed growth on money you could have withdrawn immediately, and then a tax-free withdrawal at the end. It requires keeping records for decades, which is the entire cost.
What happens at 65
Before 65, a non-medical withdrawal is taxed as income and penalized 20%, which is double the 401(k) penalty and a real deterrent.
At 65 the penalty disappears. Non-medical withdrawals become ordinary income, exactly like a traditional IRA, while medical withdrawals remain tax free. In effect the account turns into a traditional IRA with a tax-free medical option layered on top.
One rule to know at that point: once you enroll in Medicare you can no longer contribute, though you can still spend the balance. People planning to work past 65 often need to stop contributions several months before enrolling, because Medicare Part A can be backdated.
What counts as a qualified medical expense
Broader than most people assume. Deductibles, copays, prescriptions, dental, vision, mental health care, physical therapy, and many over-the-counter items all qualify. Insurance premiums generally do not, with exceptions including COBRA, long-term care premiums and, once you are on Medicare, most Medicare premiums.
IRS Publication 502 has the authoritative list, and it is worth reading once because the boundaries are not obvious.
Try it in Walnut
Once your HSA is invested at a brokerage, Walnut can read those holdings alongside your other accounts so the allocation is visible in one place instead of sitting in a separate portal you never open.
The catch
You can only contribute while covered by a qualifying high-deductible health plan, and that plan is not right for everyone. Someone with high, predictable medical costs may be better off with richer coverage even after accounting for the tax break. The account is excellent; the insurance requirement attached to it is a genuine trade-off, covered on the HSA eligibility rules page.
Sources
2026 contribution and plan limits are from IRS Revenue Procedure 2025-19. Account rules are in IRS Publication 969, and qualified expenses in Publication 502. Walnut is informational and is not an investment adviser. This guide is educational and not personalized tax or investment advice; anything with a tax consequence is worth confirming with a tax professional.
FAQ
How does an HSA work?
+
You must be covered by a qualifying high-deductible health plan. Contributions are deductible or come out of payroll pre-tax, the balance can be invested and grows untaxed, and withdrawals for qualified medical expenses are tax free. Unused money rolls over every year and the account belongs to you, not your employer.
What is the triple tax advantage?
+
Three separate breaks in one account: contributions reduce your taxable income, growth is never taxed year to year, and qualified medical withdrawals are tax free. No other US account does all three. A 401(k) taxes the withdrawal, a Roth taxes the contribution, and a taxable account taxes the growth.
What happens to my HSA at 65?
+
The 20% penalty on non-medical withdrawals disappears. From 65 you can withdraw for anything and simply pay ordinary income tax, exactly like a traditional IRA, while medical withdrawals stay completely tax free. That is why an HSA is often described as the best retirement account most people are not using.
Do I lose my HSA if I change jobs?
+
No. Unlike an FSA, an HSA is yours. It moves with you between jobs, and the balance carries over indefinitely. You can only keep contributing while covered by a qualifying high-deductible plan, but the existing balance stays yours and invested regardless.