The HSA rule that can cost you a 6% tax at 65
If you’re still working past 65 with an HSA-eligible health plan, enrolling in Medicare later can reach backward and tax contributions you already made. The fix is timing, not paperwork.
Health Savings Accounts and Medicare do not mix — you cannot contribute to an HSA for any month you are covered by Medicare, full stop. Most people learn this the easy way, by stopping contributions when Medicare starts. The trap is for people who keep working past 65, stay on an HSA-eligible employer plan, and enroll in Medicare later — because Medicare can reach backward and cover months they had already assumed were still HSA-eligible.
| The trigger | Enrolling in Medicare Part A after 65 — including automatic enrollment, if you claim Social Security at or after 65. |
|---|---|
| The reach-back | Part A coverage applies retroactively up to 6 months, but never earlier than the month you turned 65. |
| The conflict | You are not HSA-eligible for any month covered by Medicare, including a month covered retroactively. |
| The tax consequence | Contributions made during a retroactively-covered month become excess HSA contributions. Left uncorrected, an excess contribution is charged a 6% excise tax for every year it remains in the account, not a one-time hit. |
| The fix | Stop HSA contributions at least 6 months before you apply for Medicare, or before your 65th birthday if you plan to enroll right at 65. |
| What is not affected | Money already in the HSA. It stays yours, stays tax-free for qualified medical expenses, and can be used to pay Medicare premiums (except Medigap) after 65. |
Who this actually reaches
Almost nobody who enrolls in Medicare right at 65 hits this. The trap is specific to people who keep working past 65 on an employer’s high-deductible health plan, keep contributing to an HSA, and then either delay Medicare deliberately or trigger it accidentally by claiming Social Security. Claiming Social Security at or after 65 automatically enrolls you in Medicare Part A — you do not get to keep the HSA-eligible coverage and collect Social Security at the same time without running into this.
The 6-month lookback also has a floor: it never reaches earlier than the month you turned 65. Someone who works to 68 and then enrolls has the same 6-month exposure window as someone who works to 66 — the retroactive coverage does not stretch back to their 65th birthday in either case.
Also on The Second Half Guide Most states will let you take college classes free after 60 Most states let older residents take public-college courses free or cheaply. Rules vary by state, campus, age, and whether you audit or take credit. Read it →The contribution was legal when you made it. The problem is that Medicare, once it starts, can decide it started six months earlier than the day you actually enrolled.
What to do about it
- If you plan to keep working past 65 on an HSA-eligible plan and delay Medicare deliberately, that is fine — just know the 6-month exposure applies whenever you eventually do enroll.
- If you plan to claim Social Security at or after 65, stop HSA contributions at least 6 months before that claim takes effect, since claiming triggers automatic Part A enrollment.
- If you already over-contributed during a retroactive-coverage window, you can generally withdraw the excess, plus any earnings it generated, by your tax return deadline including extensions for that contribution year to avoid the excise tax on that amount — talk to the HSA custodian about the correction process.
- Employer contributions count too. If your employer contributes to your HSA automatically, that also needs to stop on the same schedule.
- None of this affects an HSA balance you already have. It is only about new contributions during the overlap window.
This is a timing rule, not a reason to avoid an HSA-eligible plan while still working. The Medicare retroactivity itself only ever reaches back up to 6 months. But that is a separate question from how long the tax consequence lasts: an excess contribution left uncorrected keeps accruing the 6% excise tax every year, on top of ordinary income tax on whatever it earned. Get the 6-month timing right, or correct an excess contribution promptly if you miss it, and neither issue lingers.
This is general information, not personal advice. We report the rules, the numbers and the deadlines as clearly as we can. We don't know your income, your state, your health or your family — and all four can change the answer. Treat this as a good place to find the right questions, not a substitute for someone looking at your actual situation.
Where these facts come from
Checked on 24 August 2026 against the sources listed below. Dollar limits and program rules change — if you're reading this well after that date, verify the numbers at the links below.
- IRS — Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans — https://www.irs.gov/publications/p969
- Medicare — Health Savings Accounts (HSAs) and Medicare — https://www.medicare.gov/basics/costs/health-savings-accounts
- Medicare — How Part A and Part B sign-up periods work — https://www.medicare.gov/basics/get-started-with-medicare/sign-up/when-does-medicare-coverage-start