Editorial process
Tax deep dive

What Is an HSA? How Health Savings Accounts Invest

This explainer covers what an HSA is, the triple tax advantage behind it, how to invest the balance instead of leaving it as cash, and what changes at 65.

Short answer: An HSA, or health savings account, is a tax-advantaged account tied to a qualifying high-deductible health plan. Money goes in pre-tax, grows without being taxed, and comes out tax-free for qualified medical expenses, which is why it is sometimes called the only account with a genuine triple tax advantage. The part most people miss is that the balance can usually be invested in funds rather than left sitting in cash, and unlike a flexible spending account, nothing is forfeited at year end.

A clear glass dome covering a short stack of coins and a stack of folded white papers on a wooden table, set against a softly blurred green background
What's in this deep dive
  1. What an HSA actually is
  2. The eligibility rule: a qualifying high-deductible health plan
  3. The triple tax advantage, broken down
  4. HSA vs FSA: why they are not the same account
  5. How much you can contribute, and the catch-up at 55
  6. Does HSA money just sit in cash, or can you invest it?
  7. A worked example: investing instead of spending
  8. What counts as a qualified medical expense
  9. The shoebox strategy: paying cash now, reimbursing yourself later
  10. What changes at age 65
  11. HSA vs 401(k) vs Roth IRA: where it fits in the stacking order
  12. What happens to an HSA when you change jobs or lose coverage
  13. What happens to an HSA when you die
  14. The investment menu and the fee drag
  15. Common mistakes
  16. Who should not prioritize an HSA
  17. How an HSA interacts with Medicare
  18. A few HSA numbers worth confirming yourself
  19. The bottom line

Short answer: An HSA, or health savings account, is a tax-advantaged account tied to a qualifying high-deductible health plan. Money goes in pre-tax, grows without being taxed, and comes out tax-free for qualified medical expenses, which is why it is sometimes called the only account with a genuine triple tax advantage. The part most people miss is that the balance can usually be invested in funds rather than left sitting in cash, and unlike a flexible spending account, nothing is forfeited at year end.

An HSA gets introduced to most people as a place to park money for doctor visits and prescriptions, and then it quietly sits there as cash, earning close to nothing, while the real feature of the account goes unused. The real feature is that an HSA is structured more like a retirement account than a spending account: contributions reduce taxable income, the balance can be invested and grows without annual taxation, and withdrawals for qualified medical expenses are never taxed. No other account commonly available to employees stacks all three breaks on the same dollar.

This explainer works through what an HSA actually is and who can use one, the eligibility rule tied to a high-deductible health plan, the triple tax advantage broken into its three separate pieces, how an HSA differs from a flexible spending account, how much you can contribute and the catch-up amount once you turn 55, whether your balance is actually invested or just sitting in cash, a worked example comparing an invested HSA against a taxable account and a traditional 401(k), what counts as a qualified medical expense, the deliberate strategy of paying bills out of pocket so the account keeps compounding, what changes once you turn 65, and where the account fits alongside a 401(k) and a Roth IRA. Bring your own contribution and timeline to the companion below or the calculator as you read. Every dollar figure here is illustrative arithmetic, general information and education rather than advice, and nothing below is a recommendation to open or fund any specific account.

Key takeaways

  • An HSA offers three separate tax breaks on the same dollar: a tax-advantaged contribution, tax-free growth, and tax-free withdrawals for qualified medical expenses, a combination no ordinary retirement account matches.
  • Unlike a flexible spending account, an HSA has no use it or lose it deadline. The balance carries forward indefinitely and can be invested, not just left as cash.
  • Most providers only invest the balance above a set cash threshold, so an HSA left on autopilot often sits entirely in cash earning little, missing the account's main advantage.
  • In an illustrative 20-year example, an HSA used for medical expenses compounds to about $73,800 against roughly $57,600 after tax in a comparable traditional 401(k) and roughly $66,200 in a taxable brokerage account carrying ordinary tax drag.
  • Before 65, a non-medical withdrawal generally faces both ordinary income tax and a penalty. After 65, the penalty disappears and a non-medical withdrawal is simply taxed like an ordinary retirement distribution. This is general information, not personalized tax advice.

What an HSA actually is

