Guides

HSAs and Medicare: when you must stop contributing

HSA contributions must stop once Medicare coverage begins, and Part A can be backdated up to six months, so stop contributing well before you enroll.

You must stop contributing to a health savings account (HSA) beginning with the first month your Medicare coverage starts, whether that is Part A, Part B or both. The trap is the look-back: if you sign up for Medicare or Social Security after turning 65, premium-free Part A can be made retroactive by up to six months, which can make contributions you already made during those months excess contributions. The safe approach is to stop contributing about six months before you plan to enroll, and to keep spending the balance, which stays yours.

Why Medicare ends HSA eligibility

An HSA can only receive contributions while you are covered by a qualifying high-deductible health plan and have no other disqualifying coverage. The IRS treats enrollment in Medicare as disqualifying coverage, so eligibility ends for each month in which you are enrolled in any part of it. This is true even if you also keep your employer's high-deductible plan.

The rule is about contributing. Everything already in your account remains yours. You can keep spending it tax-free on qualified medical expenses, including Medicare Part B and Part D premiums and Medicare Advantage premiums, but not Medigap premiums, per IRS guidance in Publication 969.

When Medicare starts

Most people become eligible at 65. The seven-month Initial Enrollment Period runs from three months before the month you turn 65 to three months after, and coverage generally starts on the first day of the month you turn 65 (the month before, if your birthday is on the first). See Medicare Initial Enrollment Period: your seven-month window for the details.

Two situations change that timing:

  • Social Security. If you are already receiving Social Security retirement benefits when you turn 65, you are enrolled in Parts A and B automatically. Applying for benefits after 65 also triggers Part A enrollment.
  • Delaying. Workers with large-employer coverage can often delay Part B without a penalty, but the same worker who signs up for Medicare Part A, which is premium-free for most people, ends HSA eligibility. To keep contributing, you generally have to delay Part A and Social Security benefits too. medicare and employer coverage: who pays first if you work past 65? explains how employer coverage and Medicare coordinate, and the late enrollment penalty describes the cost of skipping Part B without qualifying coverage.

The six-month look-back

If you enroll in premium-free Part A after the month you turn 65, coverage can start up to six months earlier than your sign-up, but not before the month you turned 65. Contributions you made in those backdated months become excess contributions, and the IRS imposes a 6% excise tax for each year the excess stays in the account unless you withdraw it (and any earnings) by the tax filing deadline.

Here is a labeled hypothetical. Say you are 66, have a high-deductible plan through work, and contribute through payroll all year. You apply for Social Security in December, and Part A is backdated to June.

  • Contributions for June through December are excess contributions, even though you made them while believing you were eligible.
  • Withdrawing the excess and its earnings by the tax filing deadline avoids the excise tax; a tax professional can walk through the forms.

Had you stopped contributions in May, nothing needed fixing. The rule of thumb is to stop at least six months before you apply for Medicare or Social Security, and to tell payroll, since employer contributions count too.

How much you can still contribute in the year you enroll

Eligibility is judged month by month, so in the year Medicare starts the contribution limit is generally prorated by the number of months you were eligible. The age 55 and over catch-up of $1,000 is prorated the same way. The "last-month rule" that allows the full limit to some people who are eligible in December does not apply in the year Medicare starts.

Say you turn 65 on July 10, 2027, so Medicare starts July 1, 2027, and you have self-only coverage. The 2027 self-only limit is $4,500, and the catch-up is $1,000.

  • Eligible months: January through June, which is 6.
  • Prorated limit: $4,500 x 6/12 = $2,250.
  • Prorated catch-up: $1,000 x 6/12 = $500.
  • Most you could contribute for 2027: $2,250 + $500 = $2,750.

The HSA contribution and tax savings calculator and the Medicare Initial Enrollment Period calculator help you work out the date. Employer contributions count toward the same limit.

If you keep working past 65

Plenty of people keep a job and an employer high-deductible plan after 65. You can keep contributing only while you have no Medicare coverage at all, which means not taking premium-free Part A and not collecting Social Security retirement benefits. If you do enroll in Part A only, to have hospital insurance as a backstop, HSA eligibility still ends. Some workers choose to enroll anyway because they would rather have Medicare as primary coverage, and others prefer to keep adding to the HSA. Both are legitimate trade-offs, and a SHIP counselor or the Social Security Administration can explain how your own employer plan coordinates with Medicare.

A checklist before you enroll

  1. Decide when you plan to start Medicare and Social Security.
  2. Subtract six months and stop HSA contributions by then, including payroll deductions and any employer deposit.
  3. Prorate the final year's limit by the months you were eligible.
  4. Keep receipts for expenses you plan to reimburse later.
  5. Ask your HSA custodian, benefits office or a tax professional about forms.
  6. Check how How a health savings account (HSA) works: limits and tax benefits handles the rest of your balance.

Your spouse's HSA is separate: a spouse who is not on Medicare and has a qualifying plan can generally keep contributing to their own account, and Publication 969 explains the family-coverage rules.

Key takeaways

  • HSA contributions must stop for every month in which you are enrolled in any part of Medicare.
  • Premium-free Part A can be backdated up to six months, so stop contributing at least six months before you apply for Medicare or Social Security.
  • In the year Medicare starts, the limit and the $1,000 catch-up are prorated by month.
  • You keep the balance and can spend it tax-free on qualified expenses, including Medicare premiums other than Medigap.
  • The IRS, your HSA custodian or a tax professional can confirm the numbers for your own return.

Terms used in this guide

Related tools

Latest on this topic