The direct answer: in a healthy adult with normal kidney function, cephalexin is mostly gone within 6 to 8 hours of a single dose, and fully cleared within 24 hours. It has one of the shortest elimination timelines of any commonly prescribed antibiotic, which is both a strength and a limitation — it works quickly, but it also leaves the body quickly enough that missed doses can allow bacterial levels to rebound.
That 6 to 8 hour window is the standard answer. The full picture is more nuanced, because kidney function, age, body composition, and drug interactions all affect how long cephalexin actually stays in your system in practice.
What Is Cephalexin?
Cephalexin is a first-generation cephalosporin antibiotic sold under the brand name Keflex, among others. It belongs to the beta-lactam family of antibiotics and works by disrupting bacterial cell wall synthesis, ultimately killing susceptible bacteria. It is one of the most commonly prescribed oral antibiotics in the United States and is included on the World Health Organization’s List of Essential Medicines.
Cephalexin is effective against a range of gram-positive bacteria and some gram-negative bacteria, making it useful for treating skin and soft tissue infections, urinary tract infections, strep throat, ear infections, and certain respiratory infections. It is not effective against MRSA, most Enterococcus strains, or Pseudomonas aeruginosa.
The Half-Life: The Number That Explains Everything
To understand how long cephalexin stays in your system, the most important concept is the elimination half-life — the time it takes for your body to clear half of the drug from your bloodstream.
In adults with normal kidney function, cephalexin has a half-life of approximately 0.5 to 1.2 hours, with most clinical references centering around 58 minutes to 1 hour as the practical average. Pharmacokinetically, a drug is considered effectively eliminated after 5 to 6 half-lives, because at that point roughly 97% of the drug has been cleared.
Working through the math:
| Half-Life Cycles | Time Elapsed | Approximate % Remaining |
|---|---|---|
| 1 half-life | ~1 hour | 50% |
| 2 half-lives | ~2 hours | 25% |
| 3 half-lives | ~3 hours | 12.5% |
| 4 half-lives | ~4 hours | 6.25% |
| 5 half-lives | ~5 hours | 3% |
| 6 half-lives | ~6 hours | ~1.5% |
This means that for a single dose of cephalexin in a healthy adult, the drug is effectively cleared within 5 to 6 hours. Clinical data confirms this — 70 to 90% of an oral cephalexin dose is excreted unchanged in urine within 8 to 12 hours of administration in adults with normal renal function.
How the Body Eliminates Cephalexin
Cephalexin undergoes minimal metabolism in the body — it does not get broken down by the liver to any significant degree. Instead, it is excreted almost entirely unchanged by the kidneys through two processes: glomerular filtration, where blood is filtered through the kidney’s functional units, and tubular secretion, where the kidney actively pumps the drug from surrounding blood vessels into the urine.
This is why kidney function is the single most important variable affecting how long cephalexin stays in your system. The kidneys do nearly all the work of clearing it. When they work well, cephalexin clears rapidly. When they do not, it lingers.
Because cephalexin is excreted primarily through the urine in its active, unchanged form, it reaches particularly high concentrations in the urinary tract — which is one reason it is highly effective at treating urinary tract infections.
Factors That Change How Long Cephalexin Stays in Your System
Kidney Function
This is the dominant variable. In a healthy adult, the half-life is approximately 1 hour and the drug is gone within 8 hours. In a person with moderate kidney impairment, the half-life lengthens considerably. In someone with severely impaired kidney function — creatinine clearance below 13.5 mL/minute — the half-life stretches to between 7.7 and 13.9 hours. In a person with essentially no kidney function, pharmacokinetic studies report a half-life of up to 15.4 hours, meaning the drug could take 3 to 4 days to fully clear.
This is why physicians adjust cephalexin dosing schedules for patients with kidney disease — the same dose that clears safely in a healthy person in hours can accumulate to toxic levels in someone with severely impaired renal function.
Age
Age affects cephalexin clearance primarily through its effect on kidney function. Kidney function naturally declines with age, and elderly patients — generally defined as 65 and older in pharmacological studies — tend to clear cephalexin more slowly than younger adults. This does not typically require dose adjustment unless kidney function is significantly impaired, but it means the drug may be present for a longer period in older patients.
At the other end of the age spectrum, newborns and very young infants clear cephalexin much more slowly than older children and adults. The half-life is approximately 5 hours in neonates and 2.5 hours in children aged 3 to 12 months, compared to under 1 hour in healthy adults. This reflects the immature kidney function of very young infants rather than any difference in the drug itself.
Dosage and Duration of Treatment
A single dose of cephalexin clears in roughly 5 to 8 hours. When cephalexin is taken multiple times daily — as it almost always is, given its short half-life — the drug builds to a steady-state concentration in the bloodstream. Once a treatment course ends, the drug clears from that steady state with the same kinetics as a single dose. In healthy adults, this still means the drug is effectively out of the system within 8 to 12 hours of the final dose.
Higher individual doses take marginally longer to clear because more drug needs to be processed, but the difference is modest given the half-life remains the same.
Drug Interactions: Probenecid
Probenecid, a medication used to treat gout and certain other conditions, slows the kidney’s tubular secretion of cephalexin. When the two are taken together, cephalexin blood levels are higher and more sustained than when cephalexin is taken alone. This interaction is sometimes used therapeutically to extend cephalexin’s effective duration in specific clinical situations, but it requires monitoring because higher sustained levels also increase the potential for side effects.
Body Composition
Body size and composition can influence drug distribution. Cephalexin distributes throughout body water, so larger individuals with greater body mass may have a slightly broader volume of distribution. The practical effect on clearance time is modest compared to kidney function but contributes to individual variability in how the drug behaves.
Does Cephalexin Show Up on Drug Tests?
Cephalexin is not a controlled substance and does not appear on standard workplace or clinical drug screening panels, which test for categories including opioids, benzodiazepines, stimulants, cannabis, and similar substances. It will not cause a positive result on any standard urine drug screen.
The one testing consideration worth knowing is that cephalexin can cause false positive results on certain urine glucose tests — specifically the older copper reduction tests used in some diabetes monitoring contexts, not the standard glucose oxidase tests used in modern clinical settings. If you are monitoring urine glucose with an older testing method while taking cephalexin, results may be inaccurate until the drug has cleared, which typically means 8 to 12 hours after the last dose.
Why the Short Half-Life Matters for How You Take It
Cephalexin’s rapid elimination is the reason it is almost always prescribed as multiple daily doses rather than a single once-daily antibiotic like azithromycin. The antibiotic needs to maintain blood concentrations above the minimum inhibitory concentration for the bacteria being treated — the level at which it effectively suppresses bacterial growth. When blood levels drop below that threshold, surviving bacteria can begin multiplying again.
With a 1-hour half-life, a single dose of cephalexin would drop to sub-therapeutic levels within a few hours without another dose following it. This is why standard dosing is every 6 to 12 hours depending on the infection type and severity, and why missing doses is particularly consequential with cephalexin compared to antibiotics with longer half-lives.
Completing the full prescribed course matters for a related reason. The fact that cephalexin is clearing your system throughout the treatment period means you cannot bank on residual drug levels carrying the antibiotic effect after you stop — there is no lingering reservoir the way there is with azithromycin, which has a tissue half-life of days. When you stop cephalexin, its antibacterial effect ends within hours.
After Effects: What Persists Even After Cephalexin Clears
The drug itself is gone, but some of its effects linger longer than the pharmacokinetic timeline suggests.
Like all antibiotics, cephalexin eliminates both the pathogenic bacteria causing the infection and a portion of the beneficial bacteria that populate the gut microbiome. The antibiotic does not distinguish between the bacteria it is supposed to kill and the helpful commensal bacteria that support digestion, immune function, and gut integrity.
Digestive side effects — diarrhea, bloating, nausea — can persist for days to weeks after cephalexin has fully cleared the system because the gut microbiome takes time to repopulate. Some research suggests the microbiome can take two weeks or more to return to its pre-antibiotic state after a standard course, even though the antibiotic itself cleared in hours. Probiotic supplementation during and after antibiotic courses is increasingly supported as a strategy for reducing this disruption, though the timing and specific strains matter for effectiveness.
In people who develop Clostridioides difficile (C. diff) infection as a complication of antibiotic use — a less common but serious risk — the symptoms emerge because antibiotic-related disruption of the gut microbiome allows C. diff bacteria to overgrow. This can occur even after the antibiotic has fully cleared the system, and it requires specific treatment rather than simply waiting for the drug to finish eliminating.
Summary: Timeline at a Glance
| Timepoint | What Is Happening |
|---|---|
| 1 hour post-dose | Peak blood concentration reached |
| 1–2 hours | Blood levels begin dropping rapidly |
| 5–6 hours | ~97% of a single dose eliminated |
| 8–12 hours | 70–90% of dose recovered in urine; drug effectively gone in healthy adults |
| 24 hours | Complete clearance in virtually all healthy adults |
| 3–4 days | Estimated clearance in severe kidney failure |
| 2 weeks | Approximate time for gut microbiome to recover |
Frequently Asked Questions
Can I drink alcohol while taking cephalexin?
There is no direct pharmacokinetic interaction between cephalexin and alcohol — alcohol does not affect cephalexin’s absorption or elimination, and cephalexin does not produce the dangerous reaction to alcohol that some antibiotics like metronidazole do. However, alcohol can impair immune function, disrupt sleep, and worsen dehydration, all of which can slow recovery from the infection being treated. Moderate alcohol consumption is unlikely to compromise the antibiotic’s effectiveness, but avoiding it during a course of antibiotics is generally sensible advice.
How long after finishing cephalexin can I take another medication?
Because cephalexin clears within 8 to 12 hours of the last dose in healthy adults, it is unlikely to interact with medications started the following day. For procedures, surgeries, or medications where drug interactions are specifically a concern, consult your physician or pharmacist — but in most situations, a full day after the last dose is sufficient clearance time.
Why do I still feel sick after cephalexin has cleared my system?
Several explanations are possible. The infection itself may not be fully resolved — bacteria can survive at sub-therapeutic drug levels if doses were missed or the course was too short. The inflammation and tissue damage caused by the infection take time to heal even after the bacteria are cleared. Gut disruption from the antibiotic may be causing ongoing digestive symptoms. Or the infection may have been viral rather than bacterial, in which case cephalexin would not have addressed the underlying cause. If symptoms persist significantly after completing a course, follow up with your healthcare provider.
Is it safe to take cephalexin if I have kidney disease?
Yes, but dose adjustment is typically required. Your physician will calculate an appropriate dosing schedule based on your level of kidney impairment. The standard adult doses are designed for normal kidney function, and taking them without adjustment in the presence of significant kidney disease risks drug accumulation and increased side effects.
Does cephalexin work for viral infections like the flu or a cold?
No. Cephalexin is an antibacterial agent with no activity against viruses. Taking it for viral infections will not treat the illness and contributes to antibiotic resistance by exposing bacteria — including the helpful ones in your gut — to unnecessary antibiotic pressure.
For current prescribing information on cephalexin including dosing guidelines and drug interactions, the MedlinePlus drug information page for cephalexin maintained by the US National Library of Medicine provides comprehensive, up-to-date clinical reference information.

