Keflex (Cephalexin) - Oral

What Is Keflex?

For certain bacterial infections, your healthcare provider may prescribe an oral antibiotic called Keflex (cephalexin). Keflex belongs to a class of antibiotics called cephalosporins. It kills bacteria by blocking the bacterial cell wall formation around each cell.

Keflex is a first-generation cephalosporin commonly used to treat bacterial skin infections and infections of the bone, respiratory tract, urinary tract, and middle ear. Available by prescription in both capsule and liquid form, Keflex is taken by mouth for anywhere from seven to 14 days.

The antibiotic is sold under other brand names such as Biocef, Cefanex, Ceporex, Keflet, Keftab, and Zartan. It is also available as a generic.

Drug Facts

Generic Name: Cephalexin

Brand Name(s): Keflex, Biocef, Cefanex, Ceporex, Keflet, Keftab, Zartan

Drug Availability: Prescription

Therapeutic Classification: Antibiotic

Available Generically: Yes

Controlled Substance: N/A

Administration Route: Oral

Active Ingredient: Cephalexin

Dosage Form(s): Capsule, tablet, powder for suspension

What Is Keflex Used For?

The Food and Drug Administration (FDA) has approved Keflex to treat the following infections caused by susceptible gram-positive and gram-negative bacteria:

Keflex works by killing bacteria causing your infection. It is effective against most gram-positive bacteria, Staphylococcus, Streptococcus, and Pneumococcus bacteria. However, Keflex can also act against certain gram-negative bacteria, such as Escherichia coli, Klebsiella pneumoniae, and Proteus mirabilis (common causes of urinary tract infections).

Keflex is not used to treat methicillin-resistant Staphylococcus aureus (MRSA) infections or viral infections such as the common cold or flu. Using antibiotics when they are not needed can lead to their decreased effectiveness and increase your risk of getting an infection later that resists antibiotic treatment.

Keflex

Verywell / Zoe Hansen

How to Take Keflex

Keflex is approved for use in adults and children 1 year of age and older. The antibiotic is available in three different formulations: oral capsules, oral tablets, and liquid suspension.

Adults and children aged 15 and older typically take 250 milligrams (mg) of Keflex every six hours or 500 mg every 12 hours. Children under 15 are dosed based on their weight, with doses divided equally. The duration of therapy can range from seven to 14 days, depending on the infection and its severity.

Shake the Keflex liquid suspension well before taking it. Use a medical dosing spoon or calibrated oral syringe rather than a kitchen spoon to ensure accurate dosing. You can take Keflex capsules and liquid suspension with or without food. Keflex capsules need to be swallowed whole. Do not chew or break open the capsules.

Storage

Keflex capsules, tablets, and liquid suspension can be stored safely at room temperature (around 77 degrees F). If traveling, it is OK to expose the drug to temperatures between 59 and 86 degrees F. Keep the medicines in their original container and in a cool, dry drawer or cabinet away from direct sunlight.

Discard any leftover antibiotics after the treatment course is completed unless your healthcare provider tells you otherwise. Only use antibiotics under the supervision of a medical provider. They should never be self-prescribed. Overuse of antibiotics can lead to antibiotic resistance.

Off-Label Uses

Healthcare providers sometimes prescribe Keflex to treat other conditions not specified by the FDA when medically appropriate. This is known as off-label use.

Providers may prescribe Keflex off-label for the prophylactic (preventive) treatment of chronic UTIs, including chronic cystitis (bladder infection). Even so, the practice is approached with caution to avoid bacterial resistance.

Keflex is also sometimes used before surgery to prevent endocarditis, the potentially life-threatening inflammation of the heart’s chambers and valve. Typically, patients with predisposing heart risk factors will receive a single dose one hour before the operation.

Keflex may also treat prosthetic joint infections following a course of intravenous antibiotics.

How Long Does Keflex Take to Work?

You should start to feel better within a few days of taking Keflex.

What Are the Side Effects of Keflex?

This is not a complete list of side effects and others may occur. A medical professional can advise you on side effects. If you experience other effects, contact your pharmacist or a medical professional. You may report side effects to the FDA at www.fda.gov/medwatch or 1-800-FDA-1088.

