Skip to main content
Drug Info

Using cephalexin for urinary tract infections

Cephalexin may be used to treat uncomplicated UTIs
A pharmacist talking to a patient: Cephalexin for UTI

Key takeaways

  • Cephalexin (i.e., Keflex, Biocef, Daxbia) is a first-generation cephalosporin antibiotic used to treat infections in many parts of the body. Cephalexin is commonly prescribed for urinary tract infections (UTIs).

  • Cephalexin is considered a broad-spectrum antibiotic because it is effective against a wide variety of bacteria.

  • The typical dosage for adults is 250 mg or 500 mg cephalexin capsules two to four times a day. Larger dosages may be given for more severe bacterial infections. In pediatric cases, dosing is generally determined based on the child’s body weight. The course is usually given for seven to 14 days.

  • New research shows that twice-daily cephalexin is as effective as four times daily.

  • While cephalexin is generally well tolerated, side effects may include diarrhea, nausea, dizziness, headache, and fatigue.

A urinary tract infection (UTI) is an infection of the urinary system, which includes the bladder, urethra, kidneys, and ureters. A UTI is usually caused by bacteria, such as Escherichia coli (E. coli), entering the urethra, the tube through which urine travels. UTIs are more common in women than men. Cephalexin, an antibiotic in the cephalosporin class, has been used to treat UTIs for decades. The oral medication, approved by the Food and Drug Administration (FDA) in 1971, works as an antimicrobial, killing the bacterial cells that caused the UTI.

Is cephalexin good for UTIs?

Cephalexin is a broad-spectrum antibiotic that treats many different types of bacteria. Cephalexin (brand names include Keflex, Keftab, Biocef, and Daxbia) targets many bacteria that cause UTIs.

Marissa Visingardi, PA-C, a urology physician assistant at Associated Medical Professionals in New Hartford, New York, treats up to 20 UTIs daily. Uncomplicated UTIs are those that occur in the bladder and urethra in otherwise healthy patients. Complicated UTIs are defined as UTIs with other symptoms that indicate the infection has spread beyond the bladder. Symptoms include fever, chills or rigors, flank pain, and pelvic pain in males. Other patient populations that require special consideration include immunocompromised patients, men, kidney transplant recipients, and pregnant women because they have a higher risk of complications. Visingardi said while she has had success treating patients with uncomplicated UTIs, she probably would not use cephalexin for patients who have a UTI that traveled into the kidney and caused a kidney infection.

A 2024 comparative study found that cephalexin for the treatment of UTIs had a failure rate of 8.3% at seven days of treatment and 11.8% at 14 days. According to research, approximately 90% of cephalexin is excreted in the urine after six hours, and this pharmacokinetic profile makes it particularly effective in treating UTIs.

Cephalexin is not considered a first-line antibiotic for empirically (without culture results) treating uncomplicated UTIs, according to the 2011 Infectious Diseases Society of America guidelines. Some experts argue these guidelines are based on out-of-date data, but little literature supports its use. 

Caroline Lu, M.D., a urologist at Georgia Urology in the Atlanta area, said that cephalexin is not her go-to for UTIs because it’s so broad. She explained, “It all really depends on what exact organism the patients are growing. If Keflex is the one that works well and isn’t resistant, go ahead and go with Keflex. But because it works on so many things, there’s been recent efforts from urologists as a specialty to not use that right out of the gate.”

According to the 2022 American Urological Association guidelines, other antibiotics with more favorable efficacy, such as Bactrim (trimethoprim-sulfamethoxazole), Macrobid (nitrofurantoin), and Monurol (fosfomycin), are recommended as first-line treatments over cephalexin.

Which antibiotic is the best for UTI?

Over the past few decades, antibiotic resistance has increased because antibiotics are so commonly prescribed. Resistance happens when bacteria evolve, so the antibiotics cannot stop or slow their growth.

Lu said she selects an antibiotic based on the UTI patient’s urine culture. A urine culture is a lab test that identifies the bacteria causing the UTI. Lu also considers the local antibiotic resistance patterns in the community where she is practicing because resistance varies by location.

Visingardi said that while she has not seen much resistance to cephalexin in central New York, where she practices, she does not consider it the “best antibiotic.” Patients will often say they want “strong antibiotics or the best antibiotic,” Visingardi said. Ultimately, the best antibiotic choice primarily depends on the urine culture results. 

How long does cephalexin take to work for UTIs?

Cephalexin takes about an hour to reach peak levels in the blood. Many patients start to feel their symptoms improve within one to two days. Common UTI symptoms include frequent urge to urinate, pain when urinating, lower abdominal pain (usually in the area above the pubic bone), foul-smelling urine, and blood in the urine.

If the infection is more severe, antibiotic treatment may take longer to work. A full treatment course is seven to 14 days long, depending on the severity and type of UTI. Visingardi finds that cephalexin will clear up the infection within seven days for most patients. However, if the UTI is a recurrent infection or the patient has already been on a different antibiotic for seven days and it did not work, Visingardi may extend the course to 10 or 14 days. It is very important to take the medication for the full prescribed course, even if the symptoms have gone away. Stopping the antibiotics early can lead to partially treated infections that will return and contribute to antibiotic resistance. 

Cephalexin can be taken with or without meals. It does not matter if it’s taken with meals or on an empty stomach.

Cephalexin dosage for UTIs in adults

Cephalexin dosing depends on many factors, including the severity of the infection, the patient’s medical issues, and lab work (if any). It is typically prescribed in 250 mg or 500 mg tablets every six to 12 hours or two to four times a day.

A 2023 study looked at dosing frequency in women with uncomplicated UTI and found that twice-a-day dosing is as effective as four times a day. “That change from taking a pill four times a day to just taking a pill two times a day makes it way less burdensome for patients to complete the antibiotics,” Lu said. Reducing the frequency with which you have to take the medication per day may also help to reduce some of the side effects

Cephalexin side effects 

Cephalexin is generally well tolerated and has a low incidence of adverse events and side effects. However, as with any prescription medication, side effects are possible. The most common side effects are diarrhea, nausea, upset stomach, abdominal pain, vomiting, dizziness, fatigue, and headache. In rare cases, serious side effects like transient hepatitis and jaundice can occur. For more on the side effects of cephalexin, see this article.

Cephalexin has the potential to cause allergic reactions, which may include itching, skin rash, and hives. If the patient is allergic to penicillin antibiotics, such as Amoxicillin, they may not be able to take cephalexin because of a risk of allergic cross-reactivity, Lu said. Although cephalexin is not a penicillin, it is similar to penicillin in its structure, action, and side effects. Cephalexin and penicillin are both beta-lactam antibiotics, which work by inhibiting the formation of the bacterial cell wall.

Potential drug interactions with cephalexin include metformin, a common diabetes drug, and Probenecid, a medication for chronic gout. The prescribing physician will need to know what medications the UTI patient is on when considering which antibiotic and dosage to prescribe.

If a patient is pregnant or breastfeeding, they should discuss with their doctor before taking cephalexin because the drug can cross into the breast milk. If the patient has kidney disease or impairment, they may have to take a lower dose of cephalexin because the kidneys are what clear the drug.

The bottom line

Antibiotic treatment is typically the first-line therapy for UTIs. A patient’s health and the type of bacteria found in their urine determine which antibiotic is prescribed, the dosage, and the length of the course. Cephalexin may be an acceptable treatment option for uncomplicated UTIs, according to PubMed research studies and the opinions of one of the healthcare professionals interviewed for this article. Good communication with a healthcare provider is critical so that the provider understands the symptoms and can prescribe the appropriate medication.