HSA Rules

HSA + Medicare: The 6-Month Lookback Rule

By Scott Judson  ·  April 28, 2026  ·  5 min read

If you delay Medicare past age 65 and keep contributing to your HSA, there's a quiet trap waiting for you. When you finally do enroll in Medicare or claim Social Security, Part A enrollment is automatically backdated up to six months. Any HSA contributions you made during that backdated window become excess — taxed as income plus a 6% excise tax for every year they sit there.

Here's how the rule actually works and exactly when to stop contributing.

How the Lookback Works

Once you turn 65, Medicare Part A is available to you free of charge. If you sign up for Social Security at any point after that, the SSA automatically enrolls you in Part A — and per Medicare rules, that enrollment is backdated to whichever is later: your 65th birthday or six months before you applied. A few specifics:

The Trap, Illustrated

Suppose you turn 65 in January 2026, keep working, and stay on your employer's HDHP. You contribute the family max — $8,750 — through payroll all year. In December 2026 you decide to retire and apply for Social Security. Part A is backdated to July 2026 (6 months earlier).

Now: every contribution you made July through December 2026 is an "excess" contribution. You owe income tax on those amounts plus a 6% excise tax until the excess is withdrawn. On a $4,375 half-year contribution, that's potentially $1,000+ in unexpected tax — and more for every year the excess sits there.

The Fix: Stop 6 Months Before

The clean rule: stop HSA contributions at least six months before you plan to enroll in Medicare or apply for Social Security. Concretely:

If your contributions are payroll-deducted, change your election with HR. If you contribute personally, just stop the deposits.

What Doesn't Trigger the Lookback

Common Scenarios

Situation HSA Contribution Stop Date
Enrolling in Medicare at 65The month you turn 65 (no lookback if on time)
Applying for SS at 676 months before applying (so age 66.5)
Working past 65 with HDHP, no MedicareKeep contributing — until you enroll
Already on Social Security at 65Stop contributing immediately (Part A is automatic)

Already Made Excess Contributions?

If you find out after the fact, withdraw the excess (plus earnings on it) before your tax filing deadline to avoid the 6% excise tax. Your HSA custodian has a "removal of excess contribution" form. The earnings come out as taxable income, but the penalty stops accruing.

The Bottom Line

The 6-month lookback is the most-missed HSA rule for people approaching retirement. If you're 64 and planning your transition, mark your calendar six months before whichever Medicare or Social Security event comes first, and stop contributions then. For the broader retirement-era HSA strategy, see HSA as a stealth retirement account and HSA strategy by decade. And if you're still confirming eligibility today, run the HDHP rule checklist.

Track Every HSA-Eligible Expense

Reimbursable automatically finds and logs your qualified medical expenses so you never leave money on the table.

Start Free →

Related Articles