Licensed in 40+ states · Independent · BBB Accredited A+ Call or text (773) 657-9140 · Mon–Fri 9am–6pm · Sat–Sun 9am–1pm CT

Blog / Medicare

HSA and Medicare: the 6-month rule, when to stop contributing, and what HSAs can pay for

Medicare ends HSA contributions, and the 6-month Part A rule catches many people off guard. Use the calculators to find your stop date, your last-year limit and how long your balance can cover premiums.

The short answer

Once you enroll in any part of Medicare, you and your employer must stop HSA contributions. If you sign up after 65, Part A starts up to 6 months before you apply, so stop contributing about 6 months ahead. You can keep using the account tax-free for Part B, Part D and Medicare Advantage premiums, but not for Medigap premiums.

  • Stop: any Medicare enrollment, even Part A alone, ends HSA contributions from you and your employer.
  • 6-month rule: Part A backdates up to 6 months when you apply after 65, but never before the month you turned 65.
  • Limits: $4,400 self-only and $8,750 family in 2026; $4,500 and $9,000 in 2027; plus $1,000 at 55 or older.
  • After 65: Part B, Part D, Medicare Advantage premiums and IRMAA are qualified expenses; Medigap premiums are not.

Applies to anyone with a Health Savings Account who is 63 or older, still working, or about to apply for Medicare or Social Security. Tax results depend on your situation, so confirm amounts with a tax professional.

Can you contribute to an HSA once you’re on Medicare?

No. Once you are enrolled in any part of Medicare, including Part A alone, you can no longer put money into a Health Savings Account, and neither can your employer. The account itself stays yours, and you can keep spending from it.

Turning 65 does not end contributions by itself. What ends them is Medicare enrollment. If you are still working, still on an HSA-eligible plan and not enrolled in Medicare, you can keep contributing past 65. Our guide to working past 65 and Medicare covers when delaying Medicare is allowed.

What is the HSA 6-month rule?

When you sign up for Medicare after 65, Part A starts up to 6 months before the month you apply, but never before the month you turned 65. The IRS treats you as covered by Medicare for those backdated months, so any HSA contributions made during them become excess contributions.

Here is how it plays out. Say you turned 65 in 2025, keep working, and apply for Medicare in September 2027. Part A reaches back to March 2027. Your last month of HSA eligibility is February 2027, so contributions made from March onward, including your employer’s deposits, have to come back out.

This is why people often say to stop contributions 6 months before you apply. If you enroll in Medicare right when you first turn 65, there is no backdating to worry about, because Part A cannot start before the month you turned 65.

Calculator

When to stop HSA contributions, and your last-year limit

When exactly should you stop contributing?

It depends on how and when your Medicare starts. The table shows the common situations.

Your situation When Medicare starts When to stop HSA contributions
You sign up for Medicare during your Initial Enrollment Period at 65 The month you turn 65, or later if you sign up after that month By the month before Medicare starts
You keep working past 65 and apply for Medicare later Part A backdates up to 6 months, not before 65 About 6 months before the month you apply
You apply for Social Security retirement benefits after 65 Part A starts automatically and backdates up to 6 months About 6 months before you apply for benefits
You already get Social Security when you turn 65 Part A starts automatically the month you turn 65 By the month before you turn 65

Remember to stop payroll contributions and ask your employer to stop its deposits too. Employer money counts toward the same limit.

How much can you contribute in your last year?

You can contribute one-twelfth of the annual limit for each month you were eligible. For 2026 the limit is $4,400 for self-only coverage and $8,750 for family coverage. For 2027 it rises to $4,500 and $9,000. If you are 55 or older, add $1,000.

So if your last eligible month in 2027 is June and you have self-only coverage, your 2027 limit is 6/12 of $5,500 (including the catch-up), or $2,750. There is also a “last-month rule” that can allow a full year’s contribution, but it requires you to stay eligible for a 12-month testing period afterward. Enrolling in Medicare breaks that test, so for people heading to Medicare the monthly proration is usually the safer path.

What if you already contributed too much?

Ask your HSA custodian for a removal of excess contributions, plus any earnings on that money, before your tax filing deadline, including extensions. Done in time, you avoid the 6 percent excise tax that applies each year excess money stays in the account.

The removed contributions are reported on your tax return, and the earnings are taxable. Tell your custodian it is an excess removal, not a regular withdrawal, so it is coded correctly. Your tax professional can confirm the forms for your situation.

Can you turn down Part A to keep your HSA?

Not if you are collecting Social Security retirement benefits. Part A comes with those benefits. To drop Part A, you would have to withdraw your Social Security application and pay back the benefits you received, which rarely makes sense.

If you have not claimed Social Security yet and are still working with employer coverage, you can simply wait to apply for either one. When you do apply, the 6-month backdating applies to both. Read more on how Medicare works with Social Security.

What can your HSA pay for after 65?

After 65, your HSA can pay premiums for Part B, Part D and Medicare Advantage, including any income-related amount (IRMAA), plus deductibles, copays, dental, vision and hearing costs, all tax-free. Medigap premiums are the notable exception: they are not a qualified expense.

