Cephalexin Explained: Usage, Doses, And Side Effects

Cephalexin (brand name Keflex) is a type of antibiotic classified as a cephalosporin, reports Medical News Today. It comes in oral tablets and capsules, as well as in an oral suspension. Cephalexin is prescribed by doctors for the treatment of various bacterial infections, including those of the respiratory tract, urinary tract, ears, bones, and skin. It does not work for viral infections such as the common cold. 

Bacteria are categorized as either round-shaped cocci or rod-shaped bacilli, notes Science Direct. Through a laboratory staining technique using a violet dye, these two groups can then be subdivided into gram-positive (if they stain purple) or gram-negative bacteria (if they stain pink). Cephalexin has antibacterial activity against most gram-positive cocci such as the Streptococci and Staphylococci bacteria that cause the above infections (via StatPearls). It is also kills some gram-negative bacilli bacteria, notably E. coli, Proteus mirabilis, and Klebsiella pneumoniae. 

Cephalexin can also be used as a prophylactic before or after surgical procedures to prevent infections. It can cause minor (nausea, diarrhea) or severe (allergic reactions) adverse effects in some people. Here's everything you need to know about its usage, doses, and side effects.

How does cephalexin work?

Molecules known as peptidoglycans are important structural components of bacterial cell walls that confer shape and rigidity to the bacteria (per StatPearls). Multiple layers of these peptidoglycan molecules are "cross-linked" together by specific enzymes (penicillin-binding proteins, or PBPs) to create a bacterial cell wall. 

The chemical structure of cephalexin — like other cephalosporins — contains a key ring-shaped unit known as a beta-lactam ring. By binding to the essential PBPs, this beta-lactam ring creates a roadblock in the formation of bacterial cell walls. As a result, the bacterial cell wall is damaged and eventually ruptures, causing bacterial death. 

Nevertheless, some bacteria can evade this destruction and become resistant to cephalexin. Different mechanisms by which these bacteria become cephalexin-resistant have been identified. For example, some bacteria produce beta-lactamase, an enzyme which breaks down the lactam ring, thus "disarming" the antibiotic. In other bacteria, the production of PBPs is altered in such a way that they cannot be disabled by cephalexin, thus enabling bacterial survival. In a third mechanism of resistance, bacteria make special pumps to get rid of toxic molecules — including drugs such as cephalexin — by pumping them out of the cell. 

Urinary tract infections

Frequent urination, pain or burning during urination, or the need to urinate despite an empty bladder may all be signs of a urinary tract infection (UTI), reports Healthline. In a UTI, bacteria from the skin or rectum infect the urinary tract via the urethra, the tube that allows urine to pass out of the body. Bacterial cystitis can occur if the germs infect the bladder while pyelonephritis can develop if the infection spreads to the kidneys. More common in women due to their shorter urethra, UTIs are often treated with cephalexin. To kill off all the bacteria, cephalexin should be taken fully as prescribed — usually up to 7 days — even if symptoms improve sooner. 

Due to increasing antibiotic resistance as well as FDA black box warnings of the potential toxicity of some first-line drugs (e.g., Cipro) for lower UTIs, cephalexin may be a preferable alternative treatment for lower UTIs (via a 2020 review of studies published in the International Journal of Antimicrobial Agents). Clinical trials and experimental studies from the 1970s and 1980s overestimated the resistance of cephalexin to a large group of resistant germs belonging to the Enterobacteriaceae family. According to new testing methods, cephalexin has been shown to be more effective than resistant in many cases.

Respiratory tract infections

Upper respiratory tract infections (URIs) are caused by bacteria or viruses that spread via respiratory droplets or hand to hand contact, notes the Cleveland Clinic. Common URIs include the common cold, sore throat (pharyngitis), sinus infection (sinusitis), and laryngitis (inflammation of the larynx or voice box). URIs usually run a course of one to two weeks and occur most frequently among children, as well as people with heart or lung problems. Symptoms include runny nose, cough, fever, sore throat, hoarseness, tiredness, red eyes, and swollen lymph nodes. Only bacterial URIs (e.g., strep throat) are treated with antibiotics

Meanwhile, lower respiratory tract infections (LRIs) affect the airways below the larynx and include bronchitis, pneumonia, bronchiolitis, and tuberculosis (via Medical News Today). LRIs can be caused by viruses, fungi, and bacteria such as streptococci and staphylococci. Symptoms of LRIs are similar to those of URIs (though coughing predominates) and certain factors (like a recent cold or flu or weak resistance) increase the risk of an LRI. Age is also a risk factor; older adults and younger children are more susceptible. Antibiotics may be prescribed for lower respiratory bacterial infections. 

According to Prescriber's Digital Reference, cephalexin is indicated for the treatment of group A beta-hemolytic streptococcal pharyngitis (commonly known as strep throat) as well as tonsillitis. Among LRIs, cephalexin can be used to treat community-acquired pneumonia (CAP). Cephalexin is also indicated for the treatment of both URIs and LRIs that are nonspecific, i.e., the cause is uncertain. 