As with all drugs, Keflex may cause side effects. Many are mild and only last a short time. Others may be intolerable and require a dose change. On rare occasions, Keflex can cause severe hypersensitivity reactions and other potentially deadly side effects.

Before starting Keflex, tell your healthcare provider about any reactions you’ve had to antibiotics in the past, including penicillin. If you have kidney disease, your provider may need to change your dose to avoid side effects.

Common Side Effects

Gastrointestinal side effects are common with Keflex, the most frequent of which include:

  • Diarrhea
  • Indigestion
  • Bloating
  • Heartburn
  • Stomach pain
  • Nausea
  • Vomiting

Less commonly, Keflex is known to cause headache, dizziness, fatigue, joint pain, agitation, and genital and anal itching.

Call your healthcare provider if these or other side effects persist or worsen.

Severe Side Effects

Hypersensitivity reactions when using Keflex or any other antibiotics include the potentially life-threatening, whole-body allergy known as anaphylaxis.

Cephalosporin-induced anaphylaxis is extremely rare. However, it can quickly lead to shock, coma, respiratory failure, cardiac arrest, and death if not treated immediately.

Keflex can also change the typical composition of bacteria in the gut, allowing certain pathogenic bacteria to take over. This can lead to Clostridium difficile (C. difficile), a bacterial infection that causes watery diarrhea, headache, nausea, and stomach pain.

Most cases of C. difficile are mild, but call your healthcare provider if you have: 

  • Watery stools for more than three days
  • Fever
  • Severe abdominal cramping or bloody stools

These may be signs of potentially serious complications, including severe dehydration, sepsis, and toxic megacolon.

Keflex is also associated with a risk of seizures, particularly in people with advanced kidney disease. People with severe or end-stage kidney disease will often need a dose change. Stop Keflex immediately and do not restart treatment if seizures occur.

Call your healthcare provider right away if you have serious side effects after using Keflex. Call 911 if your symptoms feel life-threatening or if you think you have a medical emergency.

Symptoms of anaphylaxis or anaphylactic shock, include:

  • Sudden rash, hives, or swelling
  • Shortness of breath
  • Wheezing
  • Nausea or vomiting
  • Severe abdominal pain
  • Sudden-onset diarrhea
  • Dizziness or fainting
  • Rapid heartbeat
  • Swelling of the face or neck
  • A feeling of impending doom

Long-Term Side Effects

Antibiotic resistance is a significant concern with long-term antibiotic use. For this reason, antibiotics are commonly prescribed for a specific period and no longer.

Your healthcare provider should be careful when selecting the appropriate antibiotic for prophylactic use in chronic UTI or prosthetic joint infection. The same applies to the recurrent use of antibiotics to treat chronic UTIs. 

Antibiotic cross-resistance can also occur when resistance to one drug results in resistance to other drugs in the same therapeutic class.

Keflex has a significantly lower risk of antibiotic resistance compared with Bactrim (trimethoprim and sulfamethoxazole) or Augmentin (amoxicillin and clavulanic acid). However, its risk is slightly higher than later-generation cephalosporins like Fortaz (ceftazidime) or Zinacef (cefuroxime).

Report Side Effects

Keflex may cause other side effects. Call your healthcare provider if you have any unusual problems while taking this medication.

If you experience a serious side effect, you or your provider may send a report to the Food and Drug Administration's (FDA) MedWatch Adverse Event Reporting Program or by phone (800-332-1088).

Dosage: How Much Keflex Should I Take?

Drug Content Provided and Reviewed by IBM Micromedex®

The dose of this medicine will be different for different patients. Follow your doctor's orders or the directions on the label. The following information includes only the average doses of this medicine. If your dose is different, do not change it unless your doctor tells you to do so.

The amount of medicine that you take depends on the strength of the medicine. Also, the number of doses you take each day, the time allowed between doses, and the length of time you take the medicine depend on the medical problem for which you are using the medicine.

  • For oral dosage forms (capsules or suspension):
    • For infections:
      • Adults and children 15 years of age and older—1000 to 4000 milligrams (mg) per day, taken in divided doses.
      • Children 1 year of age and older—Dose is based on body weight and must be determined by your doctor. The dose is usually 25 to 100 milligrams (mg) per kilogram (kg) per day, taken in divided doses.
      • Children younger than 1 year of age—Use and dose must be determined by your doctor.

