Health Savings Accounts (HSAs) are one of the most tax-advantaged accounts in the U.S. tax code — contributions are deductible, growth is tax-free, and withdrawals for qualified medical expenses are tax-free. But HSAs and Medicare don’t mix. Once you enroll in any part of Medicare, you can no longer contribute to an HSA. The transition from HSA-eligible health insurance to Medicare creates traps that catch many near-retirees off guard, especially around the 6-month lookback rule and timing of Social Security.
The basic rule: Medicare ends HSA contributions
To contribute to an HSA, IRS rules require you to be enrolled in a qualified high-deductible health plan (HDHP) and not enrolled in any other health coverage that isn’t HDHP. Medicare counts as “other coverage” that disqualifies you. The moment you enroll in Medicare Part A, Part B, or any other Medicare program, your HSA contribution eligibility ends.
This applies to any Medicare enrollment, even Part A alone. Many people don’t realize that Part A is automatic in some situations — particularly when starting Social Security.
The Social Security trap
If you start Social Security at or after age 65, you are automatically enrolled in Medicare Part A. There is no way to refuse Part A while collecting Social Security benefits — the two are linked by federal regulation. Refusing Part A means giving up Social Security entirely and repaying any benefits already received.
Practical implication: If you want to keep contributing to an HSA past age 65, you cannot start Social Security. Once you file for Social Security at 65 or older, your HSA contribution eligibility ends with your automatic Part A enrollment.
This is one of several reasons people working past 65 with HSAs commonly delay Social Security to 67, 70, or whenever they retire.

