HSA and Medicare: the last month you can contribute
You can't put money into a health savings account for any month you have Medicare. When you sign up after 65, Part A can be backdated, so the last safe month can come well before you retire.
Work out your last HSA month
The rule
From the first month you’re enrolled in Medicare, your HSA contribution limit is zero. That includes months of backdated Medicare coverage: if you apply late and your enrollment is backdated, anything put into your HSA for those months counts as an excess contribution. Contributions from your employer count too.
Source: IRS Publication 969 (HSAs)
Why the last month comes early
When you sign up for Medicare after 65, or apply for Social Security benefits, Part A can start up to 6 months before you apply. So Medicare.gov says you and your employer should stop contributing 6 months before you retire or apply for Social Security. The calculator counts back from when you’d apply, and never to before the month Medicare counts you as turning 65.
Source: Medicare.gov: Working past 65 · IRS Publication 969 (HSAs)
The year Medicare starts
Your limit for that year is cut to the months before Medicare. IRS Publication 969’s example: someone who turns 65 in July and enrolls in Medicare can contribute 6/12 of the yearly limit. Your HSA provider can confirm your amount.
Source: IRS Publication 969 (HSAs)
If you’ve already put in too much
Excess contributions aren’t deductible, and there’s generally a 6% tax on them for each year they stay in the account. You can avoid that tax by withdrawing the excess, and any earnings on it, by the due date of that year’s tax return, including extensions. Report the earnings as other income.
Source: IRS Publication 969 (HSAs)
You can still spend it
Stopping contributions doesn’t close the account. Once you’re 65, you can use it tax-free to pay Medicare premiums, except premiums for a Medicare supplement (Medigap) policy.
Source: IRS Publication 969 (HSAs)
Still working past 65?
Coverage from a current job at an employer with 20 or more employees can let you put off Medicare, and so keep contributing. If you choose COBRA when the job ends, your Medicare deadline doesn’t move: see COBRA and Medicare.
Source: Medicare.gov: Working past 65 · Medicare.gov: COBRA coverage
Get every date for your situation
Answer a few questions and get your Medicare deadlines on one page: when to sign up, when to stop HSA contributions, and your Medigap and drug-plan windows. Free, and your answers never leave your device.
Work out my datesMore guides
- Medicare enrollment calculator: your sign-up window, worked out from your birth date.
- COBRA and Medicare: why COBRA doesn't let you put off Part B, and your real deadline.
- IRMAA brackets for 2026: what higher incomes pay for Parts B and D, and how to lower it after you retire.
- Turning 65 and fall open enrollment: why the October 15 – December 7 ads aren't for you yet.