Your Antibiotics

Cephalexin (Keflex): Uses, side effects and how to take it

Brand names: Keflex · Class: cephalosporin antibiotic

Cephalexin is a prescription antibiotic used for certain bacterial infections, including some skin infections and urinary tract infections (UTIs). You can take it with or without food, following the directions on your prescription label. Diarrhea and nausea are common side effects, but watery or bloody diarrhea needs prompt medical advice. [1][2][3]

Updated November 202611 min read23 sourcesBy the Your Antibiotics editorial team

A rod-shaped bacterium

Quick facts

Used forCertain bacterial infections, including some skin infections and UTIs. [1]
How to takeTake by mouth exactly as prescribed. Space doses evenly as directed. [2][3]
With food?With or without food. [3]
AlcoholAlcohol is generally OK with cephalexin. [4]
Common side effectsDiarrhea, nausea, vomiting, indigestion, and stomach pain. [1]
Serious warningFor trouble breathing or throat swelling during a suspected allergic reaction, use an epinephrine auto-injector immediately if you have one and call 911 right away. Call your doctor right away for watery or bloody diarrhea. [2][5]

What it is and how it works

Cephalexin is the generic name for Keflex. It belongs to a group of antibiotics called cephalosporins. These medicines kill certain bacteria by stopping them from building the protective walls they need to survive. The current U.S. Keflex label covers capsules. Generic cephalexin comes as capsules, tablets, and a liquid called an oral suspension. [1][2]

Cephalexin works only against bacteria that are sensitive to it. Your prescriber chooses an antibiotic based on the type of infection and which bacteria are likely to be causing it. If a lab test shows that a different antibiotic would work better, your prescriber may change your treatment. Cephalexin does not treat viruses that cause colds or flu. [1][2]

What it's used for

Skin infections. Cephalexin is one option for some cases of cellulitis, a bacterial infection in the deeper layers of the skin. The area may be warm, swollen, and painful. A clinician may choose cephalexin when there is no pus and the likely bacteria are ones the drug can treat. [1][6]

Urinary tract infections. Cephalexin can treat some UTIs. Burning when you pee and needing to pee often can be signs of a bladder infection. [1][7] Seek medical care right away if you have signs of a possible kidney infection, such as fever or chills with back or side pain, nausea, or vomiting. A kidney infection can occur without burning or frequent urination. [7][8] If you’re pregnant and have symptoms of a UTI, contact your prenatal care team promptly. [17]

Other bacterial infections. Cephalexin is also approved for certain ear, respiratory tract, and bone infections. It can be an option for confirmed strep throat in some people with a penicillin allergy. CDC guidance advises against using it for strep throat if the person has had an immediate allergic reaction to penicillin. [1][9]

How to take it

Take cephalexin exactly as your prescription label says. Follow the directions for how often to take it and when to stop. Space doses evenly across the schedule you were given. If the timing on the label is unclear, ask your pharmacist to help you work out when to take each dose. [2][3]

  • Capsules or tablets. Swallow them whole with water. You can take cephalexin with or without food. If it makes you feel sick to your stomach, taking it after a meal or snack may help. [3][10]
  • Liquid. Shake the bottle well before each dose so the medicine is mixed evenly. Use an oral syringe marked in milliliters (mL) to measure the dose on the current prescription label. Cephalexin liquid comes in different strengths. If the strength or the number of mL to give is unclear, ask your pharmacist before giving a dose. [3][11][18]
  • Liquid storage. Keep the mixed liquid in the refrigerator with the bottle tightly closed. [2][11] Discard any unused liquid 14 days after it was mixed. If the pharmacy label gives an earlier discard date, follow that date. [11]

Keep taking cephalexin for the time prescribed, even if you feel better sooner, unless the prescriber tells you to stop or change treatment. If you develop a new rash or hives, stop taking cephalexin and call your prescriber right away. If other side effects make it hard to keep taking it, call the doctor or dentist who prescribed it. [1][2][3]

Use cephalexin only if it was prescribed for you for this infection. Do not take leftover antibiotics or antibiotics prescribed for someone else. Do not share your antibiotics or save them for later. [19]

If you miss a dose

Take the missed dose when you remember. If it’s almost time for your next dose, skip the missed one and go back to your usual schedule. Never take an extra dose to make up for one you missed. [2]

If you’re unsure whether it’s too close to your next dose, ask a pharmacist to check the timing against your prescription. If you often forget doses, setting a reminder for your scheduled times may help. [3]

Side effects

Common Serious - get help
Diarrhea. [1] Watery or bloody diarrhea. Call your doctor right away. [2]
Nausea or vomiting. [1] If you develop a new rash or hives, stop taking cephalexin and call your prescriber right away. Call 911 if you also have trouble breathing or swallowing, swelling of your lips, tongue, or throat, or feel like you might pass out. [1][2][5]
Indigestion. [1] Swelling of your lips, tongue, or throat, or trouble breathing or swallowing. Call 911. [2][5]
Stomach pain. [1] A rash with blisters or peeling skin. Get emergency medical care. [1][10]

