Yes, you can use HSA funds to pay Medicare premiums, and the money comes out tax-free once you turn 65. That covers Part A (if you owe a premium), Part B, Part D, and Medicare Advantage (Part C). Medigap is the exception: those supplement premiums don’t qualify, even after 65. And once you enroll in any part of Medicare, you have to stop contributing to the HSA, though the money already in it stays yours to spend.
Which Medicare Premiums Qualify
IRS Publication 969 lists Medicare premiums among the insurance costs that qualify for tax-free HSA withdrawals after age 65.1Internal Revenue Service. IRS Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans Four premiums qualify:
- Part B, which covers doctor visits, outpatient services, and preventive care. Most people pay this monthly, often through a deduction from Social Security.
- Part D, prescription drug coverage. Premiums vary by plan.
- Medicare Advantage (Part C), which bundles hospital, medical, and often drug coverage into one plan from a private insurer.
- Part A, hospital coverage. Most people pay nothing for Part A because they earned enough work credits through payroll taxes, but if you do owe a Part A premium, it qualifies.
All four get the same treatment. Withdrawals to cover them come out free of income tax and free of the 20% additional tax that normally hits non-medical HSA spending before 65.
Medigap Doesn’t Qualify
Medicare Supplement Insurance, known as Medigap, is the one Medicare-related premium the IRS won’t treat as a qualified expense. The federal statute carves it out by name.2Office of the Law Revision Counsel. 26 U.S. Code 223 – Health Savings Accounts If you pull HSA money for a Medigap premium after 65, the withdrawal gets added to your taxable income for the year, but no penalty applies. Before 65, the same withdrawal would trigger income tax plus the 20% additional tax.1Internal Revenue Service. IRS Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans
This trips people up because Medigap feels like it should count. It fills gaps in Original Medicare coverage. But the tax code treats it as separate from Medicare itself, so plan around it. Medigap premiums come out of after-tax dollars.
Your Age Is What Matters, Not the Spouse’s
The rule turns on the age of the HSA owner, called the “account beneficiary” in the statute. Before you turn 65, Medicare premiums are not a qualified HSA expense at all, even for a spouse or dependent already on Medicare.1Internal Revenue Service. IRS Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans
Once you hit 65, the rule flips. You can then use your HSA to pay Medicare premiums for yourself, your spouse, and your dependents.2Office of the Law Revision Counsel. 26 U.S. Code 223 – Health Savings Accounts The 20% additional tax on non-medical withdrawals also disappears at 65. Non-medical withdrawals are still added to your taxable income, but qualified medical expenses, Medicare premiums included, stay entirely tax-free.
How to Actually Pay Yourself Back
Medicare won’t accept a direct HSA payment. Premiums are deducted from Social Security, billed by your Part D or Advantage plan, or paid by you to Medicare directly. To use HSA money, you pay the premium first, then reimburse yourself from the HSA afterward.
The mechanics are simple. Keep documentation of what you paid and when, then withdraw the same amount from the HSA. Most custodians let you transfer funds electronically to a linked bank account. No one reviews receipts at withdrawal. You keep the records in case the IRS asks. Even when your Part B premium comes out of Social Security automatically each month, you can pull the equivalent amount from the HSA tax-free.
You Can Wait Years to Reimburse Yourself
There is no federal deadline for HSA reimbursements. Pay a Medicare premium in January and reimburse yourself in December, five years later, or a decade later. The only requirement is that the HSA was already open when you incurred the expense.1Internal Revenue Service. IRS Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans
That opens up a strategy for retirees who can afford to pay medical costs out of pocket while the HSA continues growing tax-free. You accumulate years of unreimbursed premiums, then take a large tax-free withdrawal when you need cash. The catch is documentation. You have to match each reimbursement to a specific expense if audited, so keep every premium statement organized.
Stop Contributing Once Medicare Starts
Enrollment in any part of Medicare ends your HSA contribution eligibility. Part A alone is enough, even if you’re still working and covered under an employer’s high-deductible health plan. You cannot be enrolled in Medicare and make HSA contributions in the same month.1Internal Revenue Service. IRS Publication 969, Health Savings Accounts and Other Tax-Favored Health Plans
Eligibility is checked on the first day of each month, and the annual contribution limit gets prorated. If Medicare kicks in on July 1, you can contribute for January through June only. The money already in the HSA stays yours permanently. Losing the ability to contribute doesn’t affect withdrawals. Plenty of retirees spend decades drawing down HSAs they can no longer add to.
The Six-Month Lookback
This is the trap for people who work past 65. When you enroll in Medicare Part A after your 65th birthday, coverage is backdated up to six months from your application date, though never earlier than the month you turned 65. That backdating means Medicare covered you retroactively, which retroactively wipes out your HSA eligibility for those months.
Any HSA contributions during the backdated period become excess contributions. Excess contributions face a 6% excise tax every year they stay in the account. You have to withdraw the excess before your tax filing deadline to stop the penalty from compounding.
The safest move: stop HSA contributions at least six months before you apply for Medicare or claim Social Security retirement benefits. Filing for Social Security triggers automatic enrollment in Part A, which triggers the lookback.3Centers for Medicare & Medicaid Services. Get Started With Medicare – Before 65 Planning to file in October? Your last safe contribution month is March.
The clock runs from your application date, not your requested benefit start date. Applying in October with a January start date still creates a lookback from October. One month off, and you have paperwork to fix.
What to Keep in Your Records
The IRS doesn’t ask for receipts at filing. But if the return is audited, you carry the full burden of proving each distribution went to a qualified expense. For Medicare premiums, save the monthly or quarterly premium notices, documentation of any Social Security deductions, and statements from your Part D or Advantage plan. Each document should show what you paid and the coverage period.
Keep the records for at least three years after the tax filing date for the return where the distribution appears. If you’re using the delayed reimbursement strategy, hold on to the original premium documentation until three years after you file the return that claims the reimbursement, which can put you well past a decade of storage on a single expense.4Internal Revenue Service. How Long Should I Keep Records