Enrolling in Medicare ends your ability to contribute to a Health Savings Account, but it does not touch the money already in the account. That is the short version of how HSA and Medicare interact: the balance stays yours, still grows tax-free, and still pays qualified medical costs tax-free, but new contributions stop the month your Medicare coverage begins. For 2026, walking away from HSA contributions means giving up as much as $4,400 in tax-deductible savings on self-only coverage or $8,750 on family coverage, plus a $1,000 catch-up if you are 55 or older and still eligible.1IRS.gov. Expanded Availability of Health Savings Accounts Under the One, Big, Beautiful Bill Act (OBBBA) Notice 2026-52Internal Revenue Service. HSA Contribution Limits – IRS Courseware – Link and Learn Taxes The transition is unforgiving on timing, and most of the penalties people run into are avoidable if you know when your Medicare coverage actually starts.
Being Eligible for Medicare Is Not the Same as Being Enrolled
Turning 65 does not, by itself, end your HSA eligibility. The Internal Revenue Code sets your HSA contribution limit to zero starting with the first month you are “entitled to benefits” under Medicare, and that phrase means enrolled, not merely old enough to enroll.3Office of the Law Revision Counsel. 26 USC 223 – Health Savings Accounts If you are 67, still working, covered by an employer HDHP, and you have not filed for Medicare or Social Security, your HSA contributions remain fully deductible.
One situation removes that choice. If you were already collecting Social Security benefits before turning 65, Social Security enrolls you in premium-free Part A automatically at 65, and you cannot opt out. Contribution eligibility ends the first day of the month you turn 65.4Social Security Administration. When to Sign Up for Medicare
Watch the birthday-on-the-first quirk. If your 65th birthday falls on the first day of a month, Part A coverage starts the first day of the previous month. Someone born December 1 has a Medicare effective date of November 1.5Centers for Medicare & Medicaid Services. Original Medicare (Part A and B) Eligibility and Enrollment Confirm your exact effective date with Social Security before making contributions in the months around your birthday.
The Six-Month Retroactive Part A Trap
This is the mistake that costs people the most. If you delayed Medicare past 65 while continuing to contribute to an HSA, and you later apply for Social Security retirement benefits, Social Security automatically enrolls you in premium-free Part A and backdates the enrollment up to six months, though never earlier than the month you turned 65.4Social Security Administration. When to Sign Up for Medicare
Backdating retroactively kills your HSA eligibility for those months. Every contribution you or your employer made during that window becomes an excess contribution, and the IRS charges a 6% excise tax on excess amounts each year they sit in the account.6Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans Apply for Social Security in November, and your Part A effective date is May 1. Every dollar contributed May through November is excess.
The practical rule: stop all HSA contributions at least six months before the month you plan to apply for Social Security or Medicare Part A.4Social Security Administration. When to Sign Up for Medicare That includes payroll contributions and any employer match, both of which count against your limit.
The IRS “last-month rule” is a related hazard. It lets you contribute a full year’s amount if you are HSA-eligible on December 1, but only if you stay eligible through the end of the following December. Fail that testing period and you owe income tax plus a 10% penalty on the excess.6Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans If Medicare enrollment is anywhere in the next 13 months, do not use this rule. Pro-rate instead.
Pro-Rating Your Contribution in the Enrollment Year
The year you enroll, your HSA contribution limit is based only on the months you were still eligible. Divide the annual limit by 12 and multiply by the number of eligible months. The $1,000 catch-up amount pro-rates the same way.7Internal Revenue Service. Publication 969 Health Savings Accounts and Other Tax-Favored Health Plans
Say you have self-only HDHP coverage and your Part A effective date is July 1, 2026. You were eligible January through June, six months. Your 2026 limit is $4,400 × 6 ÷ 12 = $2,200. Add $1,000 × 6 ÷ 12 = $500 for the catch-up, and the total is $2,700. Anything above that is excess.7Internal Revenue Service. Publication 969 Health Savings Accounts and Other Tax-Favored Health Plans The month Medicare coverage begins counts as ineligible, not eligible. If Part A starts July 1, July does not count.
What You Can Still Do With the Account After Enrolling
The account itself keeps working. Existing balances grow tax-free and pay qualified medical expenses tax-free for life, including Part A and Part B deductibles, copays, and coinsurance. Once you are 65 or older, HSA funds can also pay several kinds of insurance premiums tax-free:
- Medicare Part B and Part D premiums.
- Medicare Advantage (Part C) premiums, along with out-of-pocket costs under the plan.
- Long-term care insurance premiums, up to age-based annual limits set by the IRS.
- COBRA premiums, if you are paying for continuation coverage.
Medigap is the exception people miss. IRS Publication 969 specifically excludes premiums for a Medicare supplemental policy, such as Medigap, from qualified medical expenses.6Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans Pay Medigap premiums out of your HSA and the distribution is taxable.
Non-medical withdrawals shift after 65 as well. Before 65, non-medical withdrawals trigger income tax plus a 20% additional tax. From 65 on, the 20% penalty is gone, and non-medical withdrawals are simply taxed as ordinary income, similar to a traditional IRA.3Office of the Law Revision Counsel. 26 USC 223 – Health Savings Accounts Medical withdrawals stay tax-free.
Fixing Excess Contributions Before the 6% Bites
If you contributed during months you were actually enrolled in Medicare, those contributions are excess and the 6% excise tax applies each year they remain in the account uncorrected.6Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans
To stop the penalty, withdraw the excess plus the earnings attributable to it before your tax filing deadline, including extensions. You cannot deduct the withdrawn amount, and the earnings are reported as other income for the year the contribution was made. Already filed without fixing it? You have a second window: withdraw the excess within six months of the original due date (excluding extensions) and file an amended return with “Filed pursuant to section 301.9100-2” written at the top.8Internal Revenue Service. Instructions for Form 8889 (2025)
Form 8889 reports your HSA contributions and any timely-withdrawn excess on line 14b. Form 5329 calculates the 6% excise tax on any excess still in the account at year-end.8Internal Revenue Service. Instructions for Form 8889 (2025)6Internal Revenue Service. Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans
When the excess came from employer or payroll contributions, the fix is messier. The employer can request the money back from the HSA custodian or treat the amount as a post-tax bonus, and if the contributions were reported on your W-2 as HSA contributions you will need a corrected W-2. The 6% penalty still lands on you as the account holder if the excess is not reversed, no matter who put the money in.
If Your Spouse Enrolls in Medicare and You Don’t
One spouse’s Medicare enrollment does not affect the other spouse’s HSA eligibility. If you are under 65 and have your own qualifying HDHP coverage, you keep contributing on your own schedule regardless of what your spouse does.3Office of the Law Revision Counsel. 26 USC 223 – Health Savings Accounts
Family HDHP coverage adds a twist. The younger spouse can contribute up to the full family limit ($8,750 for 2026) to their own HSA.1IRS.gov. Expanded Availability of Health Savings Accounts Under the One, Big, Beautiful Bill Act (OBBBA) Notice 2026-5 The Medicare-enrolled spouse’s limit is zero. The rule that lets married couples divide the family limit differently only applies when both spouses are eligible individuals, so with one on Medicare the eligible spouse simply takes the full family amount in their own account.
Undoing Part A to Get Your HSA Eligibility Back
If you already enrolled in Part A and want to resume HSA contributions, you can withdraw your Part A enrollment through the Social Security Administration, as long as you have not cashed any Social Security retirement checks. You have to repay any Medicare benefits paid on your behalf during the enrollment period. Once Part A is terminated, HSA eligibility resumes the first day of the following month, assuming you still have qualifying HDHP coverage.
This route is narrow. Most people who need it enrolled in Part A without realizing it would end HSA contributions. If you are already receiving Social Security, you generally cannot drop Part A without also giving up Social Security, which closes the option for anyone past that point.