Cephalexin: what it treats, how to take it, side effects
Last updated September 3, 2026.
Cephalexin is a cephalosporin antibiotic that kills bacteria causing certain infections. You may know it as Keflex. It is a workhorse for skin, ear, throat, and urinary infections - and it does nothing for colds, flu, or other viruses.
What does it treat?
Cephalexin treats certain infections caused by bacteria. MedlinePlus adds a specific niche: people allergic to penicillin who have a heart condition sometimes take it before dental or upper respiratory procedures to prevent a heart valve infection. As with all antibiotics, using it when it is not needed raises the risk of resistant infections later.
How do you take it?
By mouth as a capsule, tablet, or liquid, with or without food, every 6 or 12 hours for 7 to 14 days depending on the infection. The label's usual adult dose is 250 mg every 6 hours, or 500 mg every 12 hours, and strep infections need at least 10 days. Take it at the same times every day, shake the liquid well, and finish the whole prescription even when you feel better - stopping early breeds resistant bacteria. You should start feeling better within the first few days; if not, call your doctor. Missed dose: take it when you remember unless the next one is close; never double up.
Side effects to know
- Common: nausea, vomiting, diarrhea, heartburn, stomach pain, rectal or genital itching, extreme tiredness, agitation or confusion or dizziness, headache, and joint pain.
- Serious: watery or bloody stools with cramps or fever, which can start up to 2 months or more after treatment ends; allergic reactions (rash, hives, swelling of the face, throat, tongue, lips, or eyes, wheezing, difficulty breathing or swallowing); a return of fever, sore throat, or chills; and hallucinations. Get medical help right away for these.
Who should not take it?
Anyone who has had an allergic reaction to cephalexin should not take it, and a history of penicillin allergy belongs in the conversation since the classes overlap. Tell your doctor about gastrointestinal disease, especially colitis, and kidney or liver disease. Cephalexin can decrease the effectiveness of hormonal birth control (pills, patches, rings, injections), so use another method while taking it. If you are pregnant, planning pregnancy, or breastfeeding, tell your doctor, and call if you become pregnant during the course.
When is it an emergency?
Call 911 for an allergic reaction with facial, throat, or tongue swelling or trouble breathing or swallowing. Severe watery or bloody diarrhea means calling your doctor immediately. For an overdose, call Poison Control at 1-800-222-1222. Pymander's escalation routing is built and tested specifically for this class of decision; see the safety architecture working paper.
What a Pymander AI doctor consult looks like
Illustrative example, not a real member's messages.
Common questions
How fast does cephalexin work?
MedlinePlus says you should begin to feel better during the first few days of treatment. If your symptoms are not improving or are getting worse by then, call your doctor - the bacteria may be resistant or the diagnosis may need revisiting.
Can I take cephalexin with food?
Yes - with or without, per MedlinePlus. Food can blunt the nausea and stomach upset that sit on its common side effect list.
Does cephalexin affect birth control?
It can. MedlinePlus cautions that cephalexin may decrease the effectiveness of hormonal contraceptives (pills, patches, rings, and injections) and advises using another method of contraception while taking it.
I am allergic to penicillin - can I take cephalexin?
That is a decision for your doctor, not a rule of thumb. Cephalexin is a cephalosporin, a related class, and MedlinePlus explicitly describes its use in penicillin-allergic patients for certain procedures - but it also tells you to report every allergy and what symptoms you had. Disclose the full history and let the clinician weigh the cross-reactivity risk.
Why do I have to finish all 10 days?
Because feeling better is not the same as the bacteria being gone. MedlinePlus warns that stopping cephalexin too soon or skipping doses can leave the infection incompletely treated and help the bacteria become resistant to antibiotics. The label requires at least 10 days for strep infections for the same reason.
Can I drink alcohol while taking cephalexin?
Neither the FDA label nor MedlinePlus lists an alcohol interaction for cephalexin. Alcohol can still worsen nausea and slow recovery, so many clinicians suggest skipping it during the course - ask your doctor for advice on your situation.
