AskMed

Antibiotic Cephalexin (Keflex): Uses, Side Effects, Allergy

The antibiotic cephalexin, sold under the brand name Keflex, is a first-generation cephalosporin taken by mouth that kills bacteria by blocking how they build their cell walls. Its FDA label covers five groups of infections caused by susceptible bacteria: respiratory tract infections, middle ear infections, skin infections, bone infections and genitourinary infections, including acute prostatitis. It does not work against viruses such as colds and flu, and it misses some important bacteria, including MRSA, most enterococci and Pseudomonas. This guide covers how cephalexin works, what Keflex is used for, its side effects and C. difficile risk, what the 2022 drug allergy practice parameter says about penicillin allergy, its interactions, and what the label says about pregnancy and breastfeeding. It gives no doses: the prescriber sets those.

Most questions about cephalexin come down to what one source says: whether the label covers an infection, whether an old reaction to amoxicillin matters, or whether another medicine clashes with it. AskMed is a medical question app made for doctors, nurses, pharmacists, medical students and researchers. It searches journals, clinical guidelines and drug labels first, then writes an answer with a link after every claim. Ask it which bacteria the cephalexin label lists for skin infections and which it calls resistant, and the answer points to the label section it comes from, so you can read the exact wording before you talk to your prescriber or pharmacist.

Ask AskMed what the cephalexin label covers:

What kind of antibiotic is cephalexin?

Cephalexin is a cephalosporin antibacterial drug, and StatPearls, the peer-reviewed clinical reference indexed by the US National Library of Medicine, classifies cephalexin as a first-generation cephalosporin. Cephalosporins belong to the beta-lactam family together with the penicillins, carbapenems and monobactams, and penicillins and cephalosporins share the same beta-lactam ring. According to the FDA label for cephalexin capsules, cephalexin is bactericidal, meaning it kills bacteria rather than only stopping their growth, and it works by inhibiting bacterial cell-wall synthesis. The label gives its initial US approval as 1971. Cephalexin is taken by mouth as a capsule, tablet or liquid suspension, and the label says it is acid stable and may be given without regard to meals. Only about 10% to 15% of it binds to proteins in the blood, and more than 90% leaves the body unchanged in the urine within 8 hours, through filtration and secretion by the kidneys. That route through the kidneys explains several of its precautions.

Because the kidneys clear cephalexin, the label asks for careful monitoring in people with severe kidney impairment, where a safe dose may be lower than usual, and it notes that older adults are more likely to have reduced kidney function. In three published clinical studies cited in the label, 433 of 701 participants (62%) were 65 or older, and no overall differences in safety or effectiveness were seen between them and younger participants. Any change for kidney function is worked out by the prescriber.

What is Keflex used for?

Keflex is used for the bacterial infections listed in the Indications and Usage section of the cephalexin FDA label, each caused by susceptible isolates of named bacteria. The label lists five groups: respiratory tract infections caused by Streptococcus pneumoniae and Streptococcus pyogenes; otitis media, an infection of the middle ear, caused by S. pneumoniae, Haemophilus influenzae, Staphylococcus aureus, S. pyogenes and Moraxella catarrhalis; skin and skin structure infections caused by S. aureus and S. pyogenes; bone infections caused by S. aureus and Proteus mirabilis; and genitourinary tract infections, including acute prostatitis, caused by Escherichia coli, P. mirabilis and Klebsiella pneumoniae. The StatPearls review calls cephalexin widely used in outpatient and inpatient care because of its favorable safety and efficacy profile, and names urinary tract, respiratory, middle ear, bone, and skin and soft tissue infections as its common uses. Susceptible is the key word: the bacteria have to be ones cephalexin can kill.

The label also says cephalexin should be used only for infections that are proven or strongly suspected to be caused by bacteria, to slow the spread of drug-resistant bacteria. For a sore throat, for example, doctors first judge how likely group A strep is, often with a score such as the Centor score, and confirm it with a test when needed. Beyond the label, StatPearls notes that cephalexin is given to prevent surgical site infections, and MedlinePlus says it is sometimes used before a dental or upper airway procedure in people with a penicillin allergy and a heart condition, to help prevent a heart valve infection.