Modifications

Although uncommon, seizures can occur with Keflex use. People with severe or advanced kidney disease, defined as a creatinine clearance of below 30 milliliters per minute (mL/min), are at the greatest risk.

Your prescriber will determine whether you need to change your dose. For adults and children aged 15 years and over, the Keflex dosage may be adjusted as follows:

  • Creatinine clearance 29 to 15 mL/min: 250 mg every eight to 12 hours
  • Creatinine clearance 14 to 5 mL/min: 250 mg every 24 hours
  • Creatinine clearance 4 to 1 mL/min: 250 mg every 48 to 60 hours

There are no recommendations for the appropriate use of Keflex in children under the age of 15 with advanced kidney disease or anyone on dialysis.

Missed Dose

If you miss a dose of Keflex, take it as soon as you remember. If it is almost time for your next dose, skip the original dose and continue as normal. Never double up doses as this increases the risk of side effects.

If you miss more than one dose, especially consecutive doses, call your healthcare team for advice. Missing too many doses lowers the concentration of Keflex in the bloodstream. This can reduce its ability to resolve the infection while potentially increasing the risk of resistance.

Never stop treatment or adjust the Keflex dose without first speaking with your provider.

Overdose: What Happens If I Take Too Much Keflex?

According to the National Poison Control Center, antibiotic overdoses are rarely dangerous but may cause side effects like upset stomach or diarrhea. The same is true even in children.

This doesn’t mean you have nothing to worry about if you or someone you know accidentally overdoses on Keflex. If there is diarrhea or vomiting, drink plenty of fluids to prevent dehydration. Contact your healthcare provider if there has been an overdose and ask what, if any, interventions need to be taken.

What Happens If I Overdose on Keflex?

If you think someone may have overdosed on Keflex, contact a healthcare provider or Poison Control Center at 1-800-222-1222.

If a person has collapsed or is not breathing after a suspected overdose, call 911.

Precautions

Drug Content Provided and Reviewed by IBM Micromedex®

If your symptoms do not improve within a few days, or if they become worse, check with your doctor.

Serious allergic reactions can occur with this medicine. Check with your doctor right away if you have chest pain, blistering, peeling, or loose skin, red skin lesions, large, hive-like swelling on the face, eyelids, lips, tongue, throat, hands, legs, feet, or sex organs, severe acne or skin rash, sores or ulcers on the skin, trouble breathing or swallowing, or fever or chills while you are using this medicine.

Cephalexin may cause diarrhea, and in some cases it can be severe. Do not take any medicine or give medicine to your child to treat diarrhea without first checking with your doctor. Diarrhea medicines may make the diarrhea worse or make it last longer. If you have any questions about this or if mild diarrhea continues or gets worse, check with your doctor.

Before you or your child have any medical tests, tell the medical doctor in charge that you are using this medicine. The results of some tests may be affected by this medicine.

Do not take other medicines unless they have been discussed with your doctor. This includes prescription or nonprescription (over-the-counter [OTC]) medicines and herbal or vitamin supplements.

What Are Reasons I Shouldn’t Take Keflex?

No one with a known hypersensitivity to cephalexin or any other cephalosporin antibiotic should ever take Keflex.

It is also possible to experience a hypersensitive reaction to other beta-lactam antibiotics (which include cephalosporins and penicillins). To avoid this, let your healthcare provider know about any adverse reaction you have had to an antibiotic, even if you can’t remember its name. Your provider will monitor you closely in the event of a reaction.

In rare cases, people with a penicillin allergy may have a cross-reactive allergy to cephalosporins.  If this does occur, the reaction can be severe.

What Other Medications Interact With Keflex?

Keflex has only a few known drug-drug interactions. 

The only two interactions that may require a dose change or drug substitution are:

  • Glucophage (metformin): Keflex can lower metformin levels in the bloodstream, reducing the effects of this common diabetes medication. Your provider may need to adjust your metformin dose to counter this effect.
  • Probenecid: Probenecid, used to treat gout, can block the body's excretion of Keflex in urine (the primary route of drug clearance). The combination of Keflex and probenecid is not recommended.

