Cephalexin (also spelled cefalexin) is an antibiotic that treats a range of bacterial infections, mainly of the skin, ears, respiratory tract, bones, and urinary tract. It does not treat viruses like colds or flu.

What Does Cephalexin Treat?

Most common infections

Doctors usually prescribe cephalexin for infections caused by susceptible bacteria, such as:

  • Skin and soft‑tissue infections (e.g., cellulitis, some wound or simple skin infections).
  • Ear infections (acute otitis media).
  • Throat infections (strep throat / streptococcal pharyngitis, tonsillitis).
  • Respiratory tract infections (some pneumonias, bronchitis, other mild–moderate lung infections).
  • Urinary tract infections (UTIs) and bladder infections.
  • Bone and joint infections in certain cases.
  • Some genital or prostate infections (e.g., prostatitis).

In certain heart patients who are allergic to penicillin, it may also be used before some dental or throat procedures to help prevent a heart valve infection (bacterial endocarditis).

How it works (in simple terms)

  • Cephalexin is a cephalosporin antibiotic.
  • It kills bacteria by damaging their cell wall, so they can’t survive and multiply.
  • Because of this, it only works on bacteria that are sensitive to it and will not help with viral illnesses.

What cephalexin does not treat

  • Colds, flu, COVID‑19, or other viral infections.
  • Many resistant bacteria, including most MRSA (methicillin‑resistant Staphylococcus aureus), many Enterococcus , and Pseudomonas.

That’s why it should only be taken when a clinician believes the bacteria causing the infection are likely to respond to cephalexin.

Quick Scoop: Key points

  • Main uses: skin, ear, throat, lung, urinary, bone, and some genital/prostate infections.
  • Sometimes used to prevent heart valve infection before specific procedures in certain heart patients who can’t take penicillin.
  • Only treats bacterial infections, not viruses.
  • Choice of antibiotic, dose, and duration must be tailored by a healthcare professional based on your infection, other health issues, and allergies.

Forum-style note & “latest” context

On health forums and Q&A sites in 2024–2026, people often mention being given cephalexin for:

  • Uncomplicated UTIs.
  • Mild skin infections after small cuts, shaving bumps, or minor surgery.
  • Ear or throat infections when penicillin or amoxicillin aren’t suitable.

“Got Keflex for a UTI; cleared it in a few days, but the doctor told me to finish all the pills even when I felt better.”

This matches current prescribing guides that emphasize finishing the full course and not using leftover antibiotics “just in case,” to avoid resistance.

Safety reminder

  • Only a clinician can decide if cephalexin is right for your specific infection.
  • If you have a history of severe reactions to penicillin or cephalosporins, kidney disease, or are on multiple medications, you need personalized medical advice.

Bottom line: Cephalexin treats a variety of mild to moderate bacterial infections (especially skin, ear, throat, lung, urinary, and some bone/joint infections) when the bacteria are susceptible, but it is not a general “infection pill” and should only be used under medical guidance.

Information gathered from public forums or data available on the internet and portrayed here.