Is Keflex (cephalexin) used to treat urinary tract infections?

Medical Advisory BoardAll articles are reviewed for accuracy by our Medical Advisory Board
Educational purpose only • Exercise caution as content is pending human review
Article Review Status
Submitted
Under Review
Approved

Last updated: November 7, 2026 • View editorial policy

Have a follow-up question?

Our Medical A.I. is used by practicing medical doctors at top research institutions around the world. Ask any follow up question and get world-class guideline-backed answers instantly.

Yes, Keflex (cephalexin) is used to treat UTIs, but it is not a first-line agent for uncomplicated cystitis in women.

For uncomplicated cystitis in women, cephalexin is listed as an alternative therapy rather than first-line treatment 1. The 2024 European Association of Urology guidelines recommend fosfomycin, nitrofurantoin, or pivmecillinam as first-line agents, with cephalosporins like cefadroxil (and by extension, cephalexin) reserved as alternatives when local E. coli resistance is <20% 1.

FDA-Approved Indication and Microbiology

Keflex is FDA-approved and active against the most common UTI pathogens 2:

  • E. coli (the primary UTI pathogen)
  • Klebsiella pneumoniae
  • Proteus mirabilis

The drug achieves excellent urinary concentrations—following a 500 mg dose, peak urine levels reach approximately 2200 μg/mL, with over 90% excreted unchanged in urine within 8 hours 2. This pharmacokinetic profile makes it effective for UTI treatment.

Clinical Context and Positioning

For Women with Uncomplicated Cystitis:

  • Use cephalexin 500 mg twice daily for 3 days when first-line agents are contraindicated or unavailable 1
  • Only appropriate when local E. coli resistance to cephalosporins is <20% 1
  • Recent comparative data shows cephalexin achieves 85.3% susceptibility coverage for lower UTI isolates 3

For Men with UTI:

  • Men require 7-day treatment courses 1
  • Trimethoprim-sulfamethoxazole is preferred, but cephalexin represents a reasonable alternative based on susceptibility testing

For Recurrent UTI Prevention:

  • Postcoital prophylaxis with cephalexin 250 mg is highly effective, reducing UTI episodes from 127 infections over 6 months to just 1 infection over 12 months in sexually active women 4
  • This approach uses only one-third the tablets required for daily prophylaxis while achieving identical results 4

Important Caveats

Resistance considerations: While cephalexin has good activity, it is not active against:

  • Methicillin-resistant staphylococci
  • Most enterococci
  • Enterobacter species
  • Pseudomonas
  • Penicillin-resistant S. pneumoniae 2

Duration matters: Pediatric data reveals providers often overtreated lower UTIs with 8.3-day courses when guidelines recommend shorter durations 3. For uncomplicated cystitis, 3 days is sufficient 1.

Drug interactions: Cephalexin increases metformin levels by 24-34%, requiring dose adjustment and careful monitoring when co-administered 2.

Practical Algorithm

  1. First, determine UTI type: uncomplicated cystitis vs. pyelonephritis vs. complicated UTI
  2. For uncomplicated cystitis in women: Start with fosfomycin, nitrofurantoin, or pivmecillinam 1
  3. Use cephalexin when:
    • First-line agents contraindicated
    • Local resistance data supports use (<20% resistance)
    • For postcoital prophylaxis in recurrent UTI 1, 4
  4. Dose: 500 mg twice daily for 3 days (women) or 7 days (men) 1
  5. For recurrent UTI prevention: 250 mg single dose postcoitally 4

The evidence shows cephalexin works for UTIs with comparable efficacy to other cephalosporins 5, but antimicrobial stewardship principles favor reserving it as an alternative to preserve first-line narrow-spectrum options 6.

Professional Medical Disclaimer

This information is intended for healthcare professionals. Any medical decision-making should rely on clinical judgment and independently verified information. The content provided herein does not replace professional discretion and should be considered supplementary to established clinical guidelines. Healthcare providers should verify all information against primary literature and current practice standards before application in patient care. Dr.Oracle assumes no liability for clinical decisions based on this content.