Is Cephalexin Used for UTI? Efficacy and Side Effects

Yes, cephalexin is used to treat urinary tract infections and is effective against the bacteria that cause most UTIs. It belongs to a class of antibiotics called first-generation cephalosporins, and while it isn’t typically the first drug prescribed for a simple bladder infection, it has become an increasingly important option as bacteria develop resistance to older go-to antibiotics.

Where Cephalexin Fits in UTI Treatment

For uncomplicated bladder infections (acute cystitis), guidelines from the Infectious Diseases Society of America have traditionally listed trimethoprim-sulfamethoxazole and nitrofurantoin as first-line choices. Cephalexin is considered an alternative. But that distinction matters less than it used to, because E. coli resistance to trimethoprim-sulfamethoxazole continues to rise across the United States. Recent clinical data show that cephalexin is as effective as those first-line therapies for treating UTIs, including complicated infections.

In a study published in Open Forum Infectious Diseases comparing two oral cephalosporins, patients treated with cephalexin had a treatment failure rate of 12.5%, significantly lower than the 23.4% failure rate seen with cefdinir. Treatment failure included ongoing symptoms during the antibiotic course or a recurrent symptomatic UTI within 30 days. That 12.5% figure puts cephalexin in a solid position as a reliable UTI treatment when first-line drugs aren’t appropriate.

For complicated UTIs, the 2025 IDSA guideline update notes that first-generation cephalosporins like cephalexin may be appropriate in select settings for oral treatment, though they are less well studied than some alternatives in that category.

Which Bacteria It Covers

The three most common bacteria behind UTIs are E. coli, Proteus mirabilis, and Klebsiella pneumoniae. E. coli alone causes roughly 80% of uncomplicated UTIs. Antibiogram data from hospital systems show that cephalexin covers 95% or more of urine isolates of all three species. That broad coverage against the usual suspects is a big part of why clinicians reach for it.

Cephalexin works by binding to proteins on the bacterial cell membrane that are essential for building the cell wall. When these proteins are blocked, bacteria can no longer form the rigid outer structure they need to survive. Instead of dividing normally, E. coli cells elongate into long filaments and eventually die. This mechanism is similar to how penicillin works, which is why cephalosporins and penicillins are grouped together as beta-lactam antibiotics.

How Quickly Symptoms Improve

Most people with an uncomplicated bladder infection start noticing relief from burning, urgency, and frequency within 24 to 48 hours of starting cephalexin. Full resolution of symptoms can take up to a week. A typical course runs 5 to 7 days.

If your symptoms aren’t improving within 48 hours, or if they get worse at any point (more pain, visible blood in your urine, fever, or back pain), that warrants a call to your provider. Worsening symptoms could mean the bacteria are resistant to cephalexin, or that the infection has moved beyond the bladder. Your provider can check your urine culture results and adjust treatment.

Common Side Effects

Diarrhea is the most frequently reported side effect. Other common ones include nausea, vomiting, stomach pain, heartburn, and dizziness. Genital or rectal itching can also occur, often from a yeast overgrowth triggered by the antibiotic disrupting your normal bacterial balance.

Severe side effects are rare but worth knowing about. Watery or bloody diarrhea with stomach cramps could signal a Clostridioides difficile infection, a potentially serious complication that can develop during treatment or even weeks after finishing the course. Signs of an allergic reaction include rash, hives, swelling of the face or throat, and difficulty breathing. If you experience any of these, seek medical attention right away.

Penicillin Allergy and Cephalexin

Because cephalexin shares a chemical backbone with penicillin, there is some cross-reactivity risk for people with a penicillin allergy. For first-generation cephalosporins like cephalexin, the estimated cross-reactivity rate with true penicillin allergy ranges from 1% to 8%. That’s notably higher than the less than 1% cross-reactivity seen with third-generation cephalosporins. If you’ve had a severe or anaphylactic reaction to penicillin, your provider will likely choose a different antibiotic. If your penicillin reaction was mild (a simple rash, for instance), cephalexin may still be an option depending on your provider’s assessment.

Safety During Pregnancy and Breastfeeding

UTIs are common during pregnancy, and cephalexin is one of the antibiotics considered safe to use. Published epidemiologic studies and pharmacovigilance reports spanning several decades have not established any link between cephalexin use in pregnant women and major birth defects, miscarriage, or adverse outcomes for mother or baby. Animal studies at doses up to 1.2 times the maximum recommended human dose showed no harm to developing offspring or any effects on litter size, delivery, or postnatal growth.

For breastfeeding, cephalexin does pass into breast milk, but in very small amounts. The relative infant dose is less than 1% of the mother’s weight-adjusted dose, which is well below the threshold that raises concern. No adverse effects on breastfed infants have been documented in the available data.

Why Your Provider Might Choose It

Your provider is most likely to prescribe cephalexin for a UTI in a few specific scenarios: when local resistance rates make trimethoprim-sulfamethoxazole unreliable, when you can’t tolerate nitrofurantoin, when you’re pregnant, or when your urine culture comes back showing the bacteria are susceptible to it. It’s also a practical choice when a broader-spectrum antibiotic like a fluoroquinolone would be overkill for a straightforward bladder infection. Using narrower-spectrum drugs when possible helps slow the development of antibiotic resistance, which benefits everyone.