Settled YearsYour plan

Guides › Signing up

Medicare and your HSA: when to stop putting money in

Last checked October 5, 2026 against the official rules. Sources are listed at the end.

The short answer

Stop putting money into your HSA 6 months before you sign up for Medicare (or start Social Security) if that's after 65. If you sign up at 65, stop the month before Medicare starts. Part A can start up to 6 months before the day you sign up, and you can't add to an HSA once any part of Medicare has started.

The basic rule

Once you're enrolled in any part of Medicare, including Part A, you can't put new money into a Health Savings Account. You can still spend the money already in it, tax-free, on medical costs.

The 6-month look-back

When you sign up for Medicare after you turn 65, Part A is backdated up to 6 months, though never earlier than the month you turned 65. (If you were born on the 1st, that's the month before your birthday month; see born on the 1st.) Any HSA money you added during those backdated months becomes an "excess contribution." The IRS charges a 6% tax on it each year it stays in the account, unless you take it out, plus anything it earned, by your tax-filing deadline.

Example. Linda is still working at 66 and will sign up for Medicare in December 2028, when she retires.

Her Part A will be backdated to June 2028, so her last month to put money into her HSA is May 2028. Her employer should stop its HSA deposits by then too.

The Social Security catch

When you start Social Security at 65 or later, you're signed up for Part A automatically, and you can't turn it down while you're getting Social Security. If you want to keep adding to an HSA while you work, you'll need to wait to start Social Security too.

Your last year's limit is smaller

In the year Medicare starts, your HSA limit is cut by month. For example, if Part A starts in July, you can only put in 6/12 of the yearly limit (for January through June). Count employer deposits toward that limit.

What your HSA can pay for after 65

It can't be used tax-free for Medigap premiums.

What to do

  1. Work out when you'll sign up for Medicare.
  2. Count back 6 months, but not earlier than the month you turn 65. That's when Part A will start.
  3. Stop your HSA contributions, and your employer's, the month before that.

Find your last HSA month

Enter your birthday, your job's coverage and check the HSA box. We'll show the last month you can put money in.

Sources

This guide explains the general rules. It isn't legal, tax or insurance advice, and your situation may differ. Settled Years doesn't sell insurance or take commissions.

Related guides