What infections does cephalexin not treat?

Cephalexin does not treat viral infections, and the FDA label names several bacteria that resist cephalexin. The patient counseling section of the label says antibacterial drugs, including cephalexin, do not treat viral infections such as the common cold, and MedlinePlus adds flu and other viral infections. Among bacteria, the label's Microbiology section states that methicillin-resistant staphylococci, which include MRSA, and most isolates of enterococci are resistant to cephalexin. Cephalexin is not active against most isolates of Enterobacter species, Morganella morganii and Proteus vulgaris, and it has no activity against Pseudomonas species or Acinetobacter calcoaceticus. Penicillin-resistant Streptococcus pneumoniae is usually cross-resistant to beta-lactam drugs, so the label lists only penicillin-susceptible pneumococci among the covered bacteria. Even for bacteria on the covered list, resistance differs from place to place, which is why the label tells prescribers to use culture and susceptibility results when they have them, and local resistance patterns when they don't.

Cephalexin on its FDA label Active against Not active S. pyogenes (strep A) S. aureus (not MRSA) S. pneumoniae* E. coli Klebsiella pneumoniae Proteus mirabilis H. influenzae Moraxella catarrhalis MRSA Most enterococci Pseudomonas Acinetobacter Most Enterobacter Morganella, P. vulgaris Resistant pneumococci Viruses (colds, flu)
From the Microbiology and patient counseling sections of the cephalexin FDA label. *Penicillin-susceptible isolates only; penicillin-resistant pneumococci are usually cross-resistant.

So a skin infection that turns out to be MRSA, or a urinary infection caused by Pseudomonas or an enterococcus, needs a different antibiotic. If an infection is not improving, or is getting worse, MedlinePlus advises calling your doctor rather than waiting for the course to end.

What are the side effects of cephalexin?

The most common side effects of cephalexin are diarrhea, nausea, vomiting, indigestion (dyspepsia) and abdominal pain, according to the FDA label, and diarrhea was the most frequent adverse reaction in its clinical trials. Gastritis has also occurred. Other reactions listed in the label include genital and anal itching, genital thrush (candidiasis), vaginitis and vaginal discharge, dizziness, tiredness, headache, agitation, confusion, hallucinations, joint pain and arthritis. As with penicillins and other cephalosporins, short-lived hepatitis and cholestatic jaundice have been reported, along with slight rises in the liver enzymes AST and ALT. Changes in blood cells are listed too: eosinophilia, neutropenia, thrombocytopenia and hemolytic anemia. Reversible interstitial nephritis, an inflammation of the kidneys, has also been reported. MedlinePlus advises telling your doctor if nausea, vomiting, diarrhea, heartburn, stomach pain, rectal or genital itching, extreme tiredness, dizziness, headache or joint pain is severe or does not go away, and getting help at once for the serious symptoms below.

Serious reactions in the label's warnings

Get emergency care for swelling of the face, lips, tongue or throat, wheezing, or trouble breathing or swallowing. MedlinePlus also lists rash, itching or hives, hallucinations, and a return of fever, sore throat or chills as reasons to call your doctor immediately. Not every rash on an antibiotic is an allergy, and our guide to hives explains what hives look like and what can trigger them.

Cephalexin and C. difficile: when diarrhea needs attention

Clostridioides difficile-associated diarrhea, called C. diff, is a bowel infection that the cephalexin FDA label lists as a warning, because it has been reported with nearly all antibacterial agents, including cephalexin. Antibiotics change the normal bacteria of the colon, which lets C. difficile overgrow and release toxins A and B. The label says C. diff can range from mild diarrhea to fatal colitis, that hypertoxin-producing strains can resist treatment and may need surgical removal of the colon, and that it has been reported more than two months after an antibacterial drug was given. The US Centers for Disease Control and Prevention (CDC) says people are up to 10 times more likely to get a C. diff infection while taking an antibiotic, with the risk continuing into the month after it ends, and estimates almost half a million infections in the United States each year. The CDC names people aged 65 or older, people with weakened immune systems and hospital or nursing home patients as higher risk.

