Evidence-based information on diseases, symptoms and medicines

Not a substitute for professional medical advice

Home » Medicines A–Z » Cephalexin (Keflex)

Cephalexin (Keflex)

Last reviewed November 25, 2026 · Researched by the Trusted Medicoz editorial team

Cephalexin is a prescription cephalosporin antibiotic taken by mouth for bacterial infections of the skin, ears, throat and airways, bones and urinary tract. The most common cephalexin side effects are diarrhea, nausea, vomiting, indigestion and stomach pain. Serious allergic reactions and severe diarrhea are rare but need prompt medical care.

Key facts

  • Drug class: first-generation cephalosporin antibiotic
  • Used for: bacterial infections of the skin, middle ear, airways, bones and genitourinary tract
  • US status: prescription only (Rx); not a controlled substance
  • US brand: Keflex (brand now discontinued; sold as generic cephalexin)
  • Forms: capsules, tablets and liquid suspension
  • Most common side effect: diarrhea

What is cephalexin used for?

Cephalexin is used to treat infections caused by bacteria that are sensitive to it. The US prescribing information for cephalexin capsules lists five approved uses:

  • Respiratory tract infections, such as strep throat and some chest infections caused by Streptococcus bacteria
  • Middle ear infections (otitis media)
  • Skin and skin structure infections, such as cellulitis and infected wounds caused by staph or strep bacteria
  • Bone infections caused by susceptible bacteria
  • Genitourinary tract infections, including bladder infections and acute prostatitis

Doctors often choose cephalexin for common skin and soft-tissue infections because it works well against the staph and strep bacteria that usually cause them. It does not work against MRSA (methicillin-resistant Staphylococcus aureus), most enterococci or Pseudomonas. For a broader look at how bacterial and viral illnesses differ, see our infectious diseases guide.

MedlinePlus notes another use: some people with certain heart conditions who are allergic to penicillin take cephalexin before a dental procedure to help prevent a heart valve infection. Cephalexin will not help colds, flu, COVID-19 or other viral infections. Taking an antibiotic you do not need raises the risk of antibiotic resistance and side effects without any benefit.

How cephalexin works

Bacteria are protected by a rigid cell wall. Cephalexin is a beta-lactam antibiotic, the same broad family as penicillin and amoxicillin. It blocks the enzymes bacteria use to build that wall. Without a sound wall, the bacteria burst and die, so cephalexin is described as bactericidal (bacteria-killing) rather than simply slowing growth.

The medicine is well absorbed from the gut and can be taken with or without food. According to the label, levels in the blood peak about one hour after a dose. More than 90% of the drug leaves the body unchanged in the urine within eight hours. This is why the kidneys matter so much: people with reduced kidney function clear cephalexin more slowly and may need a different schedule chosen by their prescriber.

Generic and US brand names

Keflex was the original US brand of cephalexin. Drugs@FDA now lists the Keflex capsules and suspension as discontinued, and the FDA has stated they were not withdrawn for safety or effectiveness reasons. Today, cephalexin in the United States is sold mainly as a generic made by several manufacturers.

Brand name

Form and strengths sold in the US

Rx or OTC

Notes

Keflex

Capsules (250 mg, 333 mg, 500 mg, 750 mg); oral suspension

Rx

Brand discontinued in the US; not for safety reasons

Cephalexin (generic)

Capsules: 250 mg, 333 mg, 500 mg, 750 mg

Rx

The most widely dispensed form

Cephalexin (generic)

Tablets: 250 mg, 500 mg

Rx

Made by fewer manufacturers

Cephalexin (generic)

Oral suspension: 125 mg/5 mL, 250 mg/5 mL

Rx

Liquid often used for children; kept in the refrigerator

How cephalexin is usually taken

This section gives general label information only. Your dose, how often you take it and how long the course lasts depend on the infection, your age, your weight (for children) and your kidney function. Always follow your prescriber, your pharmacist and the patient leaflet.

  • Cephalexin is taken by mouth, usually every 6 or 12 hours, for 7 to 14 days depending on the infection, as described by MedlinePlus.
  • It can be taken with or without food. Try to take it at about the same times each day.
  • Shake the liquid well before each dose and measure it with the dosing device from the pharmacy, not a kitchen spoon.
  • Keep taking it for the full course, even if you feel better after a few days. Stopping early can let the infection return and helps bacteria become resistant.
  • If you miss a dose, take it when you remember unless it is nearly time for the next one. Do not take a double dose.

Most people start to feel better within the first few days. If your symptoms are not improving, or are getting worse, contact your doctor. Do not share cephalexin or save leftover capsules for a future illness.

Cephalexin side effects

Most people take cephalexin without serious problems. In clinical trials listed on the FDA label, the most frequent cephalexin side effect was diarrhea. Stomach and gut symptoms are the most common group overall, and they usually settle once the course ends.

Common side effects

  • Diarrhea
  • Nausea and vomiting
  • Indigestion or heartburn
  • Stomach pain
  • Rectal or genital itching; vaginal yeast infection or discharge
  • Dizziness, tiredness or headache
  • Joint pain

Tell your doctor or pharmacist if any of these are severe or do not go away. Drinking fluids and eating bland food can help with mild stomach upset. Do not take anti-diarrhea medicine without checking first, because it can hide a more serious bowel infection.

Serious side effects — get help

