Home / Pregnancy Medication Safety / Is Keflex (Cephalexin) safe?

Is Keflex (Cephalexin) safe in pregnancy?

Important: Always talk to your OB or pharmacist before starting, stopping, or changing any medication during pregnancy. This tool is general guidance — not a substitute for clinical advice.
Verdict
✓ Yes — safe
Safe.
FDA pregnancy category: B

Common uses

Skin infections, mastitis, UTIs

How Keflex (Cephalexin) works and why pregnancy changes the math

Keflex (Cephalexin) is a cephalosporin antibiotic. Mechanistically it is very similar to penicillin — both block bacterial cell wall synthesis — and the pregnancy track record is comparably reassuring. Cephalosporins are commonly used in pregnancy for skin infections, mastitis, urinary tract infections, and other common needs.

For people who are penicillin-allergic, cephalosporins can sometimes still be used depending on the type of allergic reaction — your provider will sort out whether your particular history makes them safe. The pregnancy data is robust across multiple decades, and most obstetric practices treat this drug class as a first-line option alongside penicillins.

How Keflex (Cephalexin) risk changes by trimester

First trimesterReassuring data across this antibiotic class for first-trimester use. The pregnancy-relevant concern is more about whether the infection itself needs treating, not whether the antibiotic is safe to give.
Second trimesterContinued reassuring data. Many common infections in pregnancy — UTIs, strep, mastitis, skin infections — are routinely treated with this class with established safety profiles.
Third trimesterContinued reassuring data. For Group B Strep prophylaxis during labor specifically, this class is the standard intravenous treatment. No special dose adjustments are typically needed for late-pregnancy use.

The clinical reasoning behind the verdict

Cephalosporin family. Reassuring data.

Dosing and what to do if symptoms keep going

Antibiotic dosing in pregnancy generally follows standard adult guidance, sometimes adjusted slightly upward for medications cleared by the kidneys because pregnancy speeds up kidney clearance. Completing the full prescribed course matters even more in pregnancy than in the general population — partial treatment can leave a partially-treated infection that flares back worse.

If symptoms are not improving after 48-72 hours of an antibiotic, that is a call back to your provider rather than a reason to add another medication. Antibiotic resistance, an alternate diagnosis (viral instead of bacterial), or a complication of the infection itself may need a different approach. UTIs that recur in pregnancy especially warrant a urology or maternal-fetal medicine consult.

Safer alternatives and how to choose between them

Standard alternative to penicillin.

The right alternative depends on what Keflex (Cephalexin) was being used to treat. For mild symptoms, non-medication approaches often work — saline rinses for congestion, ice for swelling, heat for muscle pain, rest for fatigue. For ongoing conditions, pregnancy-safe medications usually exist and are best identified with your provider's input.

The trap to avoid is stopping a needed medication abruptly without a replacement plan, especially for chronic conditions like hypertension, diabetes, depression, or autoimmune disease. Untreated maternal conditions usually carry pregnancy risks of their own, sometimes larger than the risks of the medication being avoided. A pregnancy-aware substitute usually beats stopping treatment.

How to bring this up with your OB, midwife, or pharmacist

The most useful conversation with a provider about Keflex (Cephalexin) starts with what you actually want to know rather than a yes-or-no question. Try one of these:

  • "I take Keflex (Cephalexin) sometimes for [symptom]. Is the dose I am using fine, or would you adjust it for pregnancy?" This invites a specific answer rather than a generic "talk to your provider."
  • "What is your default for [the symptom]? If your default does not work for me, what is the next step?" Knowing the escalation plan ahead of time saves time when you actually need it.
  • "I have been on Keflex (Cephalexin) for [condition] since before I got pregnant. What is your read on continuing versus switching?" For chronic medications, this is the most important question, and the answer is rarely "just stop."

Pharmacists are an underused resource here. The pharmacist at your usual pharmacy can pull up your records, check interactions, and answer pregnancy-medication questions without a co-pay or an appointment. For over-the-counter products especially, a pharmacist conversation is often faster than waiting for an obstetric callback.

What recent research has been saying about Keflex (Cephalexin)

