Woman using laptop to learn what cephalexin is used for

What Is Cephalexin Used For?

Written on June 28, 2023 by Theresa Vuskovich, DMD. To give you technically accurate, evidence-based information, content published on the Everlywell blog is reviewed by credentialed professionals with expertise in medical and bioscience fields.

Table of contents

Key Points:

  • Cephalexin is used for the treatment of bacterial infections in the genitals, skin, bones, lungs, and oral cavity.[1-3]
  • Cephalexin works by inhibiting bacterial cell wall formation, ultimately killing the bacteria.[1,2]
  • While adverse reactions to cephalexin are uncommon, approximately 5% of patients can develop gastrointestinal side effects, including nausea, vomiting, and diarrhea.[2]

Cephalexin is an antibiotic used for treating a variety of bacterial infections throughout the body.[1-3] Cephalexin is similar to penicillin, another common antibiotic, due to its mechanism of action and ability to treat different types of bacterial infections.[1-3] This article explains cephalexin and answers, “What is cephalexin used for?”

What Is Cephalexin?

Cephalexin is a member of the cephalosporin antibiotic family.[1,2] Other cephalosporin antibiotics include cefazolin, cefuroxime, and ceftriaxone.[4] All cephalosporin antibiotics have a molecular structure with a beta-lactam ring, capable of preventing bacterial cell wall formation.[1] Cephalexin and penicillin (amoxicillin) are similar since both have beta-lactam rings and prevent bacterial cell wall formation.

Cephalexin is a 1st generation cephalosporin, and the U.S. Food and Drug Administration (FDA) approved cephalexin for the treatment of bacterial infections in 1971 under the brand name Keflex®.[2,4] Cephalexin is most effective against gram-positive bacteria such as Staphylococcus aureus.[1] However, cephalexin is also used to treat common gram-negative bacteria such as E.Coli.[1]

Brand name medications containing cephalexin include Biocef®, Daxbia®, Keflex®, Keftab®, and Daxbia®.[2] Cephalexin is available to patients as a pill, tablet, and oral suspension.[1] In the U.S., cephalexin is the most commonly prescribed oral 1st generation cephalosporin.[5] It is important to note that cephalexin is not used for the treatment of viral infections such as flu.[1-3] A healthcare provider may prescribe cephalexin for a variety of bacterial infections, some of which are discussed below.

Urinary Tract Infections (UTIs)

Urinary tract infections (UTIs) are among the most common bacterial infections, with 60% of women experiencing at least one during their life. UTIs are bacterial infections occurring anywhere within the urinary system. Up to 50% of women who have a UTI will have recurrent episodes.[6] Painful or difficult urination (dysuria) is the most common symptom associated with UTIs. Other symptoms include frequent urination and blood in the urine.[6]

The most common cause of UTIs is E.Coli, a bacteria that cephalexin is capable of treating. However, cephalexin is not used as the first treatment option for a UTI. Nitrofurantoin, trimethoprim-sulfamethoxazole (TMP-SMX), and fosfomycin are first-line medications for treating UTIs.[6]

Cephalexin is used for UTI prophylaxis, the prevention of recurrent UTIs. Women who experience frequent UTIs after sexual activity may benefit from UTI prophylaxis.[6] If you think you may have a UTI or want to talk to a healthcare provider about UTI prophylaxis, online treatment is available.

Skin Infections

Cephalexin is used for treating a variety of skin infections, including acne, impetigo, and cellulitis.[7-9] While acne is often treated topically, moderate to severe inflammatory acne may become resistant to topical therapy, requiring systemic medications.[7] Systemic medications for acne include oral tetracycline, doxycycline, minocycline, erythromycin, and cephalexin.[7]

Impetigo (Streptococcal impetigo) is a common bacterial skin infection, most commonly occurring in children aged 2-5.[8] However, impetigo can occur at any age.[8] Impetigo appears as blister-like papules on the skin that break down to form crusty, honey-colored lesions.[8] If the lesions occur in confined areas, topical ointments are recommended.[8] When the lesions are more diffuse, systemic oral antibiotics such as cephalexin are prescribed.[8]

Impetigo usually occurs in the summer or in tropical environments.[8] Individuals with poor personal hygiene, frequent skin abrasions, and scabies have an increased risk of impetigo.[8] Since transmission occurs through direct contact with lesions, it is commonly spread in close contact environments, such as daycare centers or nursing homes.[8]