A health savings account is a tax-advantaged account that an eligible individual opens, usually through a bank, brokerage or an employer’s chosen provider, to pay for qualified medical expenses. The account is owned by the individual, not the employer, even when payroll makes the contributions, which matters later when a job changes. Money placed into the account can be used immediately for an eligible expense, left to sit, or in most cases invested in a menu of funds, and whatever is not spent simply remains the account holder’s money indefinitely.

What makes an HSA worth a dedicated explainer rather than a footnote in a benefits packet is the tax treatment layered onto it. A dollar earned, taxed as income, then spent on a medical bill from an ordinary checking account has already been taxed once before it ever reaches the pharmacy counter. A dollar routed through an HSA first is generally never taxed at all, provided it is eventually used for a qualified expense. That difference, repeated across years of contributions, is the entire reason financially literate savers treat an HSA as a priority account rather than an afterthought.

A man in a tan sweater sitting at a kitchen table, holding a printed page and looking at it while a laptop sits open in front of him, with a notebook, pen and a mug nearby
Comparing a printed statement against the numbers on a screen is the moment an HSA decision actually gets made: pay the bill out of pocket now, or let the invested balance keep compounding and reimburse yourself later.

An HSA is not available to everyone. Eligibility is tied to enrollment in a specific type of health plan, and that eligibility rule is worth understanding before anything else about contribution limits or investing, because it determines whether the account is even an option for a given year.

The eligibility rule: a qualifying high-deductible health plan

To contribute to an HSA, you generally need to be enrolled in a qualifying high-deductible health plan, often abbreviated HDHP, and have no disqualifying other coverage, such as being claimed as a dependent on someone else’s return or being enrolled in Medicare. A high-deductible health plan is defined by minimum deductible and maximum out-of-pocket thresholds set by the IRS, which are adjusted periodically. Those exact dollar thresholds change often enough that stating a specific figure here would likely be stale by the time you read it, so confirm the current minimum deductible and maximum out-of-pocket limits directly with the IRS or your plan documents before assuming a plan qualifies.

The practical trade-off behind an HDHP is familiar to anyone who has compared health plans during open enrollment: a lower monthly premium in exchange for a higher deductible, meaning you pay more out of pocket before insurance coverage for non-preventive care begins in earnest. The HSA is the government’s way of softening that trade-off, letting you set aside tax-advantaged money specifically to cover the higher deductible, which is part of why the two are bundled together by law rather than offered separately.

Not every high-deductible-sounding plan actually qualifies as an HSA-eligible HDHP; the IRS definition is specific about deductible minimums, out-of-pocket maximums and what the plan is allowed to cover before the deductible is met. Your plan’s own documentation, or your HR benefits summary, will state directly whether the plan is HSA-eligible. If you are unsure, that confirmation is worth getting before contributing, since contributing to an HSA while not actually eligible can create a tax problem that is more annoying to unwind than it was to avoid in the first place.

The triple tax advantage, broken down

The phrase “triple tax advantage” gets used often enough that it is worth unpacking into its three actual pieces rather than treating it as marketing language. The first break applies to money going in: contributions made through payroll are typically made pre-tax, reducing taxable income immediately, while contributions made directly to the account are generally deductible when you file, producing the same effect through a different mechanism. Either way, the government is not taxing the dollars before they enter the account.

The second break applies to the balance while it sits in the account. Interest, dividends and capital gains generated inside an HSA are not reported on your tax return the way they would be in an ordinary taxable brokerage account. A taxable account holder pays tax on dividends the year they are paid and on realized gains the year a position is sold, which is a quiet, recurring drag on compounding. An HSA simply skips that drag entirely, year after year, for as long as the money stays invested inside the account.

The third break applies to money coming out, and it is the one that makes the first two breaks permanent rather than deferred. A withdrawal used for a qualified medical expense is not taxed at all, at any age. Compare that to a traditional 401(k), where the contribution and the growth are both untaxed going in and along the way, but the withdrawal is fully taxed as ordinary income. An HSA used as intended never faces that final tax bill on the medical-expense portion, which is the structural reason it can out-compound a traditional retirement account dollar for dollar when the money is genuinely used for healthcare.

Illustrative value after 20 years of $1,800 a year at an assumed 7% return, by account type

Same annual contribution, same assumed return, three different tax treatments at the end. HSA assumes the balance is used for qualified medical expenses. Bar width scales to the largest figure. Invented arithmetic, no specific account.

