Using an HSA as a Retirement Account, Not Just for Bills
If you're on a high-deductible plan and can pay medical bills from cash, investing your HSA instead of spending it can build a tax-sheltered pot for later. Here's who it suits, who it doesn't, and how to project the difference.
Drafted with AI; reviewed by Haroon Ahmad on . How we work.

If you're covered by a high-deductible health plan and can pay this year's medical bills from your checking account, you can leave the money in your health savings account (HSA) invested for decades instead of spending it. That turns the HSA into a second retirement account with tax breaks no other account matches. This guide is for workers who already have an HSA and are deciding whether to spend it each year or invest it, and it covers who qualifies, how the tax treatment works, a 20-year projection you can rerun with your own numbers, and the situations where spending the balance is the smarter move.
Who can contribute to an HSA
An HSA is a savings account tied to a specific kind of health insurance. You can only put money in during months when you meet the eligibility rules, which the IRS sets out in IRS Publication 969 on health savings accounts. In broad terms, you need to be covered by a high-deductible health plan (HDHP), not have other health coverage that disqualifies you, not be enrolled in Medicare, and not be someone who can be claimed as a dependent on another person's tax return. Publication 969 also defines what counts as an HDHP and lists the kinds of other coverage that are allowed alongside it.
The same publication gives the annual contribution limits. For 2026, it states you can contribute up to $4,400 with self-only HDHP coverage or up to $8,750 with family coverage, and the limit rises by $1,000 if you are 55 or older at the end of your tax year. The limits change most years, so check the current figures in Publication 969 before you set your payroll deduction.
Two features make long-term investing possible at all. Unused money rolls over from year to year rather than being forfeited, and the account belongs to you, so it stays with you when you change jobs or leave your employer's health plan. Losing HDHP coverage stops new contributions, but it doesn't take away what's already there.
How the three tax breaks work
People call the HSA "triple tax-advantaged" because the money avoids federal income tax at three points:
- Going in. Contributions are either made before tax through payroll or deducted on your return if you contribute on your own.
- While it grows. Interest, dividends and investment gains inside the account aren't taxed each year.
- Coming out for medical costs. Withdrawals used for qualified medical expenses are tax-free, per Publication 969.
A traditional 401(k) or IRA gives you the first two but taxes withdrawals. A Roth gives you the last two but taxes the money going in. The HSA is the only common account that offers all three, but only when the money is spent on qualified medical care. Use it for anything else before 65 and you owe income tax plus an additional tax, which is why the strategy below depends on medical spending, now or later. A few states don't follow the federal treatment, so check how your state handles HSA contributions and earnings.
Worked example: spending versus investing over 20 years
Here's an illustrative comparison. Two people each contribute $4,400 a year to an HSA (the 2026 self-only maximum, held flat for simplicity) and each has $3,000 a year of medical costs.
- The spender pays the $3,000 from the HSA each year. The remaining $1,400 sits in the account's cash option, which we'll assume earns nothing.
- The investor pays the $3,000 from their own cash, keeps every receipt, and invests the full $4,400 at a hypothetical 6% a year, compounded annually with contributions at year end.
| Year | Total contributed | Spender's balance (cash, 0%) | Investor's balance (6%) | Investor's saved receipts |
|---|---|---|---|---|
| 5 | $22,000 | $7,000 | $24,803 | $15,000 |
| 10 | $44,000 | $14,000 | $57,996 | $30,000 |
| 15 | $66,000 | $21,000 | $102,414 | $45,000 |
| 20 | $88,000 | $28,000 | $161,857 | $60,000 |
The investor's year-20 figure comes from the future-value formula for regular contributions: $4,400 × ((1.0620 − 1) ÷ 0.06). Since 1.06 to the 20th power is about 3.2071, that's $4,400 × 36.7856, or about $161,857. Of that, $88,000 (20 × $4,400) is contributions and $73,857 is growth.
The spender's balance is simpler: $1,400 left over each year × 20 years = $28,000.
Now level the playing field. The investor paid $60,000 (20 × $3,000) out of pocket, but holds receipts for all of it and can reimburse themselves that $60,000 tax-free. After doing so, $101,857 ($161,857 − $60,000) remains in the account. Against the spender's $28,000, that's $73,857 more, which is exactly the investment growth. The strategy's payoff is that growth, sheltered from tax.
To test your own numbers, plug your contribution, years and an assumed return into the compound interest calculator on Investor.gov, which the SEC runs for free. Its results may differ slightly from the table depending on the compounding and timing settings you choose. Try a lower return, such as a hypothetical 4%, to see a cautious case.
What the comparison leaves out
The example flatters the investor in some ways and understates them in others. The spender had $3,000 a year in their pocket that the investor didn't; if the spender invested it in a regular brokerage account, it would grow too, though dividends and gains there are taxed. Inflation also matters: reimbursing a $3,000 bill from year one in year 20 returns $3,000 of today's money in much less valuable future dollars, so old receipts lose real value the longer you hold them. Investment returns aren't guaranteed, and a market drop just before you need the money can shrink the balance. Finally, many HSA providers charge account or fund fees, which reduce the 6% you'd actually keep.
Keeping receipts so you can reimburse yourself later
Publication 969 describes tax-free distributions to pay for or reimburse qualified medical expenses incurred after you set up the HSA, and it sets out which expenses qualify. It doesn't require you to reimburse yourself in the same year as the bill, which is what lets the investor wait. The catch is proof: if the IRS ever asks, you need to show the expense was qualified, happened after the account was opened, and wasn't reimbursed by insurance or deducted elsewhere.
A simple system that holds up over decades:
- Keep one spreadsheet. Columns for date of service, provider, patient, amount you paid, how you paid, the matching file name, and a "reimbursed" date left blank until you use it.
- Save two documents per expense. The itemized receipt and the insurer's explanation of benefits, which shows what insurance paid and what you owed.
- Name files consistently. For example, date, provider and amount, so the spreadsheet row and the file match at a glance.
- Store copies in two places. A cloud folder and an external drive, because thermal-paper pharmacy receipts fade within a few years.
- Total it once a year. A running tally tells you how much you could withdraw tax-free at any moment, which doubles as a backup emergency source.
When you reimburse, take the exact total of the receipts you're claiming and mark each row with the date. Never claim the same receipt twice.
Where the HSA fits among your other accounts
The HSA competes for the same dollars as your other retirement accounts. A common ordering is: hold cash for your deductible and emergencies first, then contribute enough to your 401(k) to get any employer match (the reasoning is covered in this guide to maximizing 401(k) growth), then fund the HSA, then an IRA. We'd put the HSA ahead of the IRA for most eligible people, because qualified withdrawals are tax-free in both directions. For scale, the IRS states that 2026 contributions to all traditional and Roth IRAs can't exceed $7,500 ($8,600 if you're 50 or older), or your taxable compensation if that's less.
The cash you use to pay medical bills out of pocket belongs somewhere safe and accessible, such as a high-yield savings account, not invested. The CFPB's guide to building an emergency fund suggests sizing it by the unexpected expenses you've actually had and what they cost, and recommends automatic recurring transfers from checking to savings. For an HDHP household, your annual out-of-pocket maximum is a sensible number to work toward.
Inside the HSA itself, most providers require a minimum cash balance before you can invest the rest, and offer a menu of mutual funds. If your employer's provider has high fees or a thin fund list, many people move older balances to another HSA provider while keeping payroll contributions where they are.
What changes at 65 and when Medicare starts
Turning 65 loosens the withdrawal rules. Under Publication 969, money taken out for qualified medical expenses is still tax-free, and withdrawals for anything else are taxed as ordinary income but no longer face the additional tax that applies before 65. At that point a non-medical withdrawal is treated much like one from a traditional IRA, while medical withdrawals stay better. Publication 969 also explains which insurance premiums can be paid tax-free from the account, including some Medicare premiums.
Medicare enrollment is a separate trigger. Once you're enrolled, you can no longer contribute, even if you're still working and on an HDHP, though you can keep spending and investing the existing balance. Enrollment can happen automatically in some situations, such as when you already receive Social Security benefits, so confirm your Medicare start date before deciding when to stop contributing. If you work past 65 and delay Medicare while staying on an HDHP, you may still be eligible to contribute.
Retirement is also when a decade or two of saved receipts pays off. Healthcare costs tend to rise with age, so an invested HSA plus a folder of old receipts gives you a tax-free pool to draw from in the years when other income is being taxed.
When investing the HSA is the wrong call
Spend the HSA, at least for now, if any of these apply:
- You can't cover your deductible from cash. Running up a medical bill or a credit card balance to keep an HSA invested costs more in interest than the account is likely to earn.
- Your medical costs regularly exceed your contributions. If you drain the account each year anyway, there's nothing left to compound.
- Your horizon is short. If you expect to need the money within a few years, keep it in cash rather than exposing it to a market drop.
- You won't keep records. Without receipts, delayed reimbursements are hard to prove, and you lose the main reason for paying out of pocket.
- The fees eat the growth. A flat monthly fee on a small balance can outweigh the returns until the account grows or you move it.
If you're not on an HSA-eligible plan, are already enrolled in Medicare, or are struggling to meet medical bills, the priority is paying for care today. For everyone else, the decision turns on your tax bracket, other savings and expected health costs; a fee-only financial planner or tax professional can run the comparison with your own figures if the trade-offs aren't clear.









