

Can't find Cefazolin? Learn about alternative antibiotics like Ceftriaxone, Cephalexin, Nafcillin, and Clindamycin that your doctor may prescribe instead.
If your doctor prescribed Cefazolin and your pharmacy can't fill it, you're probably wondering: what now? Cefazolin has faced recurring shortages in recent years, and being told your antibiotic isn't in stock is stressful — especially when you're dealing with an active infection or preparing for surgery.
The good news is there are several effective alternatives. This guide covers what Cefazolin is, how it works, and which antibiotics your doctor might consider as substitutes.
Cefazolin (formerly sold as Ancef and Kefzol) is a first-generation cephalosporin antibiotic. It's one of the most widely used injectable antibiotics in the United States, prescribed for infections ranging from cellulitis and urinary tract infections to bone infections and endocarditis. It's also the number one choice for surgical prophylaxis — preventing infections during and after surgery.
Cefazolin is only available as an injection (IV or intramuscular). There is no oral form of Cefazolin itself. For a full overview, see What Is Cefazolin? Uses, Dosage, and What You Need to Know.
Cefazolin works by interfering with bacterial cell wall construction. Specifically, it binds to proteins called penicillin-binding proteins (PBPs) on the surface of bacteria. This binding prevents the bacteria from forming the peptidoglycan cross-links they need to maintain their cell walls. Without intact cell walls, the bacteria swell, burst, and die.
This mechanism is similar to how all beta-lactam antibiotics work, including penicillins and other cephalosporins. For a deeper explanation, check out How Does Cefazolin Work? Mechanism of Action Explained.
Because Cefazolin shares this mechanism with many other antibiotics, there are several alternatives that work in similar ways against similar bacteria.
The best alternative for you depends on your specific infection, your allergies, and whether you need an IV medication or can switch to an oral one. Here are the most common substitutes:
Ceftriaxone is a third-generation cephalosporin antibiotic. Like Cefazolin, it's given by injection (IV or IM). The biggest advantage of Ceftriaxone is its long half-life, which allows for once-daily dosing compared to Cefazolin's every-6-to-8-hour schedule.
When it's a good fit:
Key differences: Ceftriaxone has a broader spectrum of activity than Cefazolin. While this can be an advantage, it's not always necessary — and broader-spectrum antibiotics can contribute to antibiotic resistance. Ceftriaxone should also not be mixed with calcium-containing IV solutions, and it's generally more expensive than Cefazolin.
Cephalexin is an oral first-generation cephalosporin. It's in the same drug class as Cefazolin and covers many of the same bacteria.
When it's a good fit:
Key differences: Cephalexin is taken by mouth (typically 250-500 mg every 6 hours), so it can't replace Cefazolin for severe infections that require IV antibiotics. However, it's widely available, inexpensive (often $4 to $15 for a course), and easy to take at home.
Nafcillin is an anti-staphylococcal penicillin given by IV. It's one of the preferred treatments for methicillin-susceptible Staphylococcus aureus (MSSA) infections.
When it's a good fit:
Key differences: Nafcillin is specifically targeted at staphylococcal infections, so it's not appropriate for the full range of infections Cefazolin covers. It's also given more frequently (every 4-6 hours) and can be harder on the veins, causing phlebitis at IV sites.
Clindamycin is a lincosamide antibiotic available in both IV and oral forms. It's often used as an alternative for patients who have severe allergies to penicillins and cephalosporins.
When it's a good fit:
Key differences: Clindamycin works through a completely different mechanism (it inhibits protein synthesis rather than cell wall synthesis). It has a higher risk of causing Clostridioides difficile infection (C. diff), a serious and sometimes dangerous type of diarrhea. Your doctor will weigh this risk when considering Clindamycin as an alternative.
You should never switch antibiotics on your own. The right alternative depends on:
Talk to your doctor or infectious disease specialist about which option makes the most sense for your situation. For help finding a prescriber, see How to Find a Doctor Who Can Prescribe Cefazolin Near You.
If your doctor specifically prescribed Cefazolin, it's worth trying to locate it before switching to an alternative. Use Medfinder to check real-time availability, and read our tips on how to find Cefazolin in stock near you.
Cefazolin shortages are frustrating, but they don't have to derail your treatment. Alternatives like Ceftriaxone, Cephalexin, Nafcillin, and Clindamycin are well-established antibiotics that can effectively treat many of the same infections. The key is working closely with your healthcare team to choose the right one for your specific needs.
If cost is a concern, check out our guide on how to save money on Cefazolin — some alternatives may actually be less expensive than Cefazolin depending on your insurance and pharmacy.
You focus on staying healthy. We'll handle the rest.
Try Medfinder Concierge FreeMedfinder's mission is to ensure every patient gets access to the medications they need. We believe this begins with trustworthy information. Our core values guide everything we do, including the standards that shape the accuracy, transparency, and quality of our content. We’re committed to delivering information that’s evidence-based, regularly updated, and easy to understand. For more details on our editorial process, see here.