Medicare and your HSA: why contributions stop 6 months before you sign up
General information from public Medicare.gov, CMS and IRS pages. This is not insurance, tax or medical advice, not a recommendation, and not a government site.

Short version: You cannot put money into a Health Savings Account for any month you are enrolled in Medicare. If you sign up after 65, premium free Part A usually starts up to 6 months before the month you apply, but not before the month you turned 65. That is why Medicare.gov and CMS say you and your employer should stop HSA contributions 6 months before you apply for Medicare or Social Security. You can keep spending the money already in the account.
The rule in plain words
IRS Publication 969 (the 2025 edition, opened 27 Nov 2026) lists the conditions for putting money into an HSA. One of them is short: you are not enrolled in Medicare. The section on people enrolled in Medicare adds that, beginning with the first month you are enrolled, your contribution limit is zero, and that this applies to periods of retroactive coverage. If your Medicare enrollment is backdated, contributions made during those backdated months count as excess contributions.
The backdating is the part people miss. CMS form CMS-18-F-5, the application for Part A (07/2025 version, opened 27 Nov 2026), says that if you apply after reaching 65, premium free Part A coverage starts up to 6 months back from when you apply, but not earlier than the month you turned 65. Medicare.gov’s working past 65 page, read 27 Nov 2026, turns that into a date to plan around: 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.
A worked example
Say you turned 65 in 2024, kept working with an HSA eligible plan, and plan to sign up for Medicare in July 2027. Under the CMS rule, premium free Part A could start as early as January 2027, six months back. For HSA purposes you would then be enrolled in Medicare from January 2027, so contributions should stop by the end of December 2026. Money already in the HSA stays yours. If you turned 65 in May 2027 instead, Part A could not start before May 2027, so the backdated period would be shorter.
| Coverage | 2026 limit | Extra if 55 or older |
|---|---|---|
| Self only HDHP | $4,400 | $1,000 |
| Family HDHP | $8,750 | $1,000 |
Publication 969 shows how the limit is cut for a partial year. Its own example is a person who turned 65 in July 2025 and enrolled in Medicare, with self only coverage and the $1,000 extra contribution: the limit was $5,300 times 6 months divided by 12, or $2,650. Ask a tax professional how the monthly rules apply to your own year.
What you can still pay from an HSA
Stopping contributions does not lock the account. Publication 969 says you generally cannot use HSA money for insurance premiums, but it lists exceptions. One is Medicare and other health care coverage if you were 65 or older, other than premiums for a Medicare supplemental policy such as Medigap. The cost side of Medicare, including the Part B premium, is on our 2027 costs page.
Delaying Medicare to keep contributing
Some people delay Part A and Part B while they still have coverage from current work, so they can keep contributing. CMS fact sheet Deciding whether to enroll in Medicare Part A and Part B when you turn 65 (CMS Product No. 11962, opened 27 Nov 2026) says that once you enroll in any part of Medicare you cannot contribute to your HSA, that you can delay both parts until you or your spouse stop working or lose that employer coverage, and that there is no penalty as long as you enroll within 8 months of losing the coverage or stopping work, whichever happens first. It says to talk with your employer benefits manager about whether delaying makes sense. The same fact sheet repeats the warning to stop HSA contributions 6 months before you sign up, or before you apply for Social Security benefits if you want to collect retirement benefits before you stop working. The sign up windows are on Special Enrollment Periods.
Questions people ask
Can I contribute to an HSA after I turn 65?
Yes, if you are not enrolled in any part of Medicare and you still meet the other HSA rules, such as having a high deductible health plan. IRS Publication 969 says the contribution limit is zero beginning with the first month you are enrolled in Medicare.
Why stop 6 months before signing up?
CMS form CMS-18-F-5 says premium free Part A coverage starts up to 6 months back from when you apply after 65, but not before the month you turned 65. IRS Publication 969 says contributions made during backdated Medicare months count as excess contributions.
Can I still spend the money in my HSA once I have Medicare?
Yes. The rule stops new contributions, not spending. IRS Publication 969 lists Medicare premiums for people 65 or older as an allowed use, except premiums for a Medigap policy.
Does applying for Social Security affect my HSA?
Medicare.gov says you and your employer should stop HSA contributions 6 months before you retire or apply for Social Security or Railroad Retirement Board benefits. CMS gives the same 6 month warning for people who apply for Social Security before they stop working.
Sources
- Working past 65, Medicare.gov, opened 27 Nov 2026
- Application for Part A (Hospital Insurance), form CMS-18-F-5 (07/2025), CMS, opened 27 Nov 2026
- Publication 969 (2025), Health Savings Accounts and Other Tax-Favored Health Plans, IRS, opened 27 Nov 2026
- Deciding whether to enroll in Medicare Part A and Part B when you turn 65, CMS Product No. 11962, opened 27 Nov 2026
Last checked 27 Nov 2026. We cite the page we read. The worked example is our illustration of the CMS 6 month rule, not tax advice. A tax professional or your HSA provider can tell you how excess contributions are handled. This page does not recommend a plan.