Bone infection

Staphylococcus bacteria are also the culprits behind osteomyelitis (the medical term for bone infection), reports the Mayo Clinic. Osteomyelitis may develop when bacteria infect the bone directly through an open wound or fracture, or during bone surgery. Bone infection can also occur when bacteria travel through the bloodstream from an infection in another part of the body (e.g., skin ulcer, sinus infection) to the bone. People with osteomyelitis may experience fever or pain in the infected bone, which may become red, swollen, and warm. Others may feel tired or may even be symptom-free. Treatment with IV antibiotics may be followed by a longer course of oral antibiotics. 

Observational studies and clinical trials have reported that first-generation cephalosporins such as cephalexin are highly effective in resolving acute osteomyelitis (via a 2019 review article published in Open Forum Infectious Diseases). Cephalexin is also the preferred antibiotic for long-term follow up of IV therapy in childhood cases of acute hematogenous osteomyelitis (per practice guidelines published in a 2021 edition of the Journal of the Pediatric Infectious Diseases Society). This type of bone infection is caused by Staphylococcus aureus, and is spread via the bloodstream. 

Bacterial skin infections

In addition to bone infections, Staphylococcus aureus bacteria — which reside on the skin — are often responsible for skin infections as well (via the Merck Manual). Skin infections occur when staph or strep bacteria enter the body via hair follicles or through tears (cuts, scrapes, punctures, or wounds) in the skin. 

Impetigo, carbuncles, folliculitis, and small skin abscesses are examples of infections that are on the milder side. More serious bacterial skin infections include lymphangitis (infection of the lymph vessels) and cellulitis (a deep infection of the skin and nearby tissues). People with certain medical conditions (e.g., diabetes, HIV, AIDS, and hepatitis) or undergoing immunosuppressive therapy (like chemo) have an elevated risk of skin infections. Infections of the skin also occur more frequently among the elderly and people in hospitals and nursing homes. 

Recommendations from the Infectious Diseases Society of America include cephalexin for the treatment of skin infections caused by staph or strep bacteria (via practice guidelines published in a 2014 edition of Clinical Infectious Diseases). For example, cephalexin is a first-line treatment for cellulitis, one of the more common bacterial skin infections affecting over 14 million Americans each year (via StatPearls). While cellulitis is usually caused by strep bacteria, MRSA (methicillin-sensitive Staphylococcus aureus) can also lead to cellulitis. MRSA is difficult to treat since it is resistant to many common antibiotics, including cephalexin. Therefore, additional antibiotics are needed if MRSA is suspected in cases of cellulitis. 

Ear infections

Infections of the middle ear are known as otitis media and occur more often in children (via the Mayo Clinic). Otitis media can be of bacterial or viral origin and often results from a cold, flu, or allergy. Children with otitis media may experience ear pain, irritability, insomnia, headaches, fever, poor appetite, and difficulty hearing. Recurrent ear infections can lead to permanent hearing loss. While some ear infections resolve on their own, other cases require antibiotic treatment. 

Among various types of ear infections, chronic suppurative otitis media (CSOM) can cause a perforated ear drum and is difficult to treat. CSOM is common in developing countries, and typically develops in children aged 5 and under (via a 2011 study published in the Iranian Red Crescent Medical Journal). Staphylococcus aureus is one of the strains of bacteria most often associated with CSOM. In susceptibility testing, certain staph bacteria, including S. aureus, have exhibited high sensitivity to cephalexin. Specifically, cephalexin blocked the growth of 90% of the bacteria. Per RxList, cephalexin is recommended for treating otitis media caused by S. aureus and various other susceptible bacteria.

Pre- and post-surgery prophylactic

According to the CDC, roughly 23% of healthcare-related infections are associated with surgery (via a 2014 study in Clinical Orthopedics and Related Research). Infections following foot and ankle surgery are particularly challenging, with infection rates ranging from 0.5% to 6.5% of surgeries. 

The risk of infection is substantially higher in patients with diabetic peripheral neuropathy. While some infections are minor, others can have devastating outcomes. In addition to identifying high-risk patients prior to surgery, some surgeons also administer a brief course of prophylactic antibiotics after surgery. In a survey of 312 orthopedic surgeons, 75% reported using post-surgical oral antibiotics, with cephalexin given at 500 milligrams four times/day reported as being the clear antibiotic regimen of choice (63%). The indications for prescribing a prophylactic antibiotic included past infection, co-existing medical conditions, and a history of poor wound healing. 

Cephalexin is also effective for reducing the risk of post-surgery infection when given prior to surgery (per a 2018 study in BMJ Open). Due in part to the complexity of the wound closures, surgeries for cancers of the nose and ear are associated with a considerably greater risk of infection compared with other body sites. Among 154 patients with skin cancer surgery on the nose and ear, a significant reduction in surgical site infections was achieved with a single oral 2-gram dose of cephalexin given before surgery. While antibiotic resistance is a concern when antibiotics are used long-term, it is less likely to be an issue when an antibiotic is administered prophylactically in a single high dose.