The most-used antibiotic classes in pregnancy continue to have reassuring safety data accumulating in recent literature. Pregnancy registries and population-level studies have not surfaced new red flags for the long-standing pregnancy-safe antibiotic options. The bigger evolving conversation is about antibiotic stewardship and avoiding unnecessary courses, not about safety of the established choices.

Sources and further reading

ACOG Antibiotics 2024

One more time, because this is medical territory: Always talk to your OB, midwife, or pharmacist before starting, stopping, or changing any medication during pregnancy. The summary on this page is general education, not personalized clinical advice for your specific pregnancy or medical history. If you have a same-day concern about a medication you have taken, call your provider; if you have a symptom that worries you, do not wait.

Check another medication

Tylenol (Acetaminophen)Ibuprofen (Motrin / Advil)Aspirin (Bayer)Naproxen (Aleve)Benadryl (Diphenhydramine)Zyrtec (Cetirizine)Claritin (Loratadine)Allegra (Fexofenadine)Sudafed (Pseudoephedrine)Phenylephrine (Sudafed PE)Afrin (Oxymetazoline)Mucinex (Guaifenesin)Dextromethorphan (Robitussin DM)NyQuilDayQuilTums (Calcium Carbonate)Pepcid (Famotidine)Zantac (Ranitidine)Prilosec (Omeprazole)Pepto-Bismol (Bismuth Subsalicylate)Imodium (Loperamide)Miralax (Polyethylene Glycol)Colace (Docusate Sodium)Senna (Senokot)Dulcolax (Bisacodyl)MelatoninUnisom (Doxylamine)Diclegis (Doxylamine + B6)Zofran (Ondansetron)Reglan (Metoclopramide)Zoloft (Sertraline)Prozac (Fluoxetine)Lexapro (Escitalopram)Wellbutrin (Bupropion)Xanax (Alprazolam)Ativan (Lorazepam)Klonopin (Clonazepam)Adderall (Amphetamine)Ambien (Zolpidem)AmoxicillinAzithromycin (Z-pack)Cipro (Ciprofloxacin)Bactrim (Sulfamethoxazole/Trimethoprim)Flagyl (Metronidazole)Diflucan (Fluconazole)Monistat (Miconazole)Tamiflu (Oseltamivir)Flu Vaccine (Inactivated)Tdap VaccineMMR VaccineLevothyroxine (Synthroid)MethimazoleInsulinMetforminGlyburideLisinopril (ACE Inhibitor)Losartan (ARB)LabetalolMethyldopaStatins (Lipitor, Crestor)Birth Control Pills (taken while pregnant)Plan B (Levonorgestrel)Misoprostol (Cytotec)MethotrexateAccutane (Isotretinoin)Retin-A / Tretinoin (Topical)Benzoyl PeroxideSalicylic Acid (Topical)Hydrocortisone (Topical)Triamcinolone (Topical)Prednisone (Oral)Albuterol (Inhaler)Flonase (Fluticasone Nasal)Nasacort (Triamcinolone Nasal)Singulair (Montelukast)Folic AcidPrenatal VitaminsIron Supplements (Ferrous Sulfate)Vitamin DOmega-3 / Fish OilBiotinCollagen PowderAshwagandhaSt. John's WortValerianCBD Oil / TinctureMarijuana / CannabisMelatonin SupplementValerian RootMagnesium SupplementVitamin B12Vitamin B6 (Pyridoxine)DexamethasoneHeparin / LovenoxWarfarin (Coumadin)Rh Immune Globulin (RhoGAM)HIV AntiretroviralsHepatitis B VaccineHPV VaccineChickenpox (Varicella) VaccineShingles (Shingrix) VaccineSSRIs (General)SNRIs (Effexor, Cymbalta)Triptans (Imitrex, etc.)Topamax (Topiramate)Valproic Acid (Depakote)Lamotrigine (Lamictal)Levonorgestrel IUD (Mirena, Skyla)Paxil (Paroxetine)

Other pregnancy safety lookups

Or visit the Pregnancy Safety Guide to search across all 460+ lookups.