Life Money USA
HSA strategy

HSA + Medicare 6-Month Lookback: When to Stop Contributing

Stop ALL HSA contributions — including your employer’s — at least 6 months before you enroll in Medicare or claim Social Security after age 65. When you enroll in Medicare after 65, Part A is backdated up to 6 months. Every HSA dollar you (or your employer) deposited during that retroactive window becomes an excess contribution, hit with a 6% excise tax every year it stays in the account. On a 2026 family limit of $8,750, the unwound months can leave $4,000–$5,000 of excess subject to a recurring penalty. The fix is a calendar adjustment, not a tax strategy.

Sarah Mitchell, CFP®, AEP®
Estate Planning Specialist
Updated May 29, 2026
9 min
2026 verified
Share

Quick Answer

Stop every HSA contribution, including your employer match, at least 6 months before you enroll in Medicare after age 65. Part A backdates up to 6 months, turning those deposits into excess contributions hit with a recurring 6% excise tax.

Frank, 66, is a single filer in Ohio still working full-time as an engineer, covered by his employer’s high-deductible health plan (HDHP). He delayed both Social Security and Medicare so he could keep funding his HSA — smart, because in 2026 he can put in $4,400 plus the $1,000 age-55 catch-up, for $5,400 a year of triple-tax-advantaged savings. In March 2027 he decides to retire effective July 1 and files for Medicare. Social Security backdates his Part A to January 1, 2027 — six months before his application. Every dollar Frank contributed to his HSA from January through June 2027 is now an excess contribution. Half a year of contributions, roughly $2,700, is suddenly subject to a 6% excise tax that recurs every year until he fixes it. Nobody warned him, because the trap is built into the enrollment timing, not into any form he signed.

The direct answer: stop contributing 6 months before you enroll

If you are over 65 and plan to claim Medicare or Social Security, your last eligible HSA contribution month is six months before your Medicare effective date. The reason is mechanical: when you enroll in Medicare after age 65, the Social Security Administration backdates your Part A entitlement up to six months (but never earlier than the first of the month you turned 65). Medicare then treats you as covered during that retroactive window. And under IRC §223(c)(1), the moment you have any Medicare coverage, you stop being an “eligible individual” who can fund an HSA.

So contributions you thought were perfectly legal — made while you were still on an HDHP and not yet on Medicare — get reclassified after the fact as excess contributions. The IRS does not care that you didn’t know about the backdate. The 6% excise tax under IRC §4973 applies anyway.

How the lookback actually works

“Lookback” is plain-English shorthand: Medicare pretends you were covered for the prior six months. Here is the chain of rules that creates the trap:

  1. You turn 65 and keep working on an HDHP. As long as you don’t enroll in Medicare and your employer plan qualifies, you remain HSA-eligible and can contribute the full limit.
  2. You later enroll in Medicare (or claim Social Security, which auto-enrolls you in Part A). If you do this after 65, the SSA backdates Part A up to 6 months.
  3. The backdated months are treated as Medicare-covered. Under §223, Medicare coverage disqualifies HSA contributions for those months.
  4. Contributions made in the backdated window become excess. They’re hit with the 6% excise tax under §4973 for every year they remain uncorrected.

The backdate is capped two ways: it never goes back more than 6 months, and it never goes back before the month you turned 65. So if you enroll only a few months after 65, the backdate stops at your 65th-birthday month. The full 6-month exposure only hits people who work well past 65 and then enroll.

Who is actually exposed

  • Workers staying on an employer HDHP past 65. The exact group the HSA-after-65 strategy targets — and the exact group the lookback bites.
  • People delaying Social Security to earn the 8%/year delayed retirement credits. Delaying SS is fine; the problem is the moment you eventually file, Part A turns on and backdates.
  • Anyone whose employer makes HSA contributions for them. Employer deposits count toward the limit and are equally disqualified in the lookback window. You must tell HR/payroll to stop, not just stop your own deferrals.
  • Spouses on a family HDHP. If one spouse goes on Medicare while the other keeps the family plan, the contribution math splits — see the family-vs-self-only guide before prorating.

Worked example: prorating Frank’s 2027 limit

Frank’s Medicare is effective July 1, 2027, with Part A backdated to January 1, 2027. That means he was HSA-eligible for zero months of 2027 — the backdate covers the whole first half, and Medicare covers the second half. His eligible contribution for 2027 is $0. Anything he or his employer put in is excess.

Now change one fact: Frank’s Medicare is instead effective September 1, 2027, with Part A backdated to March 1, 2027. He was an eligible individual only for January and February — two months. His prorated limit is the full annual amount divided by 12, times the eligible months.

ItemAmount
2026 self-only limit + age-55 catch-up$4,400 + $1,000 = $5,400
Eligible months (Jan–Feb)2 of 12
Prorated 2027 limit ($5,400 × 2/12)$900
If Frank contributed the full $5,400 anywayExcess = $4,500
Annual 6% excise tax on $4,500 (§4973)$270/year, recurring

The $270 is not a one-time hit. It applies every year the $4,500 stays in the account. Leave it for five years and you’ve paid $1,350 in excise tax on money you over-contributed by accident — on top of having lost the deduction you assumed you earned.

The last-month rule — why it makes this worse, not better

Many people over-contribute because of the last-month rule (IRC §223(b)(8)). It says if you are HSA-eligible on December 1, you may contribute the full annual limit for that year, even if you weren’t eligible the other 11 months. The catch is a 13-month testing period: you must remain an eligible individual through December 31 of the following year, or the extra contribution gets clawed back into income and hit with an additional 20% tax.