Cellulitis affects deeper layers of the skin and is most commonly caused by the bacteria Streptococcus pyogenes.[9] Individuals with ulcers, wounds, or fungal skin infections can develop cellulitis.[9] Cellulitis presents as warm, pink lesions that are inflamed and painful.[9] Obesity, venous insufficiency, and IV drug abuse can increase your risk of cellulitis.[9]

Cellulitis can also cause a systemic infection accompanied by a fever, malaise, and chills.[9] For individuals without systemic symptoms of cellulitis, oral antibiotics, including cephalexin, are prescribed.[9] If you have localized cellulitis, your healthcare provider may prescribe an oral antibiotic for five days.[9] If an individual develops a systemic infection, IV antibiotics are often recommended.[9]

Bone Infections

Bone infections (osteomyelitis) occur when bacteria penetrate the bone, causing inflammation and potentially osteonecrosis (death of the bone).[10,11] Dental infections, deep wounds, broken bones, or a recent surgical procedure can increase your risk of osteomyelitis.[11] Additionally, you have an increased risk of bone infections if you have type 2 diabetes (T2D), metal implants, a weak immune system, an artificial joint, or a blood infection.[11]

The symptoms of osteomyelitis vary depending on the location and severity of the infection.[11] When localized, the tissue may appear red, swollen, and painful to the touch.[11] You may also experience fever, lethargy, pain when moving, loss of appetite, sweating, chills, nausea, and pus drainage in the affected area.[11] While many bone infections can resolve on their own, others require oral or IV antibiotics.[10,11] Your healthcare provider may prescribe oral cephalexin for mild bone infections.[11] If you are having surgery, your healthcare provider may also prescribe an oral antibiotic to take prior to surgery (prophylaxis) to reduce the risk of a bacterial infection.

Lung Infections

Cephalexin is used for treating lower respiratory tract infections (LRTIs), including community-acquired pneumonia (CAP).[12-14] While CAP can occur due to a viral infection, the bacteria Streptococcus pneumoniae (pneumococcus) can also cause CAP. CAP can cause a cough, chills, fever, and difficulty breathing (dyspnea).[13]

Since it is difficult to determine the cause of CAP, a course of empiric antibiotics is often prescribed while waiting for test results.[13] Cephalosporins are prescribed as a combination therapy (multiple medications) for patients with comorbidities such as heart disease or diabetes.[12]

Other Streptococcus Infections

Streptococcus pneumoniae (S. pneumonia) can cause infections in other areas of the body.[14] In addition to CAP, S. pneumonia can cause bacteremia (blood infection), sinusitis (sinus infection), otitis media (middle ear infection), and meningitis (infection of the lining of the brain and spinal cord).[14] Young children, older adults, and adults with comorbidities are at higher risk of contracting bacterial infections.[15] Prevention starts by washing your hands frequently, avoiding contact with infected individuals, and staying home if you suspect you are infected.

What to Know If You Are Prescribed Cephalexin

This article offers an overview of the conditions cephalexin treats, but it is not comprehensive. Your healthcare provider may prescribe cephalexin for other bacterial infections. When you are prescribed cephalexin, it is important to know the following[1-4]:

  • Ensure you take cephalexin as directed and complete your prescription, even if your symptoms dissipate.
  • If you have side effects, discuss alternative antibiotics with your healthcare provider. Side effects include nausea, vomiting, diarrhea, and hives.[1]
  • If you have kidney disease, cephalexin may increase your risk of further kidney impairment. You may receive a lower dosage from your healthcare provider.
  • If you have a severe reaction, such as trouble breathing, call 911 immediately.
  • If you have previously taken penicillin, there is a chance of a cross-reaction allergy to cephalosporin antibiotics. Current research suggests this can occur in approximately 1% to 3% of patients.[1]
  • If you have a penicillin allergy, inform your healthcare provider.
  • If you have T2D and take metformin, there is an increased risk of hypoglycemia.[1]
  • Take cephalexin on an empty stomach since eating may delay the onset of the medication.[1]
  • Tell your healthcare provider about all the medications and herbal supplements you are currently taking.

Virtual UTI Care via Everlywell

