Diarrhea: causes, treatment, and when to see a doctor

Last updated September 3, 2026.

Most diarrhea is a stomach bug or food poisoning and resolves in one to three days with fluids and time. The treatment that matters is rehydration - oral rehydration solution beats plain water. Blood in the stool, a high fever that is not settling, severe pain, or signs of real dehydration change the answer to same-day medical care. Diarrhea past two weeks always deserves a workup.

Common causes

Rehydrate properly

Find answers to your diarrhea

Start a free AI doctor consult →

About anti-diarrhea medicine

Loperamide (Imodium) is fine for an adult with straightforward diarrhea who needs to function. Do NOT use it with blood or mucus in the stool, high fever, or suspected bacterial infection - slowing the gut then keeps the problem inside you longer. Bismuth subsalicylate is the milder option. Children should generally not get anti-diarrhea medication. Fluids and time are the actual treatment.

When to get medical care

Emergency room: signs of serious dehydration (little or no urine, dizziness on standing, fainting, confusion), blood or black tarry stool, severe or worsening abdominal pain. Same-day care: high fever not settling, no improvement by day three or four, diarrhea after recent antibiotics that is severe, or diarrhea in an infant, an elderly person, pregnancy, or anyone immunocompromised. Past two weeks: always a workup. 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

Any blood or mucus in it, any fever, and are you managing to keep fluids down?
No blood, mild fever 99.8, fluids staying down.
Thanks for giving me all this information. Based on what you've said, it looks like you may be experiencing a stomach bug, and the main job is rehydration: oral rehydration solution from the pharmacy, small sips all day. It should start improving by day three. Blood, a climbing fever, or barely any urine means we switch to in-person care. Here's your care note to share with your care team.
Care note
Diarrhea 8 times since yesterday
Fits a stomach bug. Plan: oral rehydration solution, small sips all day; expect improvement by day 3. Watch: blood, climbing fever, or barely any urine = in-person care.
View care note →

Illustrative example, not a real member's messages.

Common questions

What causes diarrhea?

Acute diarrhea is usually an infection: viruses like norovirus are the most common cause, often with vomiting and a one to three day course, while bacteria from food poisoning (campylobacter, salmonella, E. coli) can be more severe. Antibiotics cause diarrhea in a meaningful share of people who take them, by disrupting gut bacteria; a specific antibiotic-associated infection called C. difficile is the serious version, especially in hospitals and care homes. Other causes: lactose intolerance after dairy, artificial sweeteners like sorbitol in sugar-free gum and candy, magnesium-containing antacids, metformin, anxiety, and alcohol. Traveler's diarrhea from contaminated food or water is its own category. Diarrhea persisting past two weeks is chronic and has a different list - IBS, inflammatory bowel disease, celiac disease, thyroid overactivity - and always deserves a workup.

How do I rehydrate properly with diarrhea?

Rehydration is the whole treatment for most diarrhea, because dehydration - not the diarrhea itself - is what makes people seriously ill. Oral rehydration solution from a pharmacy is best: it has the right glucose-salt ratio to pull water back into the body, and water alone does not replace lost salts. Small frequent sips beat large gulps, which can trigger vomiting. If no rehydration solution is available, dilute juice with water, or mix half a teaspoon of salt and six teaspoons of sugar into a liter of water. Eat normally as soon as you feel able - bland and simple at first, but there is no need to starve a stomach bug. Watch the warning signs of dehydration: very dark urine or little of it, dizziness on standing, dry mouth, and in children no tears, a sunken soft spot, or unusual sleepiness.

Should I take anti-diarrhea medicine like loperamide?

It depends on what is causing it, and this is where people go wrong. Loperamide (Imodium) is reasonable for an adult with straightforward diarrhea who needs to function - a flight, a shift, an exam - and it shortens symptoms by about a day. But do NOT use it when there is blood or mucus in the stool, a high fever, or suspected bacterial food poisoning or C. difficile: slowing the gut down in those situations keeps the toxin or bacteria inside you longer and can be dangerous. Bismuth subsalicylate (Pepto-Bismol) is a milder option and safe in those cases for adults. Children should generally not get anti-diarrhea medication. The default for most diarrhea is fluids and time; the medicine is a convenience tool, not the treatment.

When is diarrhea an emergency?

Go to an emergency room for signs of serious dehydration: little or no urine, dizziness on standing or fainting, rapid heartbeat, confusion. Blood or black tarry material in the stool, severe or worsening abdominal pain, or a high fever over 39C (102F) that is not settling all warrant same-day care. Diarrhea in a young infant, an elderly person, someone pregnant, or anyone immunocompromised deserves a lower threshold for medical review, because dehydration hits those groups harder and faster. Also get seen promptly for diarrhea after recent antibiotics that is severe or bloody (possible C. difficile), or diarrhea after travel with fever. Diarrhea lasting beyond a few days without improvement, or any diarrhea past two weeks, needs a medical workup rather than more home care.

How long should diarrhea last?

Viral gastroenteritis typically runs one to three days, food poisoning often 24 to 48 hours, and most acute diarrhea from any cause resolves within about five to seven days. Antibiotic-associated diarrhea usually settles within days of finishing the course. Diarrhea that is not clearly improving by day three or four, or still going at a week, deserves a medical look - stool tests can identify treatable infections like giardia or C. difficile. Past two weeks it is chronic by definition, and the list changes completely: irritable bowel syndrome, inflammatory bowel disease, celiac disease, lactose intolerance, microscopic colitis, thyroid problems. Chronic diarrhea always deserves a workup, and it is usually solvable once the cause is named.

Can a doctor help with diarrhea over text or video?

Usually yes, because the triage is in the story: when it started, what it looks like, blood or not, fever, recent antibiotics, travel, what you ate, and whether anyone around you is sick. That history sorts most cases into home care, get a stool test, or go in now. Telehealth clinicians can also send a stool-test order to a local lab and prescribe when a treatable infection is likely. Texting an AI doctor is a fast first check: describe your symptoms and you get an honest read on which bucket you are in, plus how to rehydrate properly. The limits: dehydration itself can be hard to judge remotely, so anyone who looks or feels significantly unwell, cannot keep fluids down, or has the red flags above should go in person.

Sources

Pymander is not a replacement for a physician and does not provide medical advice, diagnosis, or treatment.

Free AI doctor, 24/7 by textStart a free AI doctor consult