You can apply online or over the phone, although you’ll need to pay attention to specific enrollment deadlines and plan details to make sure you get your benefits set up correctly. The following guidelines will help you figure out exactly when and how you should apply for Medicare regardless of the details of your specific situation.

How To Apply for Medicare

You can apply online or sign up by calling Social Security at 1-800-772-1213. If you’re still working at 65, here’s how it works.

If You Are Still Working and Covered By a Group Plan

When you turn 65, you should enroll in Medicare Part A even if you have health insurance from an employer. If you aren’t sure, check with your benefits department. Your group health plan usually becomes the primary payor, with Medicare paying second (although in some cases it is the opposite). If you lose your group coverage, you can sign up for Part B during a special enrollment period (SEP). This situation may occur if you terminate employment after you reach 65. There is usually no late enrollment penalty if you sign up during the Special Enrollment Period. For those who do not sign up at 65 and are not eligible for a SEP, Medicare has a general enrollment period each year from January 1 to March 31. If you apply for Medicare during this time, your benefits take effect July 1. Once you enroll in Part A or Part B, you can enroll in a Part D prescription drug plan. If you’re enrolled in Part A and Part B, you can enroll in a Medicare Advantage plan.

If You Have Medicare Part A, and Now Need To Start Part B

At 65, you may have signed up for Part A, but not Part B. This occurs most often with someone who is still working and has access to a group health plan. Once you retire, you’ll need to add Part B within eight months of the earliest of either the end of your employment or the end of your group health coverage. This option is considered a special enrollment period.

What Do the Different Parts Cover?

Medicare Part A covers hospital stays and care, while Part B covers physician fees and other costs associated with diagnosing and treating medical conditions. Medicare Part C, called Medicare Advantage, offers options for extra coverage that may include vision, dental, and wellness care. Medicare Advantage (MA) plans cover at a minimum what Medicare Part A and Part B cover (with the exception of hospice care which would be covered by Part A). Most MA plans also provide prescription drug coverage. Medicare Part D covers prescription medications. If you have a Medicare Advantage plan with prescription drug coverage, you probably don’t need (and often can’t have) a separate Part D plan.

When Should You Apply for Medicare?

In most cases, you should apply for Medicare as soon as you’re eligible. The initial enrollment period starts three months before the month you turn 65, includes your birth month, and extends three months past the month you turn 65, giving you a seven-month window to apply. Your Part B coverage will likely be delayed if you enroll the month you turn 65 (or the three months following), so apply early to avoid a gap in coverage. Medicare imposes a hefty late enrollment penalty if you enroll in Part B or D after the initial enrollment period (IEP) and don’t qualify for a special enrollment period (SEP). You might qualify for a SEP if you have coverage, including creditable drug coverage from an employer or a union (“creditable” means that your drug coverage is expected to pay as much as a standard Part D plan would). Medicare does not charge a late enrollment penalty for enrolling in a Medicare Advantage plan or Medicare Supplement plan (Medigap) after IEP. But it’s best to apply for Medigap as soon as you’re eligible. If you apply within the first six months of having Part B coverage, you can’t be denied a Medigap policy or be required to pay more because of health conditions. Here’s how enrollment works depending on whether or not you already receive Social Security benefits.

If You Already Receive Social Security Benefits

If you’ve received Social Security benefits or benefits from the Railroad Retirement system at least four months before you turn 65, then you will be automatically enrolled in Medicare (both part A and part B) starting the first day of the month you turn 65. You’ll get your Medicare card in the mail about three months before your 65th birthday. It will be sent to the address on your Social Security record. You will automatically receive a package which contains important information about the decisions you need to make. For example, although eligible, you may not have to enroll in Part B if you’re covered under a non-Medicare insurance plan by your employer or a union. If you don’t have other coverage and don’t sign up for Part B, you’ll be subject to a permanent 10% premium hike for each 12-month period that you could have had Part B but didn’t. Take the time to learn about Medicare Part B to determine if you should sign up. You should also check out the Medicare Enrollment Booklet which contains clear, concise information about both Medicare Part A and Part B.

If You Are Not Yet Receiving Social Security Benefits

If you are not yet receiving Social Security benefits or benefits from the Railroad Retirement system, you are eligible to sign up for Medicare three months before the month you turn 65, but your enrollment will not happen automatically. You must call or apply online. It is to your benefit to sign up for Medicare Part A as soon as you are eligible, especially if you qualify for premium-free Part A, even if you still have coverage through a group health plan. Although eligible, you may not have to enroll in Part B, which requires you to pay a monthly premium. Spend the time to learn about Medicare Part B to determine if you should sign up. If you don’t sign up initially and don’t have other qualifying coverage, it will cost you more to sign up later. Watch out for those late enrollment penalties we mentioned earlier.

When To Get Prescription Drug Coverage

Though optional, Part D drug plans are subject to a late enrollment penalty that permanently increases your Part D premium if you don’t get it during your IEP (when you first become eligible for Medicare) and you don’t have other creditable drug coverage. If you go without creditable drug coverage for 63 days or more, you’ll face the late enrollment penalty even if you had coverage when you first became eligible for Medicare. For this reason, it’s normally a good idea to get Part D when you’re initially eligible or to enroll in a Medicare Advantage plan with prescription drug benefits. You need to have either Medicare Part A or Part B to be eligible to buy a Part D plan. You need to have both Part A and Part B to enroll in a Medicare Advantage plan.