Skip to main content
Drug bottle and Pill

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.

Browse medications

View All

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