Cephalexin 250-milligram or 500-milligram capsules are typically administered 1 to 4 times per day for 7 days (per StatPearls). Though the capsules are rather large and taste bad, they are better absorbed when taken without food. Cephalexin comes in 250-milligram and 500-milligram tablets, and in an oral suspension (250 milligrams/5 milliliters strength). When using the oral suspension, it should be shaken beforehand and stored in the refrigerator. 

Several factors determine the appropriate form, dosage, and frequency of administration of cephalexin (via Medical News Today). For example, the daily dosage depends on the disorder being treated, and may increase for severe cases. Age is another determining factor: While young children may be prescribed a lower dose due to their small body size, adults aged 65 and over may also be given a lowered dose because of their slower drug metabolism (which can cause longer retention of the drug in the body). Other factors include the presence of other medical conditions and how well a patient tolerates the initial dose. 

Cephalexin should be taken as directed to completely eradicate the infection. Symptom improvement indicates that the drug is effective. If a dose is missed and it's time for the next dose, do not double dose to catch up. Too much cephalexin can cause nausea, vomiting, abdominal pain, diarrhea, or blood in the urine. Periodic blood tests may be performed to monitor any adverse effects of the drug on your kidneys. Cephalexin should be stored at room temperature and away from moisture. 

Side effects

Stomach pain or irritation, indigestion, nausea, and diarrhea are some of the more common side effects of cephalexin (via StatPearls). Other potential adverse effects reported by the manufacturer include unusual vaginal discharge, genital itching, fungal infection, arthritis, low platelet counts, and low white blood cell counts. Patients undergoing clinical trials investigating cephalexin have experienced elevated liver enzymes, jaundice, and inflammation of the kidneys. Long-term treatment with cephalexin can cause chronic diarrhea related to Clostridioides difficile infection, particularly in older patients and those who are immunocompromised. Rare side effects include hemolytic anemia, Stevens-Johnson syndrome (severe skin reaction), and tendinopathy (tendon degeneration). 

People who have taken penicillin in the past are more prone to having an allergic reaction to cephalexin. Apparently, antibodies (IgG and IgM) produced against penicillin that remain in the body may also bind (cross-react) to cephalexin. Though research evidence is lacking, it has been suggested that around 10% of people with a penicillin allergy may react to cephalexin (and other cephalosporin antibiotics) as well. While some people may experience mild allergic reactions (e.g., skin rash, itching, hives), others may develop severe reactions (e.g., swelling of the face, lips, tongue, or throat) that may require emergency care (via the Cleveland Clinic). 


Cephalexin may be contraindicated for people with certain medical conditions, notes the Mayo Clinic. The metabolism and/or clearance of cephalexin from the body may be altered in people with kidney disease or liver disease. As a result, more of the drug may stay in the body, along with an increased risk of side effects. Other conditions that may preclude the use of cephalexin include current or past colitis, seizures, or severe diarrhea. 

Some medications, nutritional supplements, and herbs may interact with cephalexin and affect the drug's effectiveness (via Medical News Today). For example, concurrent use of metformin (a common drug used for the treatment of diabetes) with cephalexin could result in kidney damage. Similar to the effects associated with kidney/liver disease, probenecid, a medication used for treating gout and gouty arthritis, can increase the retention of cephalexin in the body and a greater likelihood of adverse effects. In these and other cases of drug interactions, the medications may still be taken together but with dosage adjustments to minimize side effects. 

However, people with allergies to beta-lactam medications should not take cephalexin. Beta-lactam antibiotics include other cephalosporins, penicillin, carbapenems, monobactams, and beta-lactamase inhibitors (e.g., avibactam and vaborbactam) — drugs that inactivate enzymes that break down the beta-lactam ring (via StatPearls).

Pregnancy and lactation

In general, pregnant women and mothers who are breastfeeding can safely use cephalexin, notes GoodRx. There is no evidence that the drug can harm unborn babies or those being breastfed. In humans, neither decades-long observational studies nor drug safety studies of cephalexin use in pregnant women have found any risks of major birth defects, miscarriage, or maternal or fetal complications (via Medscape). Preclinical studies in animals also show no evidence of harm from cephalexin use during pregnancy. Doses of cephalexin up to 1.2 times the maximum recommended human dose did not cause any injury to the fetus in reproductive experiments in mice and rats. 

Lactation studies have shown that cephalexin is present in breast milk (via StatPearls). If the mother is taking cephalexin, babies that are exclusively breastfed would ingest 112 micrograms of cephalexin per kilogram of body weight daily. This amount is far below the recommended dosage for infants of 25 to 100 milligrams of cephalexin per kilogram per day. Observational studies suggest that cephalexin poses little risk to breastfeeding babies. In one study, two of seven nursing mothers reported diarrhea in their babies but no sign of rashes or yeast infections. In another, only one of eleven infants experienced diarrhea when exposed to cephalexin in breast milk.