Quick answer
It depends mostly on how many people your employer has. If you have health coverage through your current job, or your spouse’s current job, at an employer with 20 or more employees, that plan pays first and you can usually delay Part B without a penalty. If the employer has fewer than 20 employees, Medicare pays first, so you generally need to sign up for Parts A and B at 65. Either way, if you contribute to an HSA, be careful with Part A, because enrolling ends your HSA contributions and Part A coverage can be backdated up to six months.
Key takeaways
- At an employer with 20 or more employees, the job-based plan pays first, and you can delay Part B without a penalty while you’re covered by current work.
- At an employer with fewer than 20 employees, Medicare pays first, so sign up for Parts A and B when you’re first eligible.
- The same test applies to coverage through a working spouse’s employer.
- Once you’re enrolled in any part of Medicare, you can’t contribute to an HSA, and Part A can be backdated up to six months when you sign up after 65.
- When your job or job-based coverage ends, you have 8 months to sign up for Part B, and COBRA doesn’t extend that window.
On this page
The 20-employee rule
Medicare looks at who pays first when you have both Medicare and a job-based plan. The answer comes down to the size of the employer providing the coverage.
| If your coverage comes from… | Who pays first | What most people do at 65 |
|---|---|---|
| Your current job, employer with 20+ employees | The job-based plan | Can delay Part B without penalty; many take premium-free Part A unless they’re using an HSA |
| Your current job, employer with fewer than 20 employees | Medicare | Sign up for Parts A and B when first eligible |
| Your spouse’s current job, employer with 20+ employees | The job-based plan | Same as above: can delay Part B |
| Your spouse’s current job, employer with fewer than 20 employees | Medicare | Sign up for Parts A and B when first eligible |
| COBRA or retiree coverage | Medicare | Sign up for Parts A and B; these don’t count as current job-based coverage |
If you’re at a small employer and don’t sign up, the job-based plan may pay only what Medicare wouldn’t, leaving you with big bills, and you’ll face late enrollment penalties when you do sign up. It’s worth asking your benefits office directly how the plan works with Medicare.
Should you take Part A while you’re working?
Most people get Part A without paying a premium, so signing up for it at 65 often costs nothing and can act as secondary coverage for hospital stays. The big exception is if you or your employer are putting money into a health savings account.
Once you’re enrolled in any part of Medicare, including just Part A, you can’t make new HSA contributions. There’s also a timing trap. If you sign up for Medicare after turning 65, Part A coverage is usually backdated up to six months, but never earlier than the month you turned 65. HSA contributions made during those backdated months count as excess contributions.
A simple rule: stop HSA contributions six months before you sign up for Part A. That includes claiming Social Security retirement benefits after 65, because that automatically enrolls you in Part A. If you over-contribute by accident, you can withdraw the excess and any earnings on it before your tax filing deadline to avoid the penalty.
Money already in your HSA stays yours. After 65, you can use it tax-free for qualified medical costs, including Medicare Part B, Part D and Medicare Advantage premiums, though not Medigap premiums. See what an HSA is for the basics.
Drug coverage while you work
To delay Part D without a penalty, your job-based drug coverage has to be creditable, meaning it’s expected to pay at least as much as standard Medicare drug coverage. Your employer or union has to tell you each year whether it is, usually in a notice sent before October 15. If your plan’s coverage isn’t creditable, sign up for a Part D plan when you’re first eligible.
Signing up when you stop working
When your job ends, or your job-based coverage ends, whichever comes first, you have 8 months to sign up for Part B without a penalty. That window starts even if you choose COBRA. COBRA pays after Medicare once you’re eligible, so if you skip Part B and lean on COBRA, you could end up with gaps in coverage and a penalty later. See COBRA health insurance.
If you already have Part A, you’ll sign up for Part B with two forms:
- CMS-40B: the application for Part B.
- CMS-L564: a form your employer fills out confirming when you had job-based coverage. It applies if you’re still working or lost job-based coverage within the last 8 months.
If you already get Social Security benefits, you’ll be enrolled in Parts A and B automatically at 65. If you want to keep working and delay Part B, you’ll need to tell Social Security.
Timing matters for Medigap too. Your six-month Medigap open enrollment period starts the first month you’re 65 or older and have Part B, so delaying Part B while you work also delays that window. See Medicare Advantage vs. Medigap and Medigap Plan G vs. Plan N for what to compare.
If your spouse is younger
If you’re the one covering a younger spouse through your job and you retire, your spouse may lose that coverage. They’ll need their own plan until they turn 65, like COBRA or a Marketplace plan. See what happens to my wife’s health insurance when I go on Medicare and can I get health insurance if I retire early.
More on Medicare: the Part B premium and IRMAA, late enrollment penalties, Medigap Plan G vs. Plan N, Medicare Advantage vs. Medigap, Medicare open enrollment and who is eligible for Medicare.
Is your spouse losing coverage when you retire? Compare plans by ZIP code.
Frequently asked questions
Do I have to sign up for Medicare at 65 if I’m still working?
Not always. If you have coverage through your current job or your spouse’s, and the employer has 20 or more employees, you can usually delay Part B without a penalty. At a smaller employer, sign up at 65.
Can I keep contributing to my HSA after 65?
Only if you haven’t enrolled in any part of Medicare. Once you have Part A, contributions have to stop, and Part A can be backdated up to six months when you enroll after 65.
Does COBRA let me delay Medicare?
No. COBRA doesn’t count as coverage from current work. Your 8-month window to sign up for Part B starts when the job or job-based coverage ends, even if you take COBRA.
What forms do I need to sign up for Part B after I retire?
Usually Form CMS-40B, the Part B application, and Form CMS-L564, which your employer completes to show you had job-based coverage.
Sources
This article is general information, not legal, tax or financial advice. Medicare’s rules have exceptions for some employer plans, so confirm with your benefits office, Social Security or your State Health Insurance Assistance Program (SHIP). Last reviewed September 2026.