To avoid interactions, always tell your healthcare team about any drugs you take, including prescription, over-the-counter, herbal, nutritional, or recreational drugs.

What Medications Are Similar?

There are five generations of cephalosporin antibiotics, each of which has similar mechanisms of action but different types of antibacterial activity. Some of the drugs are taken by mouth, delivered by injection, or both. Keflex is a first-generation cephalosporin.

There are over 30 cephalosporin antibiotics approved for use by the FDA.

  • First generation: Duricef (cefadroxil), Keflin (cephalothin), and others
  • Second generation: Ceftin (cefuroxime), Cefzil (cefprozil), and others
  • Third generation: Rocephin (ceftriaxone), Suprax (cefixime), and others
  • Fourth generation: Fetroja (cefiderocol), Maxipime (cefepime), and others
  • Fifth generation: Teflaro (ceftaroline) and Zerbaxa (ceftolozane/tazobactam)

As a group, first-generation and fourth-generation cephalosporins work better against gram-positive bacteria. Second- and third-generation cephalosporins are often better suited to treat gram-negative bacteria, although this can vary from one antibiotic to the next.

Frequently Asked Questions

  • What is Keflex used for?

    Keflex (cephalexin) is a first-generation cephalosporin antibiotic used to treat certain bacterial infections of the skin, bones, upper and lower respiratory tract, urinary tract, and middle ear. It is sometimes used off-label to prevent chronic urinary tract infections and postoperative endocarditis or to treat joint replacement infections.

  • How does Keflex work?

    Keflex works by blocking the synthesis of a substance called peptidoglycan that is part of the structural foundation of the bacteria cell wall. Disrupting this process causes the bacteria to die.

  • Is Keflex able to kill all bacteria?

    No. Keflex is most effective against gram-positive bacteria, whose walls are largely made up of peptidoglycan. It is less effective in killing gram-negative bacteria, which have only a thin layer of peptidoglycan and a thick outer membrane consisting of lipids and polysaccharides.

  • How likely is Keflex to cause a severe drug allergy?

    All antibiotics can cause severe allergy, but the risk is generally low with oral cephalosporins. Some studies have concluded that the risk of anaphylaxis—a potentially life-threatening, whole-body allergy—occurs in one of every 180,000 people exposed to a cephalosporin drug such as Keflex.

  • Why is Keflex no longer commonly used to treat gonorrhea?

    Gonorrhea is a type of sexually transmitted disease. There are concerns about rising rates of cephalosporin-resistant gonorrhea—particularly to earlier-generation cephalosporin antibiotics.

    The Centers for Disease Control and Prevention (CDC), which is the national public health agency of the US, put out revised recommendations in 2020 for the treatment of gonorrhea. The updated guidelines recommend combination therapy of either Suprax (cefixime) or Rocephin (ceftriaxone)—both third-generation cephalosporins—with either Zithromax (azithromycin) or Vibramycin (doxycycline).

How Can I Stay Healthy While Taking Keflex?

If you have a bacterial infection that requires an antibiotic like Keflex, following your healthcare provider’s instructions is important. Take the drug as prescribed and on schedule to ensure optimal benefits and reduce the risk of resistance.

If you have a busy home or work life, it can be easy to miss a dose. It often helps to set daily alarm reminders on your cellphone and to keep the pills on hand if you are planning to run errands or juggle appointments.

Importantly, never stop treatment early, even if you are feeling 100% better. Doing so allows antibiotic-resistant mutations to “escape” and multiply, making future antibiotic therapies less effective.

Try to avoid alcohol to better manage antibiotic side effects. Alcohol use with antibiotics can cause diarrhea and stomach upset. You might also consider taking a probiotic supplement, which may help lower the risk of diarrhea. If you experience severe, persistent, or worsening side effects while taking Keflex, call your healthcare provider immediately.

Medical Disclaimer

Verywell Health's drug information is meant for education purposes only and not intended as a replacement for medical advice, diagnosis, or treatment from a healthcare professional. Consult your doctor before taking any new medication(s). IBM Watson Micromedex provides some of the drug content, as indicated on the page.