Up to 10×higher C. diff risk while on an antibiotic (CDC)
~500,000C. diff infections in the US each year (CDC)
2+ monthsafter antibiotics, C. diff has still been reported (label)

Ordinary diarrhea is common on antibiotics, and the label says it usually settles once the drug is stopped. Frequent watery or bloody diarrhea is different: the label says it may be a sign of a more serious bowel infection and advises contacting your healthcare provider. The CDC lists diarrhea, fever, stomach pain or tenderness, loss of appetite and nausea as C. diff symptoms, and says anyone who has taken antibiotics recently and has these symptoms should contact a healthcare professional, even weeks after the last capsule.

Can you take cephalexin with a penicillin allergy?

Many people with a penicillin allergy label can take cephalexin, but cephalexin is one of the cephalosporins where a true amoxicillin or ampicillin allergy matters most. The cephalexin FDA label says cross-hypersensitivity among beta-lactam drugs may occur in up to 10% of patients with a history of penicillin allergy. The 2022 drug allergy practice parameter from the Joint Task Force of the AAAAI and ACAAI, the two US allergy societies, explains that this figure comes from early estimates of 8%, rounded to 10% on the FDA package insert, and calls it falsely high, partly because cephalosporins were contaminated with penicillins before 1980. Across 12 clinical studies after 1980, 8 of 417 patients (2%) with a penicillin allergy history reacted to a cephalosporin. The parameter adds that about 10% of patients report a reaction to a penicillin, yet 90% or more of them tolerate penicillins when evaluated. Cross-reactivity depends mainly on the R1 side chain, and cephalexin has the same R1 side chain as ampicillin.

~10%of patients report a penicillin allergy (2022 parameter)
≥90%of them tolerate penicillins when evaluated
2%(8 of 417) reacted to a cephalosporin in studies after 1980
16.45%skin-test cross-reactivity to cephalexin-type cephalosporins in proven penicillin allergy, vs 2.11% for dissimilar ones

What the 2022 practice parameter suggests

The parameter also recommends a proactive effort to remove penicillin allergy labels where appropriate, because people carrying the label are more often given less effective or more toxic antibiotics and are more likely to develop C. difficile or MRSA. Skin testing with cephalexin itself has no clear use, the parameter notes, because oral cephalosporins aren't sterile.

Which of these branches applies depends on the details of the old reaction: which drug, what happened, how long ago, and whether it was ever confirmed. If you are a clinician, pharmacist or student working through an allergy history, AskMed lets you describe it, such as hives with amoxicillin in childhood and no testing since, and ask whether cephalexin or cefazolin fits the 2022 parameter's recommendations. The answer quotes the consensus statements it relies on, each linked to the parameter, so you can check the wording against your local allergy pathway.

Check a beta-lactam allergy question in AskMed:

What drugs interact with cephalexin?

The cephalexin FDA label lists two drug interactions, metformin and probenecid, plus one effect on a laboratory test. Metformin, a diabetes medicine that is also cleared by the kidneys, reaches higher levels when it is taken with cephalexin: in healthy volunteers given single doses of both, the average peak metformin level rose by 34%, total exposure by 24%, and metformin's clearance by the kidneys fell by 14%. The label recommends careful monitoring and an adjustment of the metformin by the prescriber, says to monitor for low blood sugar, and notes that there is no information on what happens with repeated doses of either drug. Probenecid, a gout medicine, stops the kidneys from excreting cephalexin, and the label says taking the two together is not recommended. Cephalexin can also cause a false-positive result when urine is tested for glucose with Benedict's or Fehling's solution, which matters for anyone who checks urine sugar at home.

Two more points sit elsewhere. The label's warnings say cephalosporins may prolong the prothrombin time, especially in people on anticoagulant treatment, so clotting tests may need checking. And MedlinePlus advises that cephalexin may make hormonal contraceptives less effective and suggests using another method during treatment, although the FDA label's interaction section doesn't list this, so it is worth asking the prescriber. For how to check a whole medicine list, see our guide on using AI to check drug interactions safely.

