Medicare quietly kills your HSA contributions — and the 6-month lookback can backdate the damage
If you’re working past 65 and still funding a Health Savings Account, there’s a trap that HR rarely flags and payroll won’t catch. Enrolling in any part of Medicare — even premium-free Part A — ends your HSA eligibility. Worse, when you sign up after 65, Part A is backdated up to six months, turning contributions you already made into excess contributions with a 6% penalty attached. And because claiming Social Security automatically enrolls you in Part A, plenty of people trigger this without realizing it. Here’s exactly how the lookback works, what it costs, and when to stop contributing — with a calculator to size your risk.
counts
1. The trap hiding in plain sight
Federal employees and others who work past 65 increasingly stay on a high-deductible health plan with an HSA — the triple-tax-advantaged account that’s one of the best savings vehicles in the tax code. Delaying Medicare to keep contributing is a smart move. But the transition to Medicare is booby-trapped, and the mine is retroactive Part A. It doesn’t show up on a payroll form. Most HR departments don’t flag it. And it catches people every year, often after the tax year has closed.
2. Medicare ends HSA eligibility
The core rule is simple and absolute: to contribute to an HSA you must have a qualifying high-deductible health plan and no disqualifying coverage — and Medicare is disqualifying coverage. The moment any part of Medicare is effective, including premium-free Part A, your HSA contribution limit drops to zero.
This applies to both your contributions and your employer’s. Eligibility is tested month by month, on the first day of each month, and the annual limit is prorated — you get one-twelfth of the yearly maximum (2026: $4,400 self-only, $8,750 family, plus the $1,000 age-55 catch-up) for each month you’re eligible. Once Medicare starts, those months stop counting.
3. The 6-month lookback
Here’s where good intentions go wrong. When you enroll in premium-free Part A after age 65, coverage is made retroactive up to six months — but never earlier than the month you turned 65. This backdating is automatic. You don’t opt in and you can’t waive it.
Because Part A reaches back up to six months, any HSA contributions you made during those retroactive months become excess contributions after the fact — even though they were perfectly legal when you made them. Example: you turn 65 in May 2025, keep working, and apply for Medicare in November 2025. Your Part A effective date is backdated to May 1, so your last eligible HSA contribution month was April. Every dollar contributed May through November is now excess.
That’s why the guidance is to stop HSA contributions six months before you apply for Medicare, not on the day you apply.
4. The Social Security connection
The piece that blindsides the most people: applying for Social Security automatically enrolls you in Medicare Part A. You cannot collect a Social Security check and decline Part A — they’re linked. So someone who’s still working, sees a nice cost-of-living bump, and files for Social Security at 66 or 67 has just enrolled in Part A — with up to six months of retroactive coverage — and may have been funding an HSA the whole time.
If you’re weighing when to claim Social Security while still working and contributing to an HSA, treat the two decisions as one. Filing for Social Security is filing for Part A. (Separately, delaying Part B while covered by active FEHB employment has its own timing rules — see Medicare enrollment timing and penalties.)
5. See your excess-contribution risk
Enter your combined monthly HSA contribution (yours plus any employer amount) and how many months of the retroactive window you kept contributing. The calculator shows the excess and the annual excise tax.
Your numbers
The 6% excise tax recurs every year the excess stays in the account. Withdraw the excess plus earnings by your tax filing deadline (with extensions) to avoid it. 2026 limits: $4,400 self-only / $8,750 family, +$1,000 catch-up at 55+. Estimate, not advice.
6. When to stop contributing
- Enrolling in Medicare at 65? Stop HSA contributions before your coverage effective date — generally the first day of your birthday month (the month before, if your birthday is on the first).
- Delaying Medicare past 65 while working? Stop contributions at least six months before you apply for Medicare or Social Security, to cover the retroactive Part A window.
- Coordinate with your employer so your payroll deferrals and any employer HSA contributions both stop on time — employer money counts against you the same way yours does.
7. Fixing an overcontribution
If you’ve already overfunded, act before your tax deadline. Withdraw the excess contributions and any earnings attributable to them by your filing deadline, including extensions, and you generally avoid the recurring 6% excise tax. The withdrawn earnings count as taxable “other income” for the year you take them out, and everything is reported on IRS Form 8889.
The catch: if you’ve already received your W-2 and filed, unwinding it is more work — employer contributions may require a corrected W-2. It’s all fixable, but it’s far cheaper in time and stress to stop on schedule than to reverse it after the fact.
8. Your HSA is still valuable
Losing the ability to contribute doesn’t touch the balance you’ve built. Your HSA funds remain yours, keep growing tax-free, and can be withdrawn tax-free for qualified medical expenses for life — including Medicare Part A, B, C, and D premiums, deductibles, and copays (though not Medigap premiums). In practice your HSA becomes a tax-free account earmarked for Medicare-era health costs. After 65 you can also take non-medical withdrawals penalty-free, paying only ordinary income tax. See how the pieces fit in the Part B decision.
9. Frequently asked questions
Can I contribute to an HSA after enrolling in Medicare?
No. Once you’re enrolled in any part of Medicare — including premium-free Part A — your HSA contribution limit drops to zero, even if you still have a high-deductible health plan. Any contributions made after Medicare coverage begins are excess contributions. This applies to both your own contributions and any your employer makes. You can still use existing HSA funds tax-free for qualified expenses, including Medicare premiums; you simply can’t add new money.
What is the Medicare 6-month lookback?
When you enroll in Medicare after age 65, premium-free Part A is made retroactive up to six months (but never earlier than the month you turned 65). You don’t choose this and can’t waive it. Because coverage is backdated, any HSA contributions you made during those retroactive months become excess contributions after the fact. So if you delay Medicare while working, you must stop HSA contributions at least six months before you apply.
How does applying for Social Security affect my HSA?
Applying for Social Security automatically enrolls you in Medicare Part A — you cannot collect Social Security and decline Part A. So filing for Social Security at or after 65 ends your HSA eligibility, and because Part A can be backdated up to six months, it can retroactively invalidate recent HSA contributions. Many people don’t realize the Social Security-to-Part A link until after they’ve overfunded their HSA, so plan the timing of both together.
What’s the penalty for HSA contributions made after Medicare starts?
Excess HSA contributions are subject to a 6% excise tax for each year they remain in the account. You can avoid the tax by withdrawing the excess contributions — plus any earnings on them — by your tax filing deadline, including extensions, for the year you made them. The withdrawn earnings are taxable income. Because employer contributions count too, correcting this can also require a revised W-2, so it’s far easier to stop contributions on time than to fix it later.
When should I stop contributing to my HSA?
If you’re enrolling in Medicare at 65, stop contributions before your coverage effective date (generally the first of your birthday month). If you’re delaying Medicare past 65 while working, stop HSA contributions at least six months before you apply for Medicare or Social Security, to account for the retroactive Part A window. Coordinate the stop date with your employer so payroll and any employer HSA contributions end at the same time.
- Fidelity, “HSAs and Medicare: Diagnose the possible pitfalls”
- medicareresources.org, “Do I have to stop HSA contributions before Medicare starts?”
- SHRM, “Medicare’s 6-Month Lookback for HSA Contributions”
- IRS, Publication 969 (HSAs and Other Tax-Favored Health Plans)
- IRS, Form 8889 (Health Savings Accounts)