Key takeaways
Cephalexin is an antibiotic used to treat a variety of infections, including some UTIs.
Cephalexin is not a first-line treatment for adult UTIs, but it is a go-to antibiotic for pediatric UTIs.
Patients prescribed cephalexin for a UTI can expect symptoms to resolve within a couple of days. It’s essential to finish the full course of treatment to prevent another infection.
Cephalexin is a generic prescription antibiotic used to treat a wide variety of bacterial infections. Though cephalexin is sometimes used for urinary tract infections (UTIs), it is not always considered a first-line treatment for this type of infection. Keep reading to learn more about cephalaxin for UTIs, including how it works against UTI-causing bacteria, the standard cephalexin dosage for UTIs, and key side effects and safety considerations.
What is cephalexin?
Cephalexin is an oral antibiotic that was once sold under the brand name Keflex. It is classified as a first-generation cephalosporin antibiotic. Cephalexin is approved by the Food and Drug Administration (FDA) to treat a variety of infections, including certain respiratory infections, middle ear infections, skin infections, bone infections, and genitourinary tract infections.
Cephalexin can effectively treat many types of infections because it is a broad-spectrum antibiotic, meaning it kills several types of bacteria. “Cephalexin works best against many common bacteria, especially ones like Staphylococcus and Streptococcus. It also fights some other bacteria such as E. coli, Klebsiella, and Proteus,” says Oluwatosin Ajao, MD, a board-certified internal medicine physician and lifestyle and obesity medicine specialist in Houston, Texas.
Is cephalexin good for UTIs?
Cephalexin can be good for treating UTIs in some cases. “While cephalexin is a solid antibiotic, it usually isn’t the first choice for adult UTIs,” says Heather Gosnell, MD, a board-certified pediatrician and plant-based health coach in Phoenix, Arizona. However, she says cephalexin is “a go-to” for UTIs in children because of its safety, effectiveness, and availability in easy-to-swallow liquid forms.
A UTI is a bacterial infection anywhere along the urinary tract. Lower urinary tract infections involve the urethra or bladder, while upper UTIs occur when bacteria reach the kidneys. Treatment is important because upper UTIs can cause permanent damage. A urine culture can help healthcare providers determine which type of bacteria caused the infection.
Cephalexin works by attacking the outer cell wall of the bacteria that cause UTIs. “You can think of the bacteria’s wall like a protective shell. Cephalexin makes holes in this wall and stops the bacteria from fixing or rebuilding it. Without a strong wall, the bacteria break apart and die,” Dr. Ajao explains.
While clinical trials show that cephalexin is effective against uncomplicated urinary tract infections, most healthcare providers prefer prescribing antibiotics that target the specific bacteria causing the UTI (versus a broad-spectrum antibiotic that attacks a variety of bacteria in the urinary tract). Examples include nitrofurantoin, fosfomycin, and sulfamethoxazole-trimethoprim. Using antibiotics that target specific bacteria causing the infection can help prevent antibiotic resistance, in which bacteria evolve to no longer respond to antibiotic treatment.
Cephalexin dosage for UTIs
Cephalexin for uncomplicated UTIs is taken either twice daily or four times daily. In some cases, healthcare providers prescribe a dosage of 250 milligrams (mg) every six hours, for a total of four daily doses. In other situations, 500 mg of cephalaxin is taken every 12 hours, for a total of two doses in 24 hours.
Cephalexin dosing for UTIs in children is based on the patient’s weight. According to the drug’s label, the pediatric dosage range is 25–50 mg per kilogram of body weight. This total dose is then divided into equal doses over seven or 14 days.
All patients need to complete the full course of prescribed antibiotics, even if UTI symptoms have resolved. The full course of cephalexin will kill all UTI-causing bacteria, preventing a second infection.
Cephalexin dosage chart for UTIs |
||
|---|---|---|
| Patient | Standard dosage | Maximum dosage |
| Adults | 250 mg every 6 hours
or 500 mg every 12 hours |
4,000 mg every 24 hours |
| Adolescent patients (ages 15–17) | 250 mg every 6 hours
or 500 mg every 12 hours |
Consult a healthcare provider |
| Pediatric patients (ages 1–14) | 25 mg to 50 mg/kg given in equally divided doses for 7 to 14 days (per prescriber’s instructions) | Consult a healthcare provider |
How long does cephalexin take to work for UTIs?
Dr. Ajao says that while cephalexin starts attacking bacteria within hours of taking the medication, it takes several days for the infection to be cleared entirely. “Most adults will be prescribed a three-to-seven-day course of cephalexin, while children typically need a bit longer, usually seven to 10 days,” Dr. Gosnell adds. “Even if you start feeling better within the first 48 to 72 hours, you have to finish the whole bottle to make sure the infection is completely gone.”
Most people notice significant improvements after a couple of days on cephalexin. It’s important to tell your prescriber if UTI symptoms still persist after a few days on the medication, as it’s possible that you need a different dose or drug.
Cephalexin vs. amoxicillin for UTIs
Cephalexin and amoxicillin are both antibiotics sometimes used to treat UTIs. However, neither is a first-line UTI treatment. Dr.Gosnell says that when first options can’t be used due to an allergy or other contraindication, most prescribers prefer cephalexin over amoxicillin. “Amoxicillin on its own is rarely recommended anymore because so many UTI-causing bacteria have learned how to beat it,” she adds.
Cephalexin side effects and safety considerations
Like all medications, cephalexin can cause side effects. Common side effects of cephalexin include gastrointestinal symptoms such as nausea, vomiting, and diarrhea. Some people may also experience rash, headaches, and dizziness.
Many individuals with an allergy to penicillin can still take cephalexin, but it’s important to consult a healthcare provider for personalized medical advice. It’s also important to be aware of the signs of an allergic reaction. Anyone who has had a previous allergic reaction to cephalexin or its inactive ingredients (such as binders or dyes) should not take this medication. Symptoms of an allergic reaction to cephalexin or other medicines can include urticaria (hives), swelling of the face or tongue, fever, and trouble breathing. In severe cases, allergic reactions can result in loss of consciousness or death. Seek urgent medical attention if signs of an allergic reaction develop after taking cephalexin.
Mixing cephalexin with certain medications, such as warfarin and metformin, can also cause a negative interaction. Cephalexin drug interactions and complications can be avoided by sharing a full list of medications, including prescription drugs, over-the-counter medications, and supplements, with your healthcare provider before starting this antibiotic.
Seek personalized medical advice about whether it is safe for you to use cephalexin while pregnant or breastfeeding. Limited research shows that cephalexin can pass into breast milk, so some providers recommend against nursing while taking it.
How SingleCare can help you save on cephalexin
Without insurance or discounts, the average retail price of cephalexin is $45 for 28, 500 mg capsules. A SingleCare prescription discount card or coupon can lower the cost of cephalexin to $9 for 28, 500 mg capsules, depending on your choice of pharmacy. Prices vary by pharmacy and location, but the SingleCare website and app can help you compare prices near you.
The SingleCare prices in this article are the most accurate at the time of publishing in ZIP code 23666 as of Feb. 19, 2026. Prices vary by pharmacy. Visit our cephalexin coupon page for updated cephalexin prices near you.
- Cephalexin capsule, DailyMed (2026)
- Cephalexin twice daily versus four times daily for the treatment of urinary tract infections diagnosed in the emergency department, The American Journal of Emergency Medicine (2025)
- Treating urinary tract infections in the era of antibiotic resistance, Expert Review of Anti-infective Therapy (2023)
- Cephalosporins can be prescribed safely for penicillin-allergic patients, Journal of Family Practice (2006)
- Cephalexin, Drugs and Lactation Database (2024)
- Differentiation of upper and lower urinary tract infections: How and when, Medical Clinics of North America Journal (1984)
- Urine culture, StatPearls (2023)
- Cefdinir versus cephalexin for the treatment of uncomplicated urinary tract Infections, Open Forum Infectious Diseases (2025)