HSA (used for medical expenses)$73,800
Taxable brokerage account$66,200
Traditional 401(k), taxed at exit$57,600

Illustrative arithmetic: $1,800 a year for 20 years at 7% grows to about $73,800. The taxable account assumes a one-point annual tax drag from dividends and realized gains, reaching about $66,200. The traditional 401(k) assumes the same pre-tax growth, taxed at an illustrative 22% ordinary rate on withdrawal, leaving about $57,600.

HSA vs FSA: why they are not the same account

An HSA and a flexible spending account, or FSA, both let an employee set aside money before tax for medical costs, and the similarity ends about there. The defining feature of most FSAs is a use it or lose it rule: money not spent by the end of the plan year, sometimes with a small carryover amount or a short grace period allowed, is generally forfeited back to the employer. That design pushes FSA holders to estimate their medical spending carefully and often to spend down a remaining balance on anything eligible before the deadline, which is the opposite behavior an HSA rewards.

An HSA has no such deadline. A balance left untouched does not expire, does not get forfeited, and does not need to be spent by any particular date. It simply remains the account holder’s money, continuing to grow if invested, for as long as they choose not to withdraw it. That single structural difference is why an FSA functions as a short-term budgeting tool for predictable medical costs, while an HSA functions as a long-term, portable account that can realistically be used as a secondary retirement vehicle.

The two also differ on portability and eligibility. An FSA is generally tied to your employer and does not travel with you if you leave the job, while an HSA belongs to you regardless of who you work for, and it keeps existing, keeps being investable, and keeps growing after you change employers or stop working altogether. An FSA does not require a high-deductible health plan to participate, while an HSA strictly does. Some employers offer a limited-purpose FSA that can be paired with an HSA for dental and vision expenses specifically, which is a detail worth asking your benefits administrator about rather than assuming either way.

How much you can contribute, and the catch-up at 55

The IRS sets an annual HSA contribution limit, with a higher limit for family coverage than for self-only coverage, and both figures are adjusted most years. Those specific dollar limits are exactly the kind of time-sensitive figure this explainer will not state as a fixed number, since a hardcoded figure here would likely be wrong within a year; confirm the current limit directly from the IRS or your plan provider before setting a contribution amount. What stays stable is the structure: one combined limit based on your coverage tier, inclusive of both your own contributions and anything your employer contributes on your behalf.

Once you turn 55, the IRS allows an additional catch-up contribution on top of the standard limit, similar in spirit to the 401(k) and IRA catch-up provisions, though the dollar amount and the mechanics differ from those accounts. If you are married and both spouses are 55 or older and HSA-eligible, the catch-up generally needs to be contributed to each spouse’s own HSA rather than combined into one account, which is a detail that trips people up when they assume the family limit works like a single shared bucket the way an IRA’s combined limit does.

Contributions can come from multiple sources in the same year: payroll deductions, direct contributions you make yourself, and employer contributions, all counting toward the same annual cap. Overcontributing triggers an excise tax on the excess amount unless it is corrected before the tax filing deadline, which mirrors how excess IRA contributions are handled. If your employer and your own direct contributions might together approach the limit, it is worth tracking the running total yourself rather than assuming payroll software will catch it, since not every system cross-checks contributions made outside of payroll.

Does HSA money just sit in cash, or can you invest it?

This is the single most consequential question an HSA holder can ask, and most never ask it. The default experience at most providers is a cash sweep account, similar to a basic savings account, paying a modest interest rate. For a balance used to pay medical bills as they arrive, cash makes sense; you do not want money earmarked for next month’s prescription sitting in the stock market. But a balance meant to sit for years, uninterrupted, is a very different situation, and leaving it entirely in cash forfeits most of the account’s long-term advantage.

Most HSA providers that offer investing require the cash balance to clear a threshold, often somewhere in the low thousands of dollars, before anything above that line can be moved into investments. The investable portion is typically offered through a menu of mutual funds, index funds among them, not unlike a 401(k) lineup, sometimes through a linked brokerage account with a wider selection. The specific menu, fees and minimum threshold vary meaningfully by provider, and if your employer’s chosen HSA provider has a weak, expensive fund lineup, some account holders roll the balance to a provider of their own choosing once they are no longer required to use the employer’s default, similar in spirit to rolling an old 401(k) into an IRA after leaving a job.