Here’s the trap inside the trap: someone who uses the last-month rule to load up the full limit in their final working year, then enrolls in Medicare partway through the next year, blows the testing period. The full-year contribution they thought the last-month rule blessed becomes both an excess contribution and a failed-testing-period inclusion. Do not lean on the last-month rule in the year before you expect to enroll in Medicare. Prorate instead.

How to fix an over-contribution before it costs you

If you discover the excess in time, the fix is straightforward and avoids the 6% excise tax entirely:

  1. Request a corrective distribution from your HSA custodian — the excess contribution plus the earnings attributable to it. This is a specific form, not an ordinary withdrawal.
  2. Do it before your tax-filing deadline including extensions — generally October 15 for the prior year. Hit that date and the 6% excise tax under §4973 never applies.
  3. Report the earnings as “other income.” The withdrawn earnings (not the contribution itself) are taxable in the year you pull them out.
  4. If you miss the deadline, you owe 6% for that year. You can stop the recurrence by withdrawing the excess in a later year or by simply not contributing the following year and letting the unused room absorb the excess — but you pay 6% for each year it sits there in the meantime.

Coordinate the corrective distribution with payroll if any of the excess came from employer or pre-tax payroll deferrals — those have to be unwound through the right channel so your W-2 and Form 8889 reconcile.

What most people miss

The single most common error is forgetting that employer contributions count. You can dutifully stop your own payroll deferrals and still blow the limit because HR keeps depositing the company match into a now-disqualified account. When you set your stop date, send written notice to payroll to halt all HSA funding — yours and the employer’s.

The second miss: people assume Social Security and Medicare are separate decisions. They are not, after 65. Filing for Social Security automatically enrolls you in Medicare Part A — you cannot take SS benefits and refuse Part A. So “I’m just claiming Social Security, I’m not touching Medicare” is a contradiction that ends HSA eligibility and triggers the backdate on the SS claim date.

The third miss: the lookback only applies when you enroll after 65. If you enroll in Medicare during your Initial Enrollment Period at exactly 65, there is no retroactive window to worry about — eligibility simply ends the first day of your Medicare-effective month. The trap is specifically a late-enrollment phenomenon.

You can still spend the HSA forever

Losing the ability to contribute is not the same as losing the account. After 65, your HSA remains a powerful tool:

  • Medicare premiums are qualified expenses. Under IRC §223(d)(2)(C), you can reimburse yourself tax-free for Part B (about $185/month base in 2026), Part D, and Medicare Advantage premiums — though not Medigap/supplemental premiums.
  • Out-of-pocket medical costs stay tax-free. Deductibles, copays, dental, vision, hearing aids — all qualified.
  • Non-medical withdrawals lose the 20% penalty. After 65 they’re taxed as ordinary income only, exactly like a traditional IRA distribution.
  • Long-term-care insurance premiums are reimbursable up to age-based limits under §223(d)(2)(C) — a use case that often matters most right when contributions stop.

The decision lever

This is a calendar problem with a calendar fix. Pick your Medicare-effective date first, count back six months, and make that month your final HSA contribution — for you and your employer. If you’re mid-year, prorate the annual limit to your eligible months and ignore the last-month rule entirely in your final working year. The difference between getting the date right and getting it wrong is not a rounding error: it’s the gap between $5,400 of triple-tax-advantaged savings and $270 a year of recurring excise tax on money you can’t deduct. Set the stop date the day you choose your retirement date, not the day you file for Medicare.

Join the 2026 tax newsletter

Decision checklists + key 2026 federal/state numbers. Free, one click.

Found this useful? Share it.
Share

Frequently asked

No. Once you are enrolled in any part of Medicare — including premium-free Part A — you are no longer an eligible individual under IRC §223(c)(1) and cannot make or receive HSA contributions. Your eligibility ends the first day of the month your Medicare coverage is effective. You can still spend the existing balance tax-free on qualified medical expenses for life.

When you enroll in Medicare after age 65, the Social Security Administration backdates Part A entitlement up to 6 months (but never before the month you turned 65). CMS treats you as covered by Medicare during that retroactive window, so under IRC §223(c)(1) you stop being an ‘eligible individual’ for those months and any HSA contributions made in them become disqualified excess contributions.

Stop all contributions at least 6 full months before your Medicare effective date or your Social Security claim date, whichever is first. Because Part A backdates up to 6 months, contributing within that window is retroactively disqualified. If you enroll effective July 1, your last eligible contribution month is the prior December — prorate the annual limit to the months before that.

Excess HSA contributions are subject to a 6% excise tax under IRC §4973, charged on Form 5329 every year the excess remains in the account — not just once. On $5,000 of excess that is $300 per year, indefinitely, until you withdraw the excess plus its earnings or absorb it against a future year’s contribution room.

Yes — if you also delay Medicare. Claiming Social Security after 65 automatically enrolls you in Part A, ending HSA eligibility. By delaying both Social Security and Medicare while you stay on qualifying employer HDHP coverage, you remain an eligible individual under §223 and can keep contributing the full 2026 limit ($4,400 self-only / $8,750 family).

Withdraw the excess plus all attributable earnings before your tax-filing deadline including extensions (generally October 15). Use a Form 5329 / corrective-distribution request with your HSA custodian. Done in time, you avoid the 6% excise tax; the earnings are taxable in the year withdrawn. If you miss the deadline, the 6% under §4973 applies for that year and recurs annually.

Yes. Medicare ends your ability to contribute, not to spend. After 65 you can withdraw HSA funds tax-free for qualified medical expenses — including Medicare Part B, Part D, and Advantage premiums (but not Medigap) under IRC §223(d)(2)(C). Non-medical withdrawals after 65 are taxed as ordinary income with no 20% penalty.

Free newsletter

Join the Life Money USA newsletter

Decision checklists, 2026 federal + state numbers, and our glossary. One click, free.

Join the newsletter