Age and enrollment
HSAs and Medicare
Last reviewed: November 23, 2026. Figures cited to official sources below.
Medicare enrollment, not your 65th birthday alone, is what sets the contribution limit to zero for a month.
Draft 2026 Publication 969 says that beginning with the first month you are enrolled in Medicare, your contribution limit is zero. The rule applies to periods of retroactive Medicare coverage. If you delay filing for Medicare and later your enrollment is backdated, contributions made during that backdated period are considered excess contributions.
Retroactive Part A can reach back into months you already funded
Social Security — not the IRS — decides how far back Medicare Part A enrollment can be dated when you apply. That lookback can cover earlier months in the year you file (Social Security’s own rules control the length). The HSA result is in Publication 969: every month of that retroactive enrollment has a contribution limit of zero, even if you were still on an HDHP and still contributing at the time.
Publication 969’s example is the mid-year case: you turn 65 in July, enroll in Medicare, and had self-only HDHP coverage plus the $1,000 catch-up. The publication prorates the annual cap (including the catch-up) by the eligible months before enrollment. Use the limits for the year you are filing, not the figures in a prior-year example, when you do your own math. For 2027 the self-only cap is $4,500 plus $1,000 catch-up if you qualify.
If retroactive enrollment turns earlier deposits into an excess, withdraw the excess plus attributable earnings by the due date of your return, including extensions, as described on our correction page. Leaving the excess in the account can trigger the 6% excise tax for each year it remains.
You may keep the HSA and use it for qualified medical expenses, including certain insurance after age 65 other than Medigap. Medicare premiums for a spouse who is 65 are generally not qualified expenses if the HSA account beneficiary has not yet reached 65. The additional 20% tax on non-qualified withdrawals does not apply after you reach 65, though income tax still can.
You do not have to close the account when you go on Medicare. You simply stop contributing for those months. If you are still under 65 and need eligible coverage before Medicare starts, we mainly quote HSA-eligible plans. Premium tax credits are available only if you enroll through the Marketplace, and one path is not automatically cheaper than the other.
If you still need HSA-eligible coverage before Medicare enrollment, get an HSA plan quote. Premium tax credits are available only if you enroll through the Marketplace.
Source: draft 2026 Publication 969 (draft) (enrollment, retroactive coverage, and the mid-year example; insurance after age 65). Contribution figures: Rev. Proc. 2026-24. Social Security’s enrollment timing is a Social Security question, not an IRS publication.
Eligible HSA contributions can reduce your federal taxable income. See whether an HSA is tax deductible and the HSA tax guides.
Common questions
Can I keep the HSA after I enroll in Medicare?
Yes. You can keep and spend the account. You just cannot make new contributions for months of Medicare enrollment.
What if Medicare Part A is dated earlier than the month I applied?
Publication 969 treats those retroactive months as months of Medicare enrollment. The contribution limit for them is zero, and contributions made during the backdated period are excess contributions. Social Security decides how far back enrollment can be dated.
What if my spouse is still working and has an HSA?
Your Medicare enrollment does not automatically end your spouse’s eligibility. Each person is tested separately, and catch-up contributions must go into each eligible spouse’s own account.
Is an HSA tax deductible?
Yes, at the federal level, if you are an eligible individual. Contributions you make are generally deducted on Form 8889 as an adjustment to income. Employer contributions are usually excluded from wages instead.
Keep reading
Get an HSA plan quote
Share your ZIP and coverage type. It takes about 60 seconds and does not commit you to buy. Premium tax credits are available only if you enroll through the Marketplace.
Get an HSA plan quoteGet a quote on an HSA-eligible plan
Takes about 60 seconds. We’ll look at HSA-eligible plans in your ZIP. Premium tax credits are available only if you enroll through the Marketplace. Submitting is optional — the guides stay free to read.
Step 1 of 4