Three stacks of coins of increasing height arranged left to right on a light wooden surface, against a softly blurred background
The difference between an HSA left in cash and an HSA invested for years is exactly this: small, steady stacks versus a stack that keeps growing because it was never cashed out along the way.

The reason this matters so much is time horizon. Someone in their thirties contributing to an HSA with no near-term plan to spend it has decades for invested money to compound tax-free, which is the scenario where the triple tax advantage does the most work. Someone paying ongoing medical costs out of the account month to month has a much shorter horizon for any given dollar, and cash is the more sensible home for that portion. The honest answer is that many HSA holders should be doing both: enough cash to cover near-term expected costs, and the rest invested, rather than treating the whole balance as either entirely spendable or entirely untouchable.

A worked example: investing instead of spending

Take an illustrative saver contributing $1,800 a year, about $150 a month, to an HSA, investing the full balance above the cash threshold in a diversified fund assumed to return 7 percent annually, and never touching the account for 20 years because they pay medical costs out of pocket in the meantime and keep the receipts. By year 20, the account has grown to roughly $73,800. Of that balance, about $36,000 is the saver’s own contributions and about $37,800 is investment growth the account never had to pay tax on, year after year, as it accumulated.

Illustrative $73,800 HSA balance after 20 years, by source

Contributions versus investment growth inside the same illustrative account from the chart above. Segments sum to 100%. Invented arithmetic, no specific account.

Contributions 49% Investment growth 51%

Illustrative arithmetic: $1,800 a year for 20 years is $36,000 of contributions, about 49% of the ending balance. The remaining 51%, about $37,800, is investment growth the account was never taxed on along the way.

Now compare that same saver’s behavior against spending the HSA down as bills arrive, keeping no invested balance. Every year the account pays a bill, that money stops compounding immediately. Across 20 years of ordinary medical costs, routine checkups, occasional prescriptions, a procedure here and there, it is entirely plausible for an HSA used purely as a pass-through to never build a meaningful invested balance at all. The difference between those two savers is not the tax rules, which are identical for both; it is simply whether the account was allowed to compound or was drained as it went. That single behavioral choice, not any feature of the account itself, is what decides whether an HSA ends up functioning as a retirement account or as a glorified medical debit card. Swap in your own contribution amount, timeline and return assumption in the calculator or the companion below to see how the two paths diverge using your own numbers.

What counts as a qualified medical expense

A qualified medical expense, for HSA purposes, generally covers costs for diagnosis, treatment or prevention of disease, and a wide range of related costs: doctor visits, prescriptions, dental and vision care, mental health treatment, and many medical devices and supplies, among others. It generally does not cover general health and wellness items that are not tied to a specific medical need, such as ordinary vitamins or a gym membership, though the exact boundaries have specific rules and occasional exceptions worth checking against current IRS guidance rather than assuming.

Once you reach 65, the definition of a qualified expense effectively widens in one useful way: HSA funds can generally be used tax-free for Medicare premiums, excluding a Medigap supplemental policy, which is a meaningful benefit given how much premiums can add up in retirement. Long-term care insurance premiums, up to limits that adjust by age, are also generally an eligible expense. Confirm the current rules and any age-based limits directly against IRS Publication 969 before relying on a specific figure, since these thresholds are adjusted periodically.

Keeping records matters more with an HSA than with most accounts, because the tax-free treatment of a withdrawal depends on it genuinely matching a qualified expense, and the IRS does not require you to submit proof at the time of withdrawal, only to be able to produce it if ever asked. Saving receipts, even digitally, for every expense you intend to eventually reimburse yourself for, is the practical discipline that makes the strategy in the next section workable years or even decades later.

The shoebox strategy: paying cash now, reimbursing yourself later

Here is where the no-deadline feature of an HSA turns into an actual strategy rather than a trivia fact. Because there is generally no time limit on reimbursing yourself for a past qualified medical expense, as long as the expense was incurred after the HSA was opened, some savers deliberately pay smaller medical bills out of pocket, from ordinary income or savings, rather than from the HSA, and keep the receipt. The HSA balance itself stays untouched and fully invested, compounding tax-free in the background, potentially for years.

Later, whenever it is useful, the saver can withdraw an amount equal to that old receipt from the HSA, entirely tax-free, as reimbursement for an expense that happened long ago. Functionally, this converts the HSA into a tax-free withdrawal available on demand, backed by a stack of saved receipts, while letting the invested balance grow uninterrupted in the meantime. It is sometimes nicknamed the shoebox strategy, after the literal or digital folder where the receipts accumulate.