Virtual care visits are available via Everlywell, enabling you to speak with a healthcare provider wherever you are. Virtual care visits are synchronous telehealth appointments with a licensed nurse practitioner who can assess your symptoms and help you determine what tests and medications you need. So if you are wondering about UTI antibiotics online, visit the Everlywell telehealth page for more information on how virtual visits work.

What Is Ceftriaxone Used For?

How to Get Antibiotics for a UTI without Seeing a Doctor or Healthcare Provider in Person

What Antibiotics Treat STDs?


  1. Herman TF, Hashmi MF. Cephalexin. In: StatPearls. StatPearls Publishing; 2022. https://pubmed.ncbi.nlm.nih.gov/31747187/
  2. Cephalexin. Merck Manuals Professional Edition. https://www.merckmanuals.com/professional/SearchResults?query=cephalexin+. Accessed June 5, 2023.
  3. Werth BJ. Cephalosporins. Merck Manuals Consumer Version. https://www.merckmanuals.com/home/infections/antibiotics/cephalosporins. Accessed June 5, 2023.
  4. Keflex® Prescribing Information. Fda.gov. https://www.accessdata.fda.gov/drugsatfda_docs/label/2018/050405s107lbl.pdf. Accessed June 7, 2023.
  5. Corson AH, Myers BE, Dinges WL. Why isn’t cefadroxil used more often? Am J Health Syst Pharm. 2016;73(11):754-755. doi:10.2146/ajhp150841. https://academic.oup.com/ajhp/article-abstract/73/11/754/5101868
  6. Anger J, Lee U, Ackerman AL, et al. Recurrent uncomplicated urinary tract infections in women: AUA/CUA/SUFU guideline. J Urol. 2019;202(2):282-289. doi:10.1097/JU.0000000000000296. https://www.auajournals.org/doi/10.1097/JU.0000000000000296
  7. Acne clinical guideline. American Academy of Dermatology. https://www.aad.org/member/clinical-quality/guidelines/acne. Accessed June 8, 2023.
  8. Impetigo. Cdc.gov. https://www.cdc.gov/groupastrep/diseases-hcp/impetigo.html. Published April 20, 2023. Accessed June 8, 2023.
  9. Cellulitis. Cdc.gov. https://www.cdc.gov/groupastrep/diseases-hcp/cellulitis.html. Published April 19, 2023. Accessed June 8, 2023.
  10. Osteomyelitis. Cleveland Clinic. https://my.clevelandclinic.org/health/diseases/9495-osteomyelitis. Accessed June 8, 2023.
  11. Thabit AK, Fatani DF, Bamakhrama MS, Barnawi OA, Basudan LO, Alhejaili SF. Antibiotic penetration into bone and joints: An updated review. International Journal of Infectious Diseases. 2019;81:128-136. doi:10.1016/j.ijid.2019.02.005. https://www.ijidonline.com/article/S1201-9712(19)30069-4/fulltext
  12. Metlay JP, Waterer GW, Long AC, Anzueto A, Brozek J, Crothers K, Cooley LA, Dean NC, Fine MJ, Flanders SA, Griffin MR, Metersky ML, Musher DM, Restrepo MI, Whitney CG. Diagnosis and Treatment of Adults with Community-acquired Pneumonia. An Official Clinical Practice Guideline of the American Thoracic Society and Infectious Diseases Society of America. American Journal of Respiratory and Critical Care Medicine. 2019;200(7):e45-e67. doi:10.1164/rccm.201908-1581st. https://www.atsjournals.org/doi/full/10.1164/rccm.201908-1581ST
  13. Sethi S. Community-Acquired Pneumonia. Merck Manuals Professional Edition. https://www.merckmanuals.com/professional/pulmonary-disorders/pneumonia/community-acquired-pneumonia. Accessed June 8, 2023.
  14. Types of pneumococcal disease. Cdc.gov. https://www.cdc.gov/pneumococcal/about/infection-types.html. Published March 13, 2023. Accessed June 8, 2023.
  15. Risk factors and how it spreads. Cdc.gov. https://www.cdc.gov/pneumococcal/about/risk-transmission.html. Published July 28, 2022. Accessed June 8, 2023.
Everlywell makes lab testing easy and convenient with at-home collection and digital results in days. Learn More