Some cephalexin side effects are rare but serious. Stop taking it and get medical help right away if you notice:

  • Signs of an allergic reaction: rash, itching or hives; swelling of the face, lips, tongue or throat; wheezing or trouble breathing or swallowing
  • Severe skin reactions: blistering, peeling skin or sores in the mouth (Stevens-Johnson syndrome or toxic epidermal necrolysis)
  • Severe diarrhea: watery or bloody stools, stomach cramps or fever, during treatment or up to two months or more after it ends. This may be C. difficile infection.
  • Yellowing of the skin or eyes or dark urine, which can signal liver problems
  • Unusual tiredness, pale skin or shortness of breath, which may point to anemia from red blood cells breaking down
  • Confusion, hallucinations or seizures, more likely in people with kidney problems
  • A new fever, sore throat or chills, or unusual bleeding or bruising

When to get urgent help

Call 911 if you have trouble breathing, swelling of the throat or tongue, or you feel faint after taking cephalexin. For a possible overdose, call Poison Help at 1-800-222-1222. You or your doctor can report side effects to the FDA through MedWatch at 1-800-FDA-1088.

Who should not take it, and cautions

You should not take cephalexin if you have had an allergic reaction to cephalexin or any other cephalosporin, such as cefdinir. Before you start, tell your doctor about any past reaction to penicillins as well. The label notes that cross-reactions between beta-lactam antibiotics may occur in up to 10% of people with a penicillin allergy, so your prescriber will weigh what kind of reaction you had. Learn more about drug allergies and how they are recognized.

Tell your prescriber before taking cephalexin if you have:

  • Kidney disease, including dialysis (the dose may need changing)
  • A history of colitis or other bowel disease
  • Liver disease
  • A bleeding disorder, poor nutrition or you take a blood thinner; cephalosporins can occasionally prolong blood clotting time
  • A history of seizures

Older adults are more likely to have reduced kidney function, so prescribers take extra care when choosing their dose. Cephalexin capsules are only suitable for children who can swallow them safely; the liquid form is often used for younger children.

Interactions

Tell your doctor and pharmacist about every prescription medicine, over-the-counter product, vitamin and herbal supplement you take. The prescribing information highlights these interactions:

  • Metformin: cephalexin can raise metformin levels in the blood. Your doctor may monitor you more closely or adjust your diabetes treatment.
  • Probenecid: slows how fast the kidneys remove cephalexin. Taking them together is not recommended.
  • Hormonal birth control: MedlinePlus advises using a backup method of contraception while taking cephalexin.
  • Urine glucose tests: cephalexin can cause a false-positive result on some older copper-based urine sugar tests (Benedict's or Fehling's solution).

Cephalexin is not interchangeable with other antibiotics. For example, Bactrim (sulfamethoxazole/trimethoprim) is sometimes used for skin infections when MRSA is suspected, while antivirals such as valacyclovir treat viral infections that cephalexin cannot touch. Your prescriber picks the antibiotic based on the likely germ, local resistance patterns and your allergy history.

Pregnancy and breastfeeding

According to the US label, decades of published studies and case reports in pregnant women have not shown that cephalexin increases the risk of major birth defects, miscarriage or other poor outcomes, although the studies have limitations. Animal studies also showed no harm to the developing baby. Cephalexin is commonly prescribed in pregnancy when an antibiotic is needed, but tell your doctor if you are pregnant or planning to become pregnant.

Cephalexin passes into breast milk in small amounts. The label estimates the baby receives less than 1% of the mother's weight-adjusted dose. If you are breastfeeding, watch your baby for diarrhea, rash or thrush, and contact your pediatrician if these appear.

Storage

  • Store capsules and tablets at room temperature, 68°F to 77°F (20°C to 25°C), in a tightly closed container away from heat and moisture. A bathroom is not a good place.
  • Keep the mixed liquid suspension in the refrigerator and throw away any unused portion after 14 days.
  • Keep all medicines up and away, out of the sight and reach of children.
  • Do not flush leftover medicine. Use a drug take-back program or ask your pharmacist how to dispose of it safely.

For more on how infections in this group are diagnosed and treated, browse our ear, nose and throat conditions, which include sore throats and ear infections.

Frequently asked questions

Can I take cephalexin if I am allergic to penicillin?

It depends on the reaction you had. Cephalexin is related to penicillin, and cross-reactions can occur in up to 10% of people with a penicillin allergy, according to the US label. Anyone who has had a severe or immediate reaction to a penicillin or cephalosporin should tell their prescriber, who will decide whether cephalexin or a different antibiotic is safer.

Is cephalexin a strong antibiotic?

Cephalexin is a first-generation cephalosporin that kills bacteria rather than just slowing them down. It works well against common staph and strep skin infections and some urinary infections, but it does not cover MRSA, Pseudomonas or many resistant germs. Whether it is the right choice depends on the infection, not on how strong it is.

How long do cephalexin side effects last?

Common side effects such as nausea or loose stools usually ease within a few days of finishing the course. Diarrhea that is watery, bloody or comes with fever and cramps, even weeks after stopping, can signal C. difficile infection and needs a call to your doctor.

What should you not take with cephalexin?

The label advises against taking probenecid with cephalexin and recommends close monitoring with metformin. MedlinePlus also recommends a backup form of birth control. Check with your pharmacist before adding any new medicine or supplement.

How quickly does cephalexin work?

Many people start to feel better within the first few days of treatment, as noted by MedlinePlus. Finish the full course your prescriber ordered. If you are not improving after a few days, or you feel worse, contact your doctor.

Medical disclaimer

This page is for general information and education only. It is not a substitute for professional medical advice, diagnosis or treatment, and it does not tell you what dose of any medicine to take. Always follow the advice of your doctor or pharmacist and the patient leaflet that comes with your medicine. If you think you may have a medical emergency, call your local emergency number immediately.