Guides · Medicare lookback

The Medicare 6-month lookback that erases HSA contributions

This is the highest-stakes, most-often-wrong part of HSA planning near 65 — and the reason a wrong "you can contribute" can cost a real person a penalty. Here's how the timing actually works.

Any Medicare enrollment sets your contribution limit to zero

From the first month you are enrolled in any part of Medicare — Part A, B, C, or D, including premium-free Part A — your HSA contribution limit for those months is $0. This is a contribution rule, not a spending rule: you can still spend an existing HSA balance tax-free forever, including on Medicare Part A, B, and D premiums (but not Medigap). Contributing and spending are separate gates. That distinction is where a lot of confusion starts — being on Medicare does not "freeze" your account; it only stops new deposits.

Part A backdates up to six months — but never before you turned 65

Here is the trap the ranking calculators miss. When you enroll in Medicare Part A after your 65th birthday, coverage is made retroactive by up to six months — but never earlier than the month you turned 65. So your real "stop contributing" date is keyed to your Medicare (or Social Security) application month minus six, not to the future coverage start date you might have in mind.

Worked example: say you turn 65 in July 2026 and apply for Medicare in July 2026. The lookback backdates Part A six months, but the floor is the month you turned 65 — so Part A is treated as effective July 2026. Your last HSA-eligible month is June, giving you six eligible months, or 6/12 of the annual limit. If instead you had turned 65 in January and applied in July, the six-month backdate would land in January, and the whole year could be wiped out. Any contributions dated after your last eligible month become excess contributions, taxed at 6% per year (reported on Form 5329) until you withdraw them plus earnings.

The catch-up prorates too

In a partial year, the age-55+ $1,000 catch-up is not a flat add-on — it prorates on the same eligible-months fraction as the base limit. Turn 65 mid-year with six eligible months and a self-only limit plus catch-up of $5,400, and your ceiling is $2,700, not $4,400 + $1,000. Many competitor tools leave the catch-up whole; that overstates your room.

Claiming Social Security at 65 forces Part A — and you can't opt out

If you are 65 or older and collecting Social Security, you are automatically enrolled in premium-free Part A and cannot decline it while drawing benefits. Filing for Social Security at 65 therefore silently ends HSA eligibility — often retroactively, through the same six-month lookback. The only escape is to withdraw the Social Security application (Form SSA-521): it's a once-per-lifetime move, available within 12 months of filing, and requires repaying all benefits received. Merely suspending benefits does not restore HSA eligibility. If you're deciding when to claim, this interaction belongs in the decision — see our sibling tool 62vs70.com.

The legitimate way to keep contributing past 65

You can keep funding an HSA after 65 only if all three hold: you delay every part of Medicare (including premium-free Part A), you are not drawing Social Security, and you stay on an active group HDHP at an employer with 20 or more employees (where the group plan is the primary payer). At an employer with fewer than 20 employees, Medicare becomes primary at 65 and Part A is effectively required, so contributions generally must stop. COBRA and retiree coverage do not qualify. And the six-month lookback still applies whenever you eventually enroll, so plan your final contributions to land before your application month minus six.

Don't reach for the last-month rule near 65

Being HSA-eligible on December 1 normally lets you fund the full annual limit for that year — but only if you stay eligible through a 13-month testing period (December 1 of the contribution year through December 31 of the following year). Anyone who hits 65 or Medicare inside that window fails the test and owes income tax on the excess plus a distinct 10% additional tax (not to be confused with the 20% penalty on non-qualified distributions before 65, or the 6% excise on excess contributions — three different numbers). Near Medicare, default to month-by-month proration instead. That's exactly what our calculator does.

See your stop-contributing date

The 2026 HSA Triple-Tax Optimizer asks where you are with Medicare and Social Security, applies the six-month lookback, prorates the base and the catch-up, and shows your exact last eligible month. Related reading: what the 2026 OBBBA law changed and the CA/NJ state tax.

!

Reflects current federal law as of June 1, 2026. The $0-on-Medicare rule, the six-month Part A lookback, and the SSA-521 withdrawal process are longstanding; the 2026 dollar figures come from IRS Rev. Proc. 2025-19. Medicare enrollment rules and Social Security decisions are individual — verify timing with the SSA and confirm with a tax professional. This guide is educational, not advice; see our disclaimer.

Sources: IRS Pub 969 (HSA eligibility, excess-contribution excise, last-month rule); IRS Form 8889 instructions; IRS Rev. Proc. 2025-19 (2026 limits); SSA "When to sign up for Medicare"; SHRM, "Medicare's 6-month lookback and HSA contributions."