Get urgent care: If you have trouble breathing or swallowing, swelling of your lips, tongue, or throat, or feel faint during a suspected allergic reaction, use your epinephrine auto-injector immediately if you have one. Call 911 right away, even if you feel better after using epinephrine. [5]

If mild side effects bother you or don’t go away, talk to your doctor or pharmacist. If you have diarrhea, ask before taking an over-the-counter medicine to stop it. [2][10]

Watch for watery or bloody diarrhea during or after treatment. Cephalexin can change the mix of bacteria in your gut. That can allow a germ called C. diff to grow and inflame the colon. [1][12] Call your clinician right away if you develop watery or bloody diarrhea during or after treatment, even if you have no cramps or fever. Get medical advice before using an over-the-counter medicine to stop the diarrhea. [1][2][10] This can happen even more than two months after your last dose, so tell the clinician you recently took cephalexin. [1][2]

Interactions

Tell your doctor or pharmacist which prescription medicines, over-the-counter medicines, vitamins, and supplements you take. The advice below is for cephalexin. A pharmacist can check how it fits with the rest of your medicines. [2][13]

Medicine or substance Verdict What to know
Alcohol OK You can drink alcohol while taking cephalexin. [4]
Birth control pills OK You do not need backup birth control just because you take cephalexin. If you vomit or have severe diarrhea, follow the instructions for your specific pill or ask a pharmacist promptly whether you need backup contraception or emergency contraception. [14][20]
Metformin Ask first Cephalexin can raise the amount of metformin in your blood. Ask your prescriber or pharmacist before taking these medicines together. Your prescriber may adjust your metformin dose and tell you how to monitor for low blood sugar. Keep taking metformin as directed unless your prescriber changes it. [1]
Probenecid Avoid Probenecid slows how fast your kidneys clear cephalexin. The prescribing information advises against taking them together. If you take probenecid, contact your prescriber or pharmacist before taking them together. Ask how to handle both prescriptions. [1]
Warfarin Ask first Tell the clinician who manages your warfarin when you start or finish cephalexin. They should monitor your INR, a measure of how quickly your blood clots, more closely. If you take another blood thinner, give your pharmacist its name so they can check it separately. [1][21]
Zinc supplements Caution Taking zinc sulfate at the same time as cephalexin can reduce cephalexin absorption. Ask your pharmacist whether to pause the supplement or take it after cephalexin. Keep your prescribed antibiotic schedule. [13][22]

Cephalexin can also make certain urine sugar tests show glucose when it isn’t there. If you use urine glucose tests at home or are having one done, tell your pharmacist or clinician that you’re taking cephalexin. [1][2]

Who should not take it / allergy

Do not take cephalexin if you have a known allergy to cephalexin or another cephalosporin. If your prescription was issued despite an allergy in your records, call the prescriber before taking the first dose so they can check what happened and confirm which medicine you should take. [1][2]

If you have a penicillin allergy, the specific drug and reaction matter. Some people who react to a penicillin can also react to a cephalosporin. This is called cross-reactivity. It is more likely when the two drugs share a part of their chemical structure. Cephalexin and ampicillin share one of these parts, called a side chain. [15]

If you’ve had hives, swelling, trouble breathing, or a severe skin reaction after taking a penicillin, check with the prescriber before starting cephalexin. Before your first dose, tell your prescriber which antibiotic caused the reaction, what happened, and how soon symptoms started. An upset stomach by itself is generally a side effect. If you only know that “penicillin allergy” is in your record, tell the prescriber what you remember so they can decide whether the label needs checking. [2][15]

Before taking cephalexin, tell your prescriber if you have kidney or liver disease, receive dialysis, have had colitis or a C. diff infection, are pregnant or planning a pregnancy, or are breastfeeding. Your prescriber may need to adjust your dose or schedule if you have reduced kidney function. This is especially important for older adults with kidney problems, because cephalexin can build up and increase the risk of seizures. Adults age 65 or older also have a higher risk of C. diff infection. [1][2][12]

Frequently asked questions

Can I drink alcohol on cephalexin?

Yes. Alcohol does not need to be avoided because you’re taking cephalexin. If you also take another medicine and aren’t sure whether it’s safe with alcohol, ask your pharmacist to check. [4][13]

What does cephalexin 500 mg mean on my bottle?

For a capsule, 500 mg is the amount of cephalexin in each capsule. The strength and the directions are separate parts of the label. Follow the directions for your own prescription, and ask your pharmacist if any part is unclear. [1][2]

How long does cephalexin take to work?

