Skip to main content

Medicare · A closer look

Medicare and an HSA: The Timing That Keeps It Tax-Free

Contributing to an HSA after Medicare enrollment creates a tax problem. The date that matters is enrollment, not age.

On this page

You cannot contribute to a health savings account once you have Medicare, and the trap is that Part A can be backdated up to six months. The contributions you made just before enrolling can therefore turn out to be ineligible after the fact, which is why the timing of your last contribution matters more than the date you signed up.

The fix is mechanical rather than complicated, but it has to happen before you enroll. Once you know which month your Part A begins, you can work backward and pick a last contribution month that avoids the overlap.

The rule that ends contributions

The HSA eligibility rules and the Medicare rules meet at one point: an HSA contribution requires that you not be enrolled in Medicare. Medicare states the consequence directly: you are not eligible to make contributions to your HSA after you have Medicare.

Notice what that sentence does not say. It does not say you must close the account, and it does not say you must spend the balance. Medicare goes on to say that you can withdraw money from your health savings account after you sign up for Medicare to help pay your share of costs, like deductibles, premiums, coinsurance, or copayments.

So the rule is about contributions only. The account remains yours and remains usable. What ends is your ability to put new money in on a pre-tax basis.

The IRS frames the same condition from the tax side. Publication 969 lists the requirements to be an eligible individual for HSA contributions, and one of them is that you are not enrolled in Medicare. It also confirms the account survives: an HSA is described as portable and stays with you if you change employers or leave the work force.

Why the six-month lookback is the real problem

If Part A began exactly when you enrolled, stopping contributions before you filed would be sufficient. Part A does not always work that way.

Medicare explains that if you are 65 or older, your Part A coverage will start up to 6 months back from the date you sign up for Medicare or apply for benefits from Social Security or the Railroad Retirement Board. The coverage is retroactive, but not earlier than the first month you were eligible.

That retroactivity is what creates the tax problem. Medicare states it plainly: if your Medicare Part A coverage overlaps when you made contributions, you may have to pay a tax penalty.

An example makes the shape clear. Suppose you turn 65 in November but do not apply for Social Security benefits until July. Medicare says Part A starts six months back from when you sign up and cannot start earlier than the month you turned 65. Six months before July is January, so Part A could begin in January. Any contribution you made from January onward would fall inside a period when you were already enrolled in Medicare, even though you did not apply until July.

The six-month window moves with your application date, while the floor stays fixed at your eligibility month. Applying in the same month you turn 65 therefore produces no retroactive stretch beyond that month. The longer you wait to apply, the further back the window can reach, up to its limit.

The article is not modeling your specific dates, because the backward reach depends on when you apply and on your eligibility month. The point is that the date you apply is not the date that decides it.

The practical instruction

Medicare's own guidance resolves the ambiguity conservatively. Before you sign up, the agency states that if you have a health savings account, 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, and gives the reason: this ensures you avoid a tax penalty.

Six months before you apply covers the maximum retroactive reach. It is the safe margin, not a technicality.

Two details matter for people who are still working:

  • Your employer's contributions count too. The instruction names both you and your employer. A payroll deduction that continues after your last permissible month creates the same problem as a contribution you make yourself.
  • Payroll timing is not instant. If you ask payroll to stop in the same month you apply, a deposit may already be in flight. Build in a month of margin.

Why you might deliberately delay Part A

There is a legitimate reason to take Part A later than you otherwise might, and it is worth understanding because it runs against the usual advice.

Most people qualify for premium-free Part A, and Medicare suggests signing up at 65 even if you are still working. But if you have a high-deductible plan and a funded HSA through an employer, taking Part A ends your ability to contribute. A person with years of HSA contributions still ahead of them may prefer to keep contributing and delay Part A.

That tradeoff is real, and it is a tax decision as much as a Medicare one. It depends on how much you and your employer contribute, how long you plan to keep working, and whether you need the hospital coverage Part A provides. Our guide to working past 65 covers the employer coverage interaction that usually drives this decision.

What you should not do is take Part A and keep contributing on the assumption that nobody will notice. The IRS receives information about your Medicare enrollment, and the account custodian reports contributions.

What to do with the balance

The money already in the account is not stranded. Medicare confirms you can withdraw it for your share of costs after you enroll.

A few practical notes on using it:

  • Qualified medical expenses are tax free. Publication 969 explains that distributions used for qualified medical expenses are not taxed.
  • Non-medical withdrawals are taxable and generally carry an additional tax. That is the standard HSA treatment, so the account is not a general spending account once contributions stop.
  • You can generally use HSA funds for Medicare premiums. Publication 969 treats certain insurance premiums as qualified medical expenses in defined circumstances; confirm the specifics for your coverage before relying on it.
  • Keep records. If a distribution is questioned, the documentation is your evidence that it paid a qualified expense.

The paperwork to line up

Before you apply for Medicare, gather these and work through them in order.

  • Find your HSA balance and your year-to-date contributions, including any employer contributions. You need the total to understand what is in the account and what may need correcting.
  • Identify the month your Part A will begin, remembering it can reach back up to six months from when you apply, and no earlier than your eligibility month.
  • Pick a last contribution month at least six months before you apply, and tell payroll in writing.
  • Ask your employer to stop its contributions on the same schedule, since the instruction covers both of you.
  • Ask your plan whether it remains HSA-qualified after your enrollment month, because the coverage question and the contribution question are separate.
  • Decide whether to delay Part A if you are still working and still contributing, and treat that as a deliberate decision rather than a default.
  • Keep your contribution records for the overlapping year, since a correction may be needed at filing.

If a contribution does land in an ineligible month, the usual remedy is to remove the excess contribution and any earnings attributable to it before the tax filing deadline. That is a correction, not a disaster, but it is easier to avoid than to unwind. The IRS instructions on excess contributions in Publication 969 describe the mechanics.

Where the two decisions separate

It helps to keep three questions apart, because conflating them is what produces the surprise.

QuestionWhat governs it
Can I contribute to my HSA this month?Whether you are enrolled in Medicare that month, including any retroactive Part A
Can I keep the account and spend the balance?Yes, and Medicare confirms you can use it for your share of costs
Should I take Part A now or delay it?Whether you are still working, whether you have employer coverage, and whether you want to keep contributing

Sources for the first two rows are Medicare's working past 65 guidance and IRS Publication 969. The third row is your decision, and the tradeoff is described above.

One caution on the third row: this article is not tax advice. The contribution limit, the correction mechanics, and the interaction with your employer's plan are all facts about your situation. If you have a large balance or an employer that contributes, confirm the plan with a tax professional before your enrollment month rather than after.

If you are approaching 65 with an HSA and want to work out the timing alongside your Medicare choices, ask NavaQuote about your Medicare options. Bring your HSA statements, your expected Part A start month, and your employer coverage details. Our Medicare enrollment periods guide covers when you can sign up, and our Advantage versus Supplement guide covers the coverage decision that comes after you enroll.

Figures in this article are rules rather than amounts. Contribution limits and plan parameters are set annually, so confirm the current year's figures in the IRS guidance before you rely on any specific dollar amount.

← Back to all guides

Your next step starts here.

Let's find the right Medicare plan.

Get a free, no-obligation Medicare review from Callie.

Get Your Free Quote