The trade-off is liquidity and discipline today: this approach only works for people who can comfortably afford to pay medical bills out of ordinary cash flow rather than needing the HSA balance for near-term expenses. It is not a strategy to force onto a tight budget, and nothing about it changes the underlying contribution limits or eligibility rules. For a saver who genuinely has the cash flow to spare, though, it is one of the more effective ways to maximize how much of the HSA balance stays invested and benefiting from the account’s tax-free growth, similar in spirit to how compound interest rewards money that is left alone the longest.

What changes at age 65

Two things change at 65, and only one of them is about Medicare. First, Medicare eligibility at 65 generally makes you ineligible to continue contributing new money to an HSA, even if you keep working, because Medicare enrollment counts as disqualifying other coverage under the HSA eligibility rule. Existing balances are unaffected and remain fully usable; you simply stop adding new contributions once enrolled.

Second, and more significant for long-term planning, the penalty on non-qualified withdrawals disappears. Before 65, withdrawing HSA money for something other than a qualified medical expense generally triggers both ordinary income tax and an additional penalty on top of it, which is a meaningfully harsh combination designed to discourage casual withdrawals. After 65, that penalty goes away. A non-medical withdrawal after 65 is simply taxed as ordinary income, the same treatment a traditional 401(k) or traditional IRA withdrawal receives, with no additional penalty layered on.

That shift is why some financial planners describe an HSA, past a certain balance, as functioning like a second traditional retirement account in your late sixties and beyond, except better: withdrawals used for medical expenses, which tend to rise with age, are still completely tax-free, and withdrawals for anything else are no worse than a traditional 401(k) distribution would be. There is effectively no bad outcome for leftover HSA money at that stage, which is part of why maximizing HSA contributions earlier in a career, even ahead of some other goals, is a strategy more financial educators increasingly cover, alongside the account’s narrower original purpose.

HSA vs 401(k) vs Roth IRA: where it fits in the stacking order

A common question is where an HSA belongs relative to a 401(k) and an IRA when deciding what to fund first with limited money. There is no single universal order, since it depends on your employer’s match, your tax bracket, your plan fees, and your own medical cost expectations, and none of what follows is a recommendation for your specific situation. That said, a commonly discussed general framework starts with capturing any employer 401(k) match first, since it is an immediate, guaranteed return no other account can match. After the match is captured, the HSA is frequently discussed next, specifically because of the triple tax advantage described earlier, which neither a traditional nor a Roth account fully replicates on its own.

From there, savers often return to maxing out the 401(k) or funding an IRA, weighing a traditional account’s upfront deduction against a Roth account’s tax-free growth, a decision our Roth IRA versus 401(k) piece covers in more depth. The HSA’s position in this order is not about it being universally more important than retirement accounts; it is that, dollar for dollar, its tax treatment is structurally better for money that genuinely ends up spent on healthcare, and healthcare spending in retirement is close to a certainty for most people, which makes the HSA a low-regret place to direct money relatively early.

The honest caveat is that this framework assumes the HSA balance is actually invested rather than left in cash, and that the account holder has enough other liquidity to avoid needing to dip into the HSA for near-term bills. An HSA treated purely as a cash cushion for this year’s deductible is a reasonable choice for some households, and nothing about this stacking discussion overrides a genuine, immediate need for accessible medical funds.

What happens to an HSA when you change jobs or lose coverage

An HSA is owned by the individual, not the employer, which is a meaningful difference from how some people assume workplace benefits function. Changing jobs does not forfeit the balance, does not require withdrawing it, and does not require using a new employer’s chosen provider; the account and everything invested inside it simply continues to exist under your ownership. Some account holders consolidate an old employer-selected HSA into a provider with better investment options once they are free to choose, similar to rolling over an old 401(k), though the mechanics and any fees involved are worth checking with both providers first.

Losing high-deductible health plan coverage, whether from a job change, a plan switch during open enrollment, or any other reason, simply stops your eligibility to contribute new money for as long as you lack qualifying coverage. It does not affect the existing balance in any way: invested money keeps being invested, cash keeps earning whatever rate the provider pays, and the balance remains usable for qualified medical expenses regardless of what health plan you currently carry. Eligibility to contribute and the right to use existing funds are two separate questions, and losing the first does not touch the second.