You should usually start to feel better within the first few days. Call the doctor or dentist who prescribed it if you haven’t started to improve after 2 to 3 days, or if you feel worse at any point. [2][3]

Can cephalexin treat a tooth infection?

Most tooth pain and swelling need dental treatment. When an antibiotic is needed, a dentist may consider cephalexin for certain infections in adults with a reported penicillin allergy who have never had anaphylaxis, deep swelling called angioedema, or hives after taking penicillin, ampicillin, or amoxicillin. Contact your dentist promptly for tooth pain or swelling. Seek urgent evaluation if swelling is spreading or you have fever with swelling. Call 911 if you have trouble breathing. [5][16][23]

Can I take cephalexin on an empty stomach?

Yes. You can take it with or without food. If you feel nauseated after taking it on an empty stomach, try taking it after a meal or snack. [3][10]

Sources

  1. Keflex prescribing information. U.S. Food and Drug Administration. https://www.accessdata.fda.gov/drugsatfda_docs/label/2026/050405s111lbl.pdf
  2. Cephalexin drug information. MedlinePlus. https://medlineplus.gov/druginfo/meds/a682733.html
  3. How and when to take cefalexin. NHS. https://www.nhs.uk/medicines/cefalexin/how-and-when-to-take-cefalexin/
  4. Common questions about cefalexin. NHS. https://www.nhs.uk/medicines/cefalexin/common-questions-about-cefalexin/
  5. Anaphylaxis. MedlinePlus. https://medlineplus.gov/anaphylaxis.html
  6. Clinical guidance for group A streptococcal cellulitis. CDC. https://www.cdc.gov/group-a-strep/hcp/clinical-guidance/cellulitis.html
  7. Urinary tract infection basics. CDC. https://www.cdc.gov/uti/about/index.html
  8. Symptoms and causes of kidney infection. National Institute of Diabetes and Digestive and Kidney Diseases. https://www.niddk.nih.gov/health-information/urologic-diseases/kidney-infection-pyelonephritis/symptoms-causes
  9. Clinical guidance for group A streptococcal pharyngitis. CDC. https://www.cdc.gov/group-a-strep/hcp/clinical-guidance/strep-throat.html
  10. Side effects of cefalexin. NHS. https://www.nhs.uk/medicines/cefalexin/side-effects-of-cefalexin/
  11. Cephalexin for oral suspension prescribing information. DailyMed. https://dailymed.nlm.nih.gov/dailymed/lookup.cfm?setid=553485f8-890d-4929-a6bb-905221cf411d
  12. About C. diff. CDC. https://www.cdc.gov/c-diff/about/index.html
  13. Taking cefalexin with other medicines and herbal supplements. NHS. https://www.nhs.uk/medicines/cefalexin/taking-cefalexin-with-other-medicines-and-herbal-supplements/
  14. U.S. Selected Practice Recommendations for Contraceptive Use, 2024. CDC. https://www.cdc.gov/mmwr/volumes/73/rr/rr7303a1.htm
  15. Drug allergy: A 2022 practice parameter update. Journal of Allergy and Clinical Immunology. https://health.ucdavis.edu/media-resources/antibiotic-stewardship/documents/pdfs/guidelines/drug-allergy-aaaai-2022.pdf
  16. Checklist for antibiotic prescribing in dentistry. CDC. https://www.cdc.gov/antibiotic-use/media/pdfs/dental-fact-sheet-508.pdf
  17. Urinary tract infections in pregnant individuals. American College of Obstetricians and Gynecologists. https://www.acog.org/clinical/clinical-guidance/clinical-consensus/articles/2023/08/urinary-tract-infections-in-pregnant-individuals
  18. Ways to prevent children’s medication errors at home. American Academy of Pediatrics. https://www.healthychildren.org/English/news/Pages/ways-to-prevent-home-medication-errors.aspx
  19. Healthy habits: Antibiotic do’s and don’ts. CDC. https://www.cdc.gov/antibiotic-use/about/index.html
  20. Appendices for U.S. Medical Eligibility Criteria for Contraceptive Use, 2024. CDC. https://www.cdc.gov/mmwr/volumes/73/rr/rr7304a1_appendix.htm
  21. Warfarin sodium prescribing information. DailyMed. https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=51e98fb6-ba76-497e-95d8-fe895ef0b7ed
  22. The effect of staggered administration of zinc sulfate on the pharmacokinetics of oral cephalexin. British Journal of Clinical Pharmacology. https://pubmed.ncbi.nlm.nih.gov/22023069/
  23. Evidence-based clinical practice guideline on antibiotic use for the urgent management of dental pain and swelling. American Dental Association. https://www.ada.org/-/media/project/ada-organization/ada/ada-org/files/resources/research/ada_chairside_guide_antibiotics_tna.pdf

This guide is general information written from the sources listed above and checked in November 2026. It does not replace advice from your own doctor, dentist or pharmacist.