Skip to main content

Compare
Bactrim vs. Keflex

Head-to-head comparisons of medication uses, side effects, warnings, and more.

Key takeaways

Sulfamethoxazole/trimethoprim (Bactrim, Septra) and cephalexin (Keflex) are both antibiotics used to treat bacterial infections, but they belong to different classes. Sulfamethoxazole/trimethoprim is a combination of a sulfonamide and an antifolate, while cephalexin is a cephalosporin antibiotic. Sulfamethoxazole/trimethoprim is typically taken twice a day and can be used for a variety of infections, including UTIs, ear infections, and certain types of pneumonia. Cephalexin, on the other hand, is usually taken 2 to 4 times a day and is used for respiratory tract infections, skin infections, and bone infections, among others. Both medications are available in generic forms and can be taken as tablets, capsules, or liquid suspensions. However, sulfamethoxazole/trimethoprim is not recommended for people with sulfa allergies, while cephalexin may not be suitable for those with severe allergies to penicillin or other cephalosporins. Common side effects for both include nausea, vomiting, and diarrhea, but sulfamethoxazole/trimethoprim can also make your skin more sensitive to the sun.

Sulfamethoxazole/trimethoprim

 

Get free coupons

Cephalexin

 

Get free coupons

Summary for Bactrim

Prescription only

Sulfamethoxazole/trimethoprim (sometimes known as SMZ/TMP) is a combination medication containing an antifolate and sulfa antibiotic. It's used to treat different types of infections, such as urinary tract infections (UTIs), ear infections, and lung infections. This antibiotic has two different brand names, Bactrim and Septra, and it's also available as a lower-cost generic. It's a tablet that's taken by mouth, typically twice daily for most types of infections. This antibiotic also comes as a suspension under the brand name Sulfatrim for people who can't swallow tablets and as an injection for people in the hospital. Common side effects include nausea, diarrhea, and rash.

Indications for Bactrim

Pros and Cons for Bactrim

Pros

  • Treats many types of bacterial infections
  • Can be given to children as young as 2 months old to treat certain infections
  • Available as a lower-cost generic

Cons

  • Can upset your stomach and make your skin more sensitive to the sun
  • Not the best choice for people with liver or kidney problems
  • Not recommended if you're pregnant
  • Can't take if you have a sulfa allergy

Common Side Effects for Bactrim

Warnings for Bactrim

  • Not for use during pregnancy
  • Severe allergic reactions and skin reactions
  • Low platelet counts and risk for bleeding
  • Diarrhea from Clostridioides difficile infection
  • Low sodium levels and high potassium levels
  • Blood cell-related problems
  • Problems with processing phenylalanine - for people with phenylketonuria (PKU) only

Summary for Keflex

Prescription only

Cephalexin, also commonly known as Keflex, is a cephalosporin antibiotic for people ages 1 year and older. It can treat many types of bacterial infections. This includes ear infections, skin infections like cellulitis, urinary tract infections (UTIs), and strep throat. Cephalexin comes as capsules, tablets, and a liquid suspension. It's taken by mouth 2 to 4 times per day. Side effects can include nausea, vomiting, and diarrhea. Cephalexin is a generic medication; its brand name Keflex is no longer available.

Indications for Keflex

Pros and Cons for Keflex

Pros

  • Treats several common types of bacterial infections
  • Okay for children as young as 1 year old to take
  • Available as a liquid for people who have trouble swallowing pills

Cons

  • Usually need to take a few times per day
  • Might not be able to take if you're allergic to penicillins or other cephalosporin antibiotics
  • Not recommended for the cold or flu (these are viral illnesses, not bacterial infections)

Common Side Effects for Keflex

  • Diarrhea
  • Nausea
  • Vomiting
  • Indigestion
  • Stomach pain

Warnings for Keflex

  • Allergic reactions
  • Diarrhea from Clostridioides difficile infection
  • Seizures
  • Higher risk of bleeding
  • Possible development of drug-resistant bacteria

Prices with our coupons for Bactrim vs. Keflex

Price Card Drug Icon
Sulfamethoxazole/Trimethoprim14 tablets / 800mg/160mg
$8.90$10.89
Get free coupons
More Information
Price Card Drug Icon
Cephalexin28 capsules / 500mg
$10.68$29.98
Get free coupons
More Information

Browse medications by letter

Show All

Browse prescription and over-the-counter medications from A to Z, compare drug prices, and start saving.