25 Sources
Verywell Health uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read our editorial process to learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.
  1. Food and Drug Administration. Package insert – Keflex (cephalexin) capsules.

  2. Bui T, Preuss CV. Cephalosporins. In: StatPearls [Internet].

  3. Antimicrobe.org. Cephalexin.

  4. Herman TF, Hashmi MF. Cephalexin. In: StatPearls [Internet].

  5. Pragma Pharmaceuticals. Package insert – Keflex (cephalexin) oral suspension.

  6. MedlinePlus. Cephalexin.

  7. Centers for Disease Control and Prevention. Antibiotic do’s and don’ts.

  8. Ahmed H, Farewell D, Jones HM, Francis NA, Paranjothy S, Butler CC. Antibiotic prophylaxis and clinical outcomes among older adults with recurrent urinary tract infection: cohort study. Age Ageing. 2019;48(2):228-34. doi:10.1093/ageing/afy146

  9. Alsubaie SS, Barry MA. Current status of long-term antibiotic prophylaxis for urinary tract infections in children: an antibiotic stewardship challenge. Kidney Res Clin Pract. 2019;38(4):441-54. doi:10.23876/j.krcp.19.091

  10. Enzler MJ, Berbari E, Osmon DR. Antimicrobial prophylaxis in adults. Mayo Clin Proceed. 2011;86(7):686-701. Doi:10.4065/mcp.2011.0012

  11. Li C, Renz N, Trampuz A. Management of periprosthetic joint infection. Hip Pelvis. 2018;30(3):138. doi:10.5371/hp.2018.30.3.138

  12. Khan DA, Banerji A, Bernstein JA, et al. Cephalosporin allergy: current understanding and future challenges. J Allergy Clin Immunol Practice. 2019;7(7):2105-14. doi:10.1016/j.jaip.2019.06.001

  13. McLendon K, Sternard BT. Anaphylaxis. In: StatPearls [Internet].

  14. Kumar Mada P, Alam MU. Clostridium difficile. In: StatPearls [Internet].

  15. Pouwels KB, Muller-Pebody B, Smieszek T, Hopkins S, Robotham JV. Selection and co-selection of antibiotic resistances among Escherichia coli by antibiotic use in primary care: an ecological analysis. PLoS ONE. 2019;14(6):e0218134. doi:10.1371/journal.pone.0218134

  16. Abduzaimovic A, Aljicevic M, Rebic V, Vranic S, Abduzaimovic K, Sestic S. Antibiotic resistance in urinary isolates of Escherichia coli. Mater Sociomed. 2016;28(6):416. doi:10.5455/msm.2016.28.416-419

  17. National Health Service (UK). What should I do if I miss a dose of antibiotics?

  18. National Poison Control Center. Antibiotics: overdose vs. misuse.

  19. Caruso C, Valluzzi RL, Colantuono S, Gaeta F, Romano A. Β-lactam allergy and cross-reactivity: a clinician’s guide to selecting an alternative antibiotic. J Asthma Allergy. 2021;14:31-6. doi:10.2147/JAA.S242061

  20. American Academy of Allergy, Asthma, and Immunology. Cephalosporin administration with a penicillin allergy history.

  21. National Institute of Diabetes and Digestive and Kidney Diseases. Cephalosporins. In: LiverTox: Clinical and Research Information on Drug-Induced Liver Injury [Internet].

  22. Centers for Disease Control and Prevention. Cephalosporin-resistant Neisseria gonorrhoeae public health response plan.

  23. St. Cyr S, Barbee L, Workowski KA, et al. Update to CDC’s treatment guideline for gonococcal infection, 2020. MMWR Morbid Mortality Week Rep. 2020 Dec 18;69(50):1911-6. doi:10.15585/mmwr.mm6950a6

  24. Munita JM, Arias CA. Mechanisms of antibiotic resistance. Microbiol Spectr. 2016;4(2):VMBF-0016-2015. doi:10.1128/microbiolspec.VMBF-0016-2015

  25. Blaabjerg S, Artzi D, Aabenhus R. Probiotics for the prevention of antibiotic-associated diarrhea in outpatients—a systematic review and meta-analysis. Antibiotics. 2017;6(4):21. doi:10.3390/antibiotics6040021