The 6-month lookback rule
Here’s the rule that catches the most people off guard. When you eventually enroll in Medicare Part A after age 65, your effective coverage start date is backdated up to 6 months — or back to your 65th birthday, whichever is later.
Example: A 67-year-old finally retires in October and enrolls in Medicare Part A. Her Part A coverage is backdated 6 months to April. From April through September, she was technically “covered by Medicare” for HSA purposes, even though she didn’t enroll until October.
This means: any HSA contributions made during those backdated months become excess contributions and are subject to a 6% excise tax each year until removed.
How to avoid the lookback trap
If you’re past 65 and want to keep contributing to an HSA, you must stop HSA contributions at least 6 months before you plan to enroll in Medicare. If you plan to enroll in Medicare in October, your last HSA contribution should be in March (or earlier).
If you’re unsure of your Medicare timing, the safer move is to stop contributions 6 months before you turn 65 to avoid any lookback issues. Many financial advisors recommend stopping HSA contributions a few months before 65 even if delaying Medicare, just to build a buffer.
What happens to your existing HSA balance
Good news: your existing HSA balance is yours forever. Medicare enrollment ends new contributions, but it does not require you to spend down or close the account. You keep all the money you’ve already contributed and any growth.
Even better, after Medicare enrollment you can still use your HSA to pay for qualified medical expenses tax-free, including:
- Medicare Part B premiums — deducted from Social Security or paid directly
- Medicare Part D prescription drug premiums
- Medicare Advantage premiums (but NOT Medigap premiums — those are not HSA-eligible)
- Out-of-pocket medical costs — deductibles, copays, dental, vision, hearing aids
- Long-term care insurance premiums (subject to age-based limits)
This makes an HSA effectively a tax-free fund for paying Medicare costs in retirement — one of the most efficient ways to cover healthcare expenses after 65.
🆓 Approaching 65 and worried about your HSA? Get free expert help.
The 6-month Medicare lookback rule trips up many near-retirees with HSAs. Our partner Chapter Medicare offers free, unbiased guidance from licensed advisors who can walk you through enrollment timing.
📞 Call 615-639-1937 | 🔗 askchapter.org/money
Help is ALWAYS FREE. Chapter is compensated by insurance carriers, not by you.
Strategies for HSA holders approaching Medicare
If you plan to retire at 65
Stop HSA contributions at the start of the year you turn 65, or at the latest 6 months before your Part A effective date. Enroll in Medicare during your initial enrollment window (3 months before to 3 months after your 65th birthday). After enrollment, use the HSA balance to pay Medicare premiums and out-of-pocket costs tax-free.
If you plan to keep working past 65 with HSA-qualified employer coverage
You can delay Medicare enrollment if you have HSA-qualified employer health insurance through an employer with 20+ employees. To preserve HSA contributions:
- Do not file for Social Security. Filing triggers automatic Part A enrollment.
- Do not enroll in Part A voluntarily. Even though Part A is premium-free for most people, enrolling ends HSA contributions.
- Plan your retirement date. Stop HSA contributions 6 months before you intend to enroll in Medicare to avoid the lookback rule.
This is the most common path for people working into their late 60s — delay both Social Security and Medicare while contributing to an HSA, then enroll in both around actual retirement.
If your spouse is on Medicare but you’re not
Your spouse’s Medicare enrollment doesn’t affect your HSA eligibility — only your own does. As long as you’re still on a qualified HDHP and not personally enrolled in Medicare, you can keep contributing. Family HSA limits apply if you have family HDHP coverage, but only contributions in your name count.
One nuance: your spouse’s Medicare-paid medical expenses are still HSA-qualified, so you can use your HSA to pay your Medicare-enrolled spouse’s out-of-pocket costs tax-free.
If you’re close to 65 and have a Family HSA
In the year you turn 65, your maximum HSA contribution is prorated. If you’re HSA-eligible for only the first 6 months before Medicare starts, your contribution limit is roughly half the annual maximum. Many HSA custodians provide proration calculators — or your tax software can calculate it. Pay attention; over-contributing triggers the 6% excise tax.
The catch-up contribution
From age 55, the IRS allows an extra $1,000 annual catch-up contribution to an HSA. This catch-up continues until you enroll in Medicare. For someone working from 55 to 67, that’s up to $12,000 in additional contributions on top of the standard limit — a meaningful amount.
If both spouses are 55+ and on a Family HDHP, each spouse can make a $1,000 catch-up contribution — but each catch-up must go to their own HSA in their own name, not the shared family one. Many couples miss this and lose out on $1,000/year of additional tax-advantaged savings.
Common mistakes
- Filing for Social Security at 65 while still contributing to an HSA. Automatic Part A enrollment ends contribution eligibility.
- Enrolling in Part A “just to be safe” at 65. If you have HSA-qualified employer coverage and want to keep contributing, do NOT enroll in Part A at 65. There’s no penalty for delaying as long as you have qualifying employer coverage.
- Forgetting the 6-month lookback. Stop HSA contributions at least 6 months before Medicare enrollment if you’re past 65.
- Using HSA funds for Medigap premiums. Medigap is not HSA-eligible. Medicare Advantage and Part D premiums ARE eligible.
- Closing the HSA after Medicare enrollment. The account is yours; the balance stays. You can’t add new contributions, but you can keep using it tax-free for qualified medical expenses.
- Over-contributing in the year you turn 65. Your contribution limit is prorated based on how many months you were HSA-eligible.
After 65: HSA as a healthcare bucket
Once you’ve crossed into Medicare, your HSA becomes a flexible healthcare reserve. Medicare doesn’t cover everything — dental, vision, hearing aids, long-term care, and a lot of out-of-pocket costs are still on you. The HSA can pay for all of it tax-free.
After 65, HSA withdrawals for non-medical expenses also become more flexible. The 20% penalty for non-medical withdrawals goes away — you only owe ordinary income tax. This makes the HSA function like a Traditional IRA after 65, with the bonus that medical withdrawals remain completely tax-free.
For people who saved aggressively in an HSA during their working years and didn’t spend it down, the account becomes a quasi-retirement account that can fund both healthcare and (with tax) general retirement spending.
Bottom line
HSAs and Medicare don’t coexist for contributions, but the existing HSA balance remains a powerful retirement healthcare asset. The keys are: stop contributions at the right time (6 months before Medicare enrollment if past 65), don’t accidentally trigger Part A through Social Security, and use the balance to pay Medicare premiums (Part B, D, Advantage) and out-of-pocket costs tax-free for the rest of your life.
If you’re approaching 65 with a meaningful HSA balance, the timing decisions matter. Get them right and the HSA becomes one of the most tax-efficient ways to fund healthcare in retirement. Get them wrong and you face IRS penalties, excess contributions, and lost tax benefits.
🆓 Need help timing Medicare around your HSA?
Our partner Chapter Medicare offers free one-on-one help from licensed advisors. They can review your specific situation and explain how Medicare timing affects your HSA contributions and tax planning.
📞 Call 615-639-1937 | 🔗 askchapter.org/money
ALWAYS FREE. No obligation.
Disclosure: We may receive a referral from Chapter if you choose to use their service. Chapter is a licensed health insurance agency and is not affiliated with or endorsed by Medicare or any government agency.
Further Reading
- Medicare Enrollment
- Medicare Costs and Premiums
- Still Working at 65: Medicare and Employer Coverage
- Medicare Advantage vs. Original Medicare
- Healthcare Costs in Retirement
- How Much Do You Need to Retire?
This article is for general educational purposes only and does not constitute tax, insurance, or financial advice. Visit medicare.gov or irs.gov, or consult a licensed advisor for guidance specific to your situation.