A prescription for cephalexin often lands on top of a long list of regular medicines, and interaction checkers don't always say where a warning comes from. AskMed answers from drug labels and studies with the source linked, so you can ask whether cephalexin interacts with each medicine on the list, for example metformin, a blood thinner or a gout medicine, and see the exact label section behind each answer before you raise it with your pharmacist or prescriber.

Check a cephalexin interaction in AskMed:

Is cephalexin safe in pregnancy and while breastfeeding?

The cephalexin FDA label says that published epidemiologic studies and pharmacovigilance case reports from several decades of use in pregnant women have not established a drug-associated risk of major birth defects, miscarriage, or adverse outcomes for the mother or the baby. These studies have limitations, including small sample sizes, retrospective data collection and inconsistent comparison groups. In animal reproduction studies, cephalexin given to pregnant mice and rats while the organs were forming showed no harm to the developing young, and a rat study running from day 15 of pregnancy until the pups were 21 days old showed no effects on birth, litter size or the growth of the offspring. The label gives the background risk in clinically recognized pregnancies in the US general population as 2% to 4% for major birth defects and 15% to 20% for miscarriage, and says the background risk for the population that needs cephalexin is unknown. MedlinePlus advises telling your doctor if you are pregnant, plan to become pregnant or are breastfeeding.

For breastfeeding, the label's lactation section says a published clinical study found cephalexin in human milk, and that the baby's relative exposure through milk is considered less than 1% of the mother's weight-adjusted exposure. There are limited data on effects in the breastfed child and none on milk production, so the label asks the prescriber to weigh the benefits of breastfeeding against the mother's need for cephalexin and any possible effect on the baby. For children, the label says safety and effectiveness haven't been established in babies younger than one year, and that capsules should only be used in children who can swallow them.

Pregnancy is often when the choice between antibiotics is weighed most carefully, and the evidence is spread across label sections and studies. With AskMed you can ask what the pregnancy and lactation sections of the cephalexin label say, side by side with another antibiotic you have been offered, and get both answers with links to the sections they come from, ready to discuss with your obstetrician, midwife or pharmacist.

Compare antibiotic labels for pregnancy in AskMed:

Frequently asked questions

Is cephalexin a penicillin?

No. Cephalexin is a first-generation cephalosporin. Cephalosporins and penicillins are both beta-lactam antibiotics and share the beta-lactam ring, which is why an allergy to one raises questions about the other, but they are different drug classes.

Does cephalexin treat a urinary tract infection?

The FDA label covers genitourinary tract infections, including acute prostatitis, caused by susceptible E. coli, Proteus mirabilis and Klebsiella pneumoniae. It does not cover Pseudomonas or most enterococci, so a urine culture can show whether cephalexin will work.

Does cephalexin work against MRSA?

No. The label states that methicillin-resistant staphylococci are resistant to cephalexin. It is active against Staphylococcus aureus only when the isolate is methicillin-susceptible.

Can I take cephalexin if I'm allergic to amoxicillin?

It depends on the reaction. The 2022 practice parameter suggests a cephalosporin can be given without testing after an unverified penicillin reaction that wasn't anaphylaxis. After anaphylaxis or a proven aminopenicillin allergy, cephalexin's shared side chain matters, so ask the prescriber or an allergist.

Is diarrhea on cephalexin a reason to worry?

Mild diarrhea is the most common side effect and usually settles when the antibiotic stops. Frequent watery or bloody diarrhea, cramps or fever, even weeks after the course, can mean C. diff and needs a call to your healthcare provider.

Sources

  1. Teva Pharmaceuticals USA. Cephalexin capsules, USP: prescribing information. DailyMed, US National Library of Medicine. Revised 8/2026.
  2. Khan DA, Banerji A, Blumenthal KG, et al. Drug allergy: A 2022 practice parameter update. J Allergy Clin Immunol. 2022;150(6):1333-1393.
  3. Herman TF, Hashmi MF. Cephalexin. StatPearls. Treasure Island (FL): StatPearls Publishing; updated 2023.
  4. MedlinePlus. Cephalexin. US National Library of Medicine; revised 15 June 2026.
  5. Centers for Disease Control and Prevention. About C. diff. 2026.

Cited medical answers
you can trust.

AskMed on iPhone, iPad, Android and the web.