Keflex is a first-generation cephalosporin antibiotic. Its generic name is cephalexin, and it works by destroying bacterial cell walls. Cephalosporins are closely related to penicillins but are grouped into their own class, with “generations” that reflect their range of bacterial coverage. As a first-generation cephalosporin, Keflex is strongest against common gram-positive bacteria like staph and strep, with more limited activity against gram-negative organisms.
How Cephalosporins Relate to Penicillin
Cephalosporins and penicillins both belong to a larger family called beta-lactam antibiotics. They share a similar core chemical structure and kill bacteria the same way: by binding to proteins on the inner membrane of the bacterial cell wall and blocking the cross-linking process that holds the wall together. Without that structural support, the bacterial cell weakens and bursts open.
This shared ancestry matters if you have a penicillin allergy. First-generation cephalosporins like Keflex have a cross-reactivity rate of roughly 1% to 8% with penicillin allergies. That’s higher than third-generation cephalosporins, which fall below 1%. If you’ve had a true allergic reaction to penicillin (hives, swelling, difficulty breathing), your prescriber will weigh that risk before choosing Keflex.
One practical advantage of Keflex is that it resists breakdown by an enzyme that penicillin-resistant staph bacteria produce. This means it can treat certain staph infections that plain penicillin cannot.
What Keflex Treats
The FDA has approved Keflex for five categories of infection:
- Skin and soft tissue infections, including cellulitis and wound infections caused by Staphylococcus aureus and Streptococcus pyogenes
- Respiratory tract infections caused by Streptococcus pneumoniae and Streptococcus pyogenes
- Ear infections (otitis media), where it covers several common culprits including Haemophilus influenzae and Moraxella catarrhalis
- Urinary tract infections, including acute prostatitis, caused by E. coli, Proteus mirabilis, and Klebsiella pneumoniae
- Bone infections caused by Staphylococcus aureus and Proteus mirabilis
In everyday practice, Keflex is most commonly prescribed for skin infections and uncomplicated urinary tract infections. It’s taken by mouth, which makes it a convenient option when an infection doesn’t require IV antibiotics.
What It Doesn’t Cover
Keflex has real blind spots. It is ineffective against Pseudomonas aeruginosa (a common cause of hospital-acquired infections), tuberculosis-causing bacteria, and most anaerobic organisms that thrive in oxygen-free environments like deep abscesses. Certain gram-negative bacteria, including Serratia, Morganella, and Providencia species, are intrinsically resistant to first-generation cephalosporins because they naturally produce enzymes that break down these drugs.
MRSA (methicillin-resistant Staphylococcus aureus) is also resistant to Keflex. If your provider suspects MRSA, they’ll choose a different antibiotic entirely.
Typical Dosing
The standard adult dose is 250 mg every 6 hours or 500 mg every 12 hours, taken for 7 to 14 days depending on the infection. For more severe infections, the total daily dose can go up to 4 grams, split into two to four doses. Children are dosed by weight, typically 25 to 50 mg per kilogram per day, with higher doses reserved for serious infections.
Keflex comes in capsules and liquid suspension. It can be taken with or without food, though taking it with a meal may reduce stomach discomfort.
Common Side Effects
The most frequent side effects are digestive: nausea, diarrhea, vomiting, stomach pain, and heartburn. Some people experience dizziness, tiredness, or headache. Genital or rectal itching can occur, often from yeast overgrowth as the antibiotic disrupts normal bacterial balance.
More serious reactions are uncommon but worth knowing about. Allergic reactions can include rash, hives, facial swelling, or difficulty breathing. Watery or bloody diarrhea with stomach cramps and fever, even weeks after finishing the course, can signal a Clostridioides difficile infection, a potentially dangerous overgrowth in the gut that requires prompt medical attention.
Drug Interactions Worth Knowing
If you take metformin for diabetes, Keflex can increase metformin levels in your blood by about 34% at peak concentration. It also reduces how quickly your kidneys clear metformin by around 14%. This combination isn’t necessarily off-limits, but your blood sugar may need closer monitoring and your metformin dose may need adjusting while you’re on the antibiotic.
Probenecid, a medication sometimes used for gout, slows the kidney’s ability to excrete Keflex and is generally not recommended alongside it.
Pregnancy and Breastfeeding
Keflex is considered one of the safer antibiotic options during pregnancy and is widely prescribed when an infection needs treatment. Only tiny amounts pass into breast milk, and most breastfed infants tolerate it without any problems. In rare cases, a nursing baby may develop loose stools or oral thrush. There is no evidence that cephalexin affects fertility in men or women.