You can also reimburse yourself for Part B premiums that were withheld from your Social Security check. After 65, you can take money out for anything, without the 20 percent penalty that applies before 65, but non-medical withdrawals are taxed as income. Pick an expense below to check the rule.

Quick check

Can my HSA pay for this after 65?

Many people save their HSA specifically for retirement premiums. The planner below shows roughly how long a balance could cover them.

Planner

How many years of Medicare premiums will your HSA cover?

What about your spouse’s HSA?

Your spouse’s eligibility is separate from yours. A younger spouse who is not on Medicare and has their own HSA-eligible coverage can keep contributing, including family coverage if the plan covers other family members. If you are both 55 or older, each of you needs your own HSA to make the $1,000 catch-up contribution.

Once you, the account owner, are 65 or older, your HSA can also pay your spouse’s Medicare premiums tax-free. If you are under 65, it cannot, even if your spouse is on Medicare.

What should employers do when an employee enrolls in Medicare?

Stop the employer’s HSA deposits for that employee as of the first month of Medicare coverage, and remember that Part A can be backdated. Ask employees who are 64 or older to tell HR before they apply for Medicare or Social Security, so payroll can stop contributions in time.

If you are weighing an HSA against a reimbursement arrangement for your team, see our HSA vs HRA guide for small businesses.

Before you apply for Medicare with an HSA

  1. Pick your Medicare start date, then count back 6 months (not earlier than the month you turned 65).
  2. Stop your payroll HSA contributions and ask HR to stop employer deposits by that month.
  3. Use the calculator above to check your prorated limit for the year.
  4. If you went over, ask your custodian for a removal of excess contributions before your tax deadline.
  5. Keep receipts for Medicare premiums and medical costs so you can reimburse yourself tax-free later.

Questions people ask

Can I contribute to an HSA if I'm 65 but not on Medicare?

Yes. Age alone does not end eligibility. If you are covered by an HSA-eligible health plan, have no other disqualifying coverage and are not enrolled in any part of Medicare, you can keep contributing, including the $1,000 catch-up.

Does enrolling in Part A alone stop HSA contributions?

Yes. Enrollment in any part of Medicare, including Part A with no premium, ends your ability to contribute. It does not affect money already in the account.

Can my employer keep funding my HSA after I enroll in Medicare?

No. Employer contributions count toward your limit, so they must stop once your Medicare coverage starts, including any backdated months.

Can I pay Medigap premiums with my HSA?

You can, but they are not a qualified medical expense, so the withdrawal is taxable income. Part B, Part D and Medicare Advantage premiums are qualified once you are 65.

Can I pay IRMAA from my HSA?

Yes. The income-related monthly adjustment amount is part of your Part B and Part D premium, so it counts as a qualified expense once you are 65.

Can I reimburse myself for Part B premiums taken out of my Social Security?

Yes. Keep your annual Social Security benefit statement as the record, and you can reimburse yourself from the HSA tax-free for those premiums.

What happens to my HSA when I die?

If your spouse is the beneficiary, the account becomes your spouse's HSA. For anyone else, the account stops being an HSA and its value is generally taxable income to the beneficiary in that year.

Is there a penalty for non-medical withdrawals after 65?

No penalty after 65, but non-medical withdrawals are taxed as ordinary income. Before 65, they are taxed and hit with a 20 percent penalty.

Does applying for Social Security affect my HSA?

Yes. Applying for retirement benefits at 65 or later enrolls you in Part A, which can backdate up to 6 months. Stop contributions about 6 months before you apply.

Should I spend down my HSA before Medicare?

There is no need to. The balance keeps its tax-free status for qualified expenses, and after 65 it can pay Medicare premiums, which many people plan around.

How do I fix excess HSA contributions?

Ask your custodian to process a removal of excess contributions, plus earnings, before your tax filing deadline. Otherwise a 6 percent excise tax applies for each year the excess stays in the account.

Can I use my HSA for my spouse's Medicare premiums?

Yes, if you, the account owner, are 65 or older. If you are under 65, your spouse's Medicare premiums are not a qualified expense.

Sources

  1. IRS, Publication 969: Health Savings Accounts and Other Tax-Favored Health Plans, accessed September 26, 2026
  2. IRS, Revenue Procedure 2026-24 (2027 HSA and HDHP limits), May 29, 2026
  3. Medicare.gov, Working past 65, accessed September 26, 2026
  4. Social Security Administration, Medicare Part A and retirement benefits, accessed September 26, 2026

Planning your Medicare start date around an HSA?

Send us your birthday, your planned retirement date and whether your employer funds your HSA, and a licensed advisor will map your stop date and Medicare deadlines within one business day. No obligation.

Map my HSA stop dateCall or text (773) 657-9140

Smart Insurance Agents LLC is an independent, licensed insurance agency and is not connected with or endorsed by the U.S. government or the federal Medicare program. We do not offer every plan available in your area. Please contact Medicare.gov, 1-800-MEDICARE, or your local State Health Insurance Assistance Program for information on all of your options. Content is for general information and is not a guarantee of coverage or rates; figures are subject to change by CMS and carriers.