Quick Answer
You can't contribute to an HSA for any month you're enrolled in Medicare, but the account stays yours and you can keep spending from it. Turning 65 doesn't end contributions. Enrolling does, in any part of Medicare. If you sign up for premium-free Part A after 65, Medicare backdates the coverage by up to six months, and the IRS treats HSA contributions for those months as excess.
In the year Medicare starts, your contribution limit is prorated by the months before it began. After that, withdrawals for qualified medical expenses are still free of federal tax, and once you're 65 the account can also pay Medicare premiums other than Medigap.
Turning 65 Doesn't Stop Contributions, Enrolling Does
The tax code sets your HSA contribution limit to zero starting with the first month you're "entitled to benefits under" Medicare. That's section 223(b)(7). Notice 2004-50, Q&A 2, explains what the phrase means: "mere eligibility for Medicare does not make an individual ineligible to contribute to an HSA." You have to be enrolled.
The notice's example is a 66-year-old covered by her employer's high-deductible health plan who hasn't applied for Medicare. She can still contribute. Q&A 3 says someone in that position can make the $1,000 catch-up contribution too.
Three things decide whether you're enrolled:
- Any part of Medicare counts: Notice 2004-50, Q&A 4, says a retiree enrolled in Part B but not Part A can't contribute. Notice 2008-59, Q&A 6, says the same about Part D "or any other Medicare benefit."
- Social Security brings Medicare with it: In Notice 2004-50's second example, a person turns 65, "applies for and begins receiving Social Security benefits," and "is automatically enrolled in Medicare." Medicare.gov says, "If you're getting benefits from Social Security (or the Railroad Retirement Board) at least 4 months before you turn 65, you'll automatically get Part A coverage." For people who apply later, it says, "You'll get Part A automatically once you start getting benefits." So if you're already drawing Social Security when you turn 65, your contributions end with the month Medicare starts. If you claim it later, they end when Part A starts, which can be up to six months before you apply.
- The other HSA requirements still apply: You still need high-deductible health plan coverage and no other coverage that disqualifies you.
Whether to delay Medicare at all is a bigger decision than the HSA. Medicare.gov's page on working past 65 covers when you can wait without a late enrollment penalty, which depends on your employer coverage. Settle that first.
The Six-Month Lookback
This is the rule that catches people who kept working past 65. Under the heading "Signing up for premium-free Part A later," Medicare.gov says, "You can sign up for Part A any time after you turn 65. Your Part A coverage starts 6 months back from when you sign up or when you apply for benefits from Social Security (or the Railroad Retirement Board). Coverage can't start earlier than the month you turned 65."
Publication 969 connects that to your HSA. After saying your limit is zero once you're enrolled, it adds, "This rule applies to periods of retroactive Medicare coverage. So if you delayed applying for Medicare and later your enrollment is backdated, any contributions to your HSA made during the period of retroactive coverage are considered excess."
So the months that count against you can begin half a year before you fill in the application. Medicare.gov's advice for people with an HSA is that "you and your employer should stop contributing to your HSA 6 months before you retire or apply for benefits from Social Security (or the Railroad Retirement Board)."
Three details:
- It's about premium-free Part A: That's the Part A you don't pay a monthly premium for. If you'd pay a premium for Part A, Medicare.gov says coverage starts based on the month you sign up.
- The lookback can be shorter: Coverage can't start before the month you turned 65, so if you apply within six months of that month, the backdating stops there. Medicare.gov adds that if your birthday is on the first of the month, coverage starts the month before you turn 65.
- Go by the date Medicare gives you: Your Medicare card lists the date Part A starts. Use that date to count your eligible months.
How Much You Can Contribute in the Year Medicare Starts
Publication 969 gives this example: "You turned age 65 in July 2025 and enrolled in Medicare. You had an HDHP with self-only coverage and are eligible for an additional contribution of $1,000. Your contribution limit is $2,650 ($5,300 × 6 ÷ 12)." Six months before Medicare means six-twelfths of the yearly limit, catch-up included.
The Form 8889 instructions work the same way. Their line 3 chart goes month by month and starts with the question, "Were you enrolled in Medicare for the month?"
For 2026 the limits are $4,400 for self-only coverage and $8,750 for family coverage, from Revenue Procedure 2025-19, plus $1,000 if you're 55 or older by the end of the year. Here is what that leaves for someone 55 or older:
| Medicare starts | Months you could contribute | Self-only coverage | Family coverage |
|---|---|---|---|
| January 1, 2026 | 0 | $0 | $0 |
| April 1, 2026 | 3 | $1,350 | $2,437.50 |
| July 1, 2026 | 6 | $2,700 | $4,875 |
| October 1, 2026 | 9 | $4,050 | $7,312.50 |
| Not during 2026 | 12 | $5,400 | $9,750 |
The table assumes you were eligible, with the same coverage, in every month before Medicare started. Contributions from your employer count toward these limits.
The family column is a ceiling for one person, not an amount each spouse gets. If your spouse is also eligible and contributes to their own HSA, the family amount before catch-up is one limit the two of you share for the months you're both eligible. Publication 969 says it's "split equally between the spouses unless you agree on a different division." For 2027 the yearly limits are $4,500 and $9,000, from Revenue Procedure 2026-24.
Three more rules apply to that last year:
- You have until the tax deadline to make the contribution: Publication 969 says, "If you fail to be an eligible individual during 2025, you can still make contributions through April 15, 2026, for the months you were an eligible individual." The same holds a year later: the prorated amount for 2026 can go in until April 15, 2027.
- The last-month rule doesn't rescue the year: That rule treats you as eligible all year only "if you are an eligible individual on the first day of the last month of your tax year (December 1 for most taxpayers)." Someone enrolled in Medicare on December 1 isn't.
- A last-month-rule contribution from the year before can be undone: If you used that rule for the previous year, Publication 969 says you must stay eligible through a testing period that "ends on the last day of the 12th month following that month." Enrolling in Medicare before it ends fails the test. The contributions "that wouldn't have been made except for the last-month rule" go into your income with a 10% additional tax.
An Example With Backdating
You turned 65 in 2024 and kept working with self-only HDHP coverage. You retire and apply for Medicare and Social Security in the fall of 2026, and your Medicare card shows Part A starting March 1, 2026.
You were eligible to contribute for January and February only, so your 2026 limit is $900 ($5,400 × 2 ÷ 12). If you and your employer put in $450 a month through August, $3,600 went in and $2,700 of it is excess.
If You Contributed for a Month Medicare Covers
Publication 969 says excess contributions aren't deductible, and "Excess contributions made by your employer are included in your gross income." If your Form W-2, box 1, doesn't already include them, it says to report them as "Other income." It also says, "Generally, you must pay a 6% excise tax on excess contributions," figured on Form 5329, and that the tax "applies to each tax year the excess contribution remains in the account."
You can avoid the excise tax on what you take back out if you meet both of the publication's conditions:
- "You withdraw the excess contributions by the due date, including extensions, of your tax return for the year the contributions were made."
- "You withdraw any income earned on the withdrawn contributions and include the earnings in 'Other income' on your tax return for the year you withdraw the contributions and earnings."
The Form 8889 instructions list a third condition: "You do not claim a deduction for the amount of the withdrawn contributions."
In practice:
- Ask your HSA provider to remove an excess contribution: Say that's what it is. An ordinary withdrawal isn't reported the same way. A removal shows on Form 1099-SA with distribution code 2.
- Stop payroll contributions: Tell your employer the month your Medicare coverage starts, including a backdated start.
- Report it on Form 8889: Line 14b is where excess contributions withdrawn by the due date go. Our guide to reporting HSA withdrawals covers that part of the form.
Backdating can reach into a year you've already filed. Apply in May 2027, for example, and Part A can start in November 2026, after your 2026 return has gone in. The Form 8889 instructions cover that: "If you timely filed your return without withdrawing the excess contributions, you can still make the withdrawal no later than 6 months after the due date of your tax return, excluding extensions." You then file an amended return. For a 2026 return, six months after April 15, 2027 is October 15, 2027.
After that, the 6% tax applies for each year the excess stays in the account, and Publication 969 says an excess contribution taken out late "is subject to tax even if used for qualified medical expenses." That situation is worth a tax professional's time.
If Your Spouse Isn't on Medicare Yet
Medicare enrollment is per person, and so are HSAs. Publication 969 says, "Each spouse who is an eligible individual who wants an HSA must open a separate HSA. You can't have a joint HSA."
Notice 2008-59, Q&A 16, covers an eligible person whose family HDHP also covers a spouse with Medicare. That person "may contribute the § 223(b)(2)(B) statutory maximum for family coverage," but "if the spouse is not an otherwise eligible individual, no part of the HSA contribution can be allocated to the spouse."
So when one of you enrolls in Medicare and the other stays on a family HDHP without Medicare:
- The spouse without Medicare can keep contributing: Up to the family limit, into an HSA in their own name, plus their own $1,000 catch-up from age 55. In the year the other spouse enrolls, whatever that spouse contributed for the months before Medicare comes out of the same family limit.
- The spouse on Medicare can't: Not directly and not through payroll, for any month they're enrolled.
- It shouldn't matter whose employer provides the plan: Notice 2004-50, Q&A 12, defines family HDHP coverage as "a health plan covering one eligible individual and at least one other individual (whether or not the other individual is an eligible individual)." In Q&A 31, a wife is enrolled in Medicare and her husband isn't, and the notice concludes he may contribute and she may not. Neither says which spouse is the employee, so applying them either way round is our reading, not a sentence in the notices.
- Payroll can't fund the other spouse's HSA tax-free: Notice 2008-59, Q&A 26, says an employer's contribution to the HSA of an employee's spouse, including one made by salary reduction, "must be included in the gross income and wages of the employee." If the spouse on Medicare is the employee, the other spouse contributes to their own account directly.
- Either account can pay for both of you: An HSA covers the owner's spouse and dependents, whatever coverage they have.
One catch is Medicare premiums. Publication 969 says that if the account owner isn't 65 or older, "Medicare premiums for coverage of your spouse or a dependent (who is 65 or older) aren't generally qualified medical expenses." Notice 2008-59, Q&A 30, says the same. Pay the older spouse's premiums from the older spouse's HSA.
What Your HSA Still Pays For After Medicare
Notice 2004-2, Q&A 28, addresses someone who is "over age 65 and entitled to Medicare benefits" directly: "distributions used exclusively to pay for qualified medical expenses continue to be excludable from the account beneficiary's gross income."
- Medical, dental and vision costs: The definition of a qualified medical expense doesn't change. Medicare deductibles and copays, dental work, glasses and hearing aids all count. Our eligibility lookup has the common ones.
- Medicare premiums, once you're 65: HSA money generally can't pay for insurance, but Publication 969 lists an exception for "Medicare and other health care coverage if you were 65 or older (other than premiums for a Medicare supplemental policy, such as Medigap)." Notice 2008-59, Q&A 29, confirms Part D. Our page on Medicare premiums goes through each part.
- Premiums withheld from Social Security: You can reimburse yourself. Notice 2004-50, Q&A 45, says, "Where premiums for Medicare are deducted from Social Security benefit payments, an HSA distribution to reimburse the Medicare beneficiary equal to the Medicare premium deduction is a qualified medical expense."
- Not Medigap: Premiums for a Medicare supplemental policy are the stated exception to the exception.
- Anything else, with income tax: Publication 969 says, "There is no additional tax on distributions made after the date you are disabled, reach age 65, or die." A withdrawal at 67 that isn't for medical expenses skips the additional 20% tax, but it's still taxable income.
The premium exception goes by the account owner's age, not by Medicare enrollment. Notice 2008-59, Q&A 30, says, "If the account beneficiary has not attained age 65, Medicare premiums are generally not qualified medical expenses." Someone who has Medicare before 65 doesn't get the exception until they turn 65.
Receipts You Saved Before Medicare
If you've been paying medical bills out of pocket and saving the receipts, enrolling in Medicare doesn't close that window. Notice 2004-50, Q&A 39, says an HSA distribution "can be used to pay or reimburse expenses incurred in any prior year as long as the expenses were incurred after the HSA was established." Notice 2004-2, Q&A 28, says qualified distributions stay tax-free after you stop being eligible to contribute.
Read together, a bill from your working years can be reimbursed after Medicare starts. The conditions are the usual ones: the expense came after your HSA was established, nobody else reimbursed it, you didn't take it as an itemized deduction, and you kept the records. Our post on the records the IRS expects lists them.
The balance isn't frozen either. Publication 969 says, "Earnings on amounts in an HSA aren't included in your income while held in the HSA." That's the federal rule. California taxes HSA earnings each year, and we haven't checked every other state.
For many people retirement is when those saved receipts get used. The HSA shoebox strategy post covers how delayed reimbursement works and when it isn't worth doing.
Common Questions
Can I contribute to an HSA after I turn 65?
Yes, if you aren't enrolled in any part of Medicare and you still meet the other requirements, including HDHP coverage. The $1,000 catch-up contribution applies too.
Does Part A alone stop HSA contributions?
Yes. Notice 2004-50, Q&A 2, lets a person contribute only "until the month that individual is enrolled in Medicare," and it names Part A and Part B. Premium-free Part A counts, even if your employer's plan is still your main coverage.
Can my employer keep contributing after I enroll?
Not for months you're enrolled. Employer contributions count toward your limit, and Publication 969 says excess contributions made by your employer are included in your gross income.
Do I have to close or empty my HSA when Medicare starts?
No. Only contributions stop. Withdrawals for qualified medical expenses stay free of federal tax under Notice 2004-2, Q&A 28.
Can I pay Medigap premiums from my HSA?
No. Publication 969's premium exception leaves out "a Medicare supplemental policy, such as Medigap."
My spouse is on Medicare and I'm not. Can I still contribute?
Yes, if you're otherwise eligible. With family HDHP coverage, Notice 2008-59, Q&A 16, allows the family maximum. It goes into your own HSA.
Final Thoughts
Medicare ends HSA contributions, and it doesn't end the HSA. Before you apply for premium-free Part A or Social Security, count back six months, stop contributions for those months, and prorate that year's limit. After you're enrolled, the account keeps paying for medical expenses and Medicare premiums other than Medigap, and the receipts you saved earlier can still be reimbursed.
Everything above is federal. State rules can differ, and California's do.
Sources
- IRS Publication 969: Health Savings Accounts and Other Tax-Favored Health Plans (2025 edition)
- Instructions for Form 8889 (2025 edition)
- IRS Notice 2004-2: Health Savings Accounts
- IRS Notice 2004-50: Health Savings Accounts, Additional Q&As
- IRS Notice 2008-59: Health Savings Accounts
- Rev. Proc. 2025-19: 2026 inflation-adjusted amounts for HSAs
- Rev. Proc. 2026-24: 2027 inflation-adjusted amounts for HSAs
- 26 U.S. Code § 223: Health savings accounts
- Medicare.gov: When does Medicare coverage start?
- Medicare.gov: Working past 65
- Medicare.gov: How do I sign up for Medicare?
This article is for informational purposes only and does not constitute tax or legal advice. Consult a licensed tax professional for advice specific to your situation.
Shoebox keeps your HSA receipts in one place so they're ready when you reimburse yourself, whether that's next year or after you retire. It costs $60 a year, with a 30-day trial and no card required. Start your free trial