What happens to an HSA when you die

What happens to an HSA at death depends heavily on who inherits it, and the difference between the two main scenarios is large enough to be worth understanding ahead of time rather than discovering it during estate planning. If a spouse is named as the beneficiary, the HSA generally transfers to them and continues functioning as their own HSA, preserving the tax-advantaged status, which is the most favorable outcome and mirrors how a surviving spouse can often treat an inherited retirement account.

If a non-spouse is named as the beneficiary, the outcome is generally much less favorable: the account typically stops being treated as an HSA, and its fair market value is usually included in the beneficiary’s taxable income for that year, though the deceased’s own unreimbursed qualified medical expenses can sometimes be used to reduce that taxable amount. This is a meaningfully different result from inheriting a Roth IRA, for instance, and it is a detail worth confirming with a qualified estate or tax professional rather than assuming an HSA will pass like other retirement accounts, particularly for account holders without a spouse as the natural beneficiary.

The investment menu and the fee drag

Once a balance clears the investable threshold, the actual fund menu offered matters more than many account holders realize, because HSA investment menus are not uniform the way a brokerage account’s full market access is. Some providers offer a short list of reasonably priced index funds; others offer a longer list weighted toward higher-fee actively managed funds, sometimes alongside an administrative fee for the investment feature itself, on top of whatever expense ratios the underlying funds charge.

A seemingly small difference in fees compounds meaningfully over a multi-decade HSA investing horizon, the same way fee differences matter in any long-held account; our note on expense ratios covers how a fraction of a percentage point, charged every year regardless of performance, erodes a balance over time. Because many employers choose the default HSA provider based on payroll integration rather than investment quality, it is worth checking your specific menu’s fund options and fees rather than assuming the default choice is competitive, and worth knowing whether your provider allows a rollover to a different provider once you are not required to use the employer’s default for new contributions.

A photo identification card, a dark payment card with a gold chip, and the edge of an open laptop displaying a document, arranged on a wooden desk
Opening an HSA, or rolling one to a provider with a better fund lineup and lower fees, generally starts with paperwork much like this rather than anything exotic.

Common mistakes

A short list of the mistakes that come up most often, none of them exotic. Leaving the entire balance in the cash sweep indefinitely, simply because that was the default setting, forfeits most of the account’s long-term tax advantage for a saver who does not actually need the money soon. Contributing without confirming the plan genuinely qualifies as an HSA-eligible high-deductible plan can create an excess contribution and a tax headache that takes real effort to unwind.

Losing receipts for medical expenses paid out of pocket undermines the shoebox reimbursement strategy, since there is nothing to reimburse against years later without proof the expense occurred and was unreimbursed by insurance or anything else. Forgetting to update the beneficiary designation, particularly after a marriage, divorce or death in the family, can send the account to the wrong person or trigger the less favorable non-spouse tax treatment unnecessarily. And treating 65 as a reason to stop caring about the account is backward; it is the point where the account becomes more flexible, not less relevant.

Who should not prioritize an HSA

None of the above means an HSA is automatically the right first move for every saver with access to one. A household without an emergency fund, or one carrying high-interest debt, generally has a stronger claim on the next available dollar than an HSA does, since the guaranteed return of paying down expensive debt, or the practical necessity of an emergency cushion, usually outweighs a tax-advantaged account’s benefits for money that might be needed on short notice. An HSA invested in the market can also lose value over any given stretch, the same as any other invested balance, so money genuinely needed soon does not belong invested regardless of which account holds it.

Someone with frequent, predictable medical expenses and little slack in their budget may also reasonably choose to keep more of the HSA in cash rather than invested, prioritizing accessibility over long-term growth, which is a legitimate choice rather than a mistake. And for someone without access to a qualifying high-deductible health plan at all, the question is moot; the account simply is not available regardless of how attractive its tax treatment looks on paper. None of this article argues that an HSA belongs ahead of every other financial priority for every reader; it argues that, for someone who already has the basics covered and does have access to the account, understanding the investing side is usually worth the effort.

How an HSA interacts with Medicare

Once Medicare enrollment begins, typically at 65, two separate things are worth tracking rather than conflating. The first is contribution eligibility: enrolling in Medicare generally disqualifies you from contributing further to an HSA, because Medicare counts as disqualifying other coverage, so new contributions should generally stop at enrollment to avoid an excess contribution. The second is spending eligibility, which actually widens at this stage: HSA funds can generally be used tax-free to pay Medicare Part B, Part D, and Medicare Advantage premiums, though generally not a Medigap supplemental policy premium, which is a detail easy to get backward if you are assuming all Medicare-adjacent premiums are treated identically.

Because Medicare premiums, like most healthcare costs, tend to rise with age, an HSA balance that was allowed to compound for years or decades beforehand can meaningfully offset a real, recurring retirement expense entirely tax-free, which is one of the stronger practical cases for prioritizing HSA investing earlier in a career rather than treating the account as an afterthought once Medicare is already closer. The exact interaction between HSA eligibility and the specific timing of Medicare enrollment has a few edge cases, including situations involving delayed Medicare enrollment, that are worth confirming directly with the Social Security Administration or a benefits specialist if your own timeline is not straightforward.

A few HSA numbers worth confirming yourself

This explainer has deliberately avoided stating specific current-year contribution limits, deductible thresholds, and age-based catch-up or long-term-care premium figures as fixed numbers, because every one of them is set or adjusted by the IRS on a schedule and would likely be stale by the time you are reading this. Before acting on anything above, confirm directly from IRS Publication 969, or your HSA provider’s current plan documents, the current annual contribution limit for self-only and family coverage, the current 55-and-over catch-up amount, the minimum deductible and maximum out-of-pocket figures that define an HSA-eligible high-deductible health plan for the current year, and the current age-based limits on treating long-term care insurance premiums as a qualified expense.

Treating this list as a checklist rather than skipping past it is worth the extra few minutes, particularly because contributing even slightly over the current limit creates an excise tax problem that takes more effort to correct than it would have taken to confirm the number in the first place.

The bottom line

An HSA is a tax-advantaged account tied to a qualifying high-deductible health plan, and it earns the triple tax advantage label honestly: a tax break on the contribution, tax-free growth along the way, and tax-free withdrawals for qualified medical expenses, a stack no ordinary retirement account matches on the same dollar. Unlike a flexible spending account, nothing is forfeited at year end, and unlike many savers assume, most providers let the balance above a cash threshold be invested rather than left sitting at a low interest rate.

In the illustrative 20-year example running through this piece, an HSA used for medical expenses compounds to about $73,800 against roughly $66,200 in a comparably taxed brokerage account and roughly $57,600 in a traditional 401(k) taxed at exit, purely from the difference in tax treatment on an identical contribution and return. After 65, the penalty on non-medical withdrawals disappears entirely, turning any leftover balance into a flexible, low-regret account rather than a narrow one. Confirm the current contribution limits and eligibility thresholds directly against the IRS before contributing, and take any larger HSA, Medicare or estate-planning question to a qualified tax or financial professional rather than relying on a general explainer like this one.


Dividora publishes for readers who would rather understand the mechanism than follow a tip, and this explainer is exactly that: general information and education, not tax, legal, or investment advice, and not a recommendation to open, fund, or invest any specific account. Every contribution amount, return assumption, tax rate, and dollar figure above is an illustrative planning device rather than a forecast, and any account invested in the market can lose value, sometimes for extended periods. HSA eligibility rules, contribution limits, deductible thresholds, and the tax treatment of specific withdrawals are set by the IRS and adjusted periodically, so confirm the current official figures from IRS Publication 969 or your plan provider before acting on any number here. Whether to prioritize an HSA ahead of other goals, how much to invest versus hold as cash, and how an HSA should fit into retirement or estate planning depends on your income, your health plan, your family situation, and your overall finances, and deserves a qualified tax or financial professional’s review before you act on it.

Frequently asked questions

What is an HSA in simple terms?

A health savings account, or HSA, is a tax-advantaged account available to people enrolled in a qualifying high-deductible health plan. You contribute money, the contribution generally reduces your taxable income, the balance can grow without being taxed year to year, and withdrawals for qualified medical expenses are never taxed either. Unlike a flexible spending account, unused money is not forfeited at year end; it stays in the account and keeps growing, which is why many people treat an HSA less like a medical checking account and more like a retirement account with a narrower purpose.

Can you actually invest the money inside an HSA?

Yes, though most providers only let you invest a balance above a set cash threshold, commonly somewhere in the low thousands of dollars, which stays in a cash sweep account to cover near-term claims. Above that threshold, the remaining balance can typically be moved into a menu of mutual funds similar to what a 401(k) offers. Many HSA holders never move past the cash sweep, either because the provider defaults them there or because they are paying medical bills directly from the account, which means the triple tax advantage on the investment side goes largely unused.

What is the HSA triple tax advantage?

It describes three separate tax breaks stacked on one account. Contributions are generally made pre-tax or are deductible, so you are not taxed on the money going in. The balance grows without being taxed year to year, so dividends, interest and capital gains inside the account are not reported on your return the way they would be in a taxable brokerage account. And withdrawals for qualified medical expenses are never taxed at all. No other account available to most savers offers all three breaks on the same dollar, which is the entire case for treating an HSA as an investment account rather than a spending account.

What is the difference between an HSA and an FSA?

Both let you set aside money for medical costs with favorable tax treatment, but they behave very differently afterward. A flexible spending account is generally use it or lose it: unspent money is typically forfeited at the end of the plan year, with only a small carryover or grace period allowed in some plans. An HSA has no such deadline; whatever you do not spend simply remains invested and keeps compounding, potentially for decades. An FSA also does not require a high-deductible health plan and is not portable if you leave your employer, while an HSA belongs to you regardless of where you work.

What happens to HSA money you do not use?

Nothing happens to it, and that is the point. Unlike a flexible spending account, an HSA has no use it or lose it deadline. A balance left untouched continues sitting in the cash sweep or, if invested, continues participating in the market, carrying forward year after year with no expiration. Some people deliberately pay smaller medical bills out of pocket specifically so the HSA balance can stay invested and compounding rather than being drawn down, then reimburse themselves from the account years later, since the deadline to claim a reimbursement for a past qualified expense is generally unlimited as long as the account existed when the expense was incurred.

What happens to an HSA after age 65?

The account keeps working as an HSA for qualified medical expenses, which by that age often includes Medicare premiums other than a Medigap policy, and those withdrawals remain entirely tax-free. What changes is the penalty on non-medical withdrawals: before 65 a non-qualified withdrawal generally triggers both ordinary income tax and an additional penalty, while after 65 the penalty goes away and a non-medical withdrawal is simply taxed as ordinary income, similar to a traditional 401(k) distribution. That makes an HSA a flexible fallback account in retirement even if every dollar is not ultimately spent on healthcare.

Can you contribute to an HSA and a 401(k) in the same year?

Yes. An HSA and a 401(k) are entirely separate accounts with their own contribution limits, so contributing to one does not reduce the room in the other, unlike the shared limit between a traditional and Roth IRA. Many savers fund both in the same year, often prioritizing an employer 401(k) match first since it is an immediate, guaranteed return, then directing new money toward the HSA for its triple tax advantage, before returning to the 401(k) or an IRA for the remainder. The right order depends on your own plan's fees, investment menu and match structure.

What happens to an HSA when you change jobs or lose high-deductible coverage?

The account is yours, not your employer's, so changing jobs does not forfeit it the way leaving a job can affect unused flexible spending account money. You keep the balance, keep investing it, and can generally roll it to a new provider if you prefer different investment options. If you lose high-deductible health plan coverage, you simply stop being eligible to contribute new money until you regain qualifying coverage; the existing balance is unaffected and continues to grow and remains usable for qualified medical expenses regardless of your current health plan.

Editorial team · Consumer finance writing

Dividora analysis is written by our editorial team and edited against our published editorial standards. It is educational general information, not personalized financial advice.

Hamza Hai, Editor
Edited by Hamza Hai, MBA · Editor

Hamza Hai is the editor of Dividora. She holds an MBA and reviews the site's articles against our editorial standards, checking that every figure is labelled for what it is, that nothing is presented as verified fact without a source the reader can check, and that the writing stays useful to a non-specialist.

How we research, write and review · LinkedIn

By email

Get a compounding breakdown by email

Tell us about your portfolio and what you want it to do, and we will email you a breakdown of how it compounds at different contribution rates and returns. We are not an advisor, a broker or an RIA, we do not manage money, and we will not pass your details to anyone.

Nothing we send is a recommendation to buy any security. We store your details to reply to you. See our privacy policy.