Diarrhea that looks like coffee grounds is a sign of bleeding in your upper digestive tract, typically your stomach or the first section of your small intestine. The dark, granular appearance comes from blood that has been exposed to stomach acid long enough to dry, congeal, and darken from red to brown or black. This is not a normal variation in stool, and it warrants prompt medical attention.
Why Blood Turns Into “Coffee Grounds”
When blood pools in your stomach or upper intestine, digestive acids break down the hemoglobin in red blood cells. This chemical reaction changes the blood from bright red to a dark brown or black color with a gritty texture. By the time it passes through your system and shows up in your stool, it can look strikingly similar to wet coffee grounds scattered through loose or watery bowel movements.
This is different from bright red blood in your stool, which usually signals bleeding lower in the digestive tract (the colon or rectum). The coffee-ground appearance specifically points to an upper source because the blood has had time and acid exposure to transform before reaching the other end. In medical terms, black tarry stool from upper GI bleeding is called melena, and it’s typically jet black with a sticky consistency and a distinctive foul smell.
Most Common Causes
Several conditions can produce bleeding high enough in your digestive system to create that coffee-ground look.
Peptic ulcers are the most frequent culprit. These are open sores on the lining of your stomach or the upper part of your small intestine. The two biggest drivers of peptic ulcers are a bacterial infection called H. pylori and regular use of pain relievers like aspirin, ibuprofen, or naproxen. Blood thinners can also contribute.
Gastritis occurs when the stomach lining becomes inflamed or damaged, sometimes creating shallow breaks that bleed. The causes overlap heavily with ulcers: H. pylori infection, frequent use of anti-inflammatory pain relievers, blood thinners, and heavy alcohol use.
Esophagitis is inflammation in the esophagus, often triggered by chronic acid reflux. Over time, the irritation can produce ulcers in the esophagus that bleed into the stomach.
Esophageal or stomach varices are swollen, enlarged veins that can burst and bleed significantly. These are most commonly associated with liver cirrhosis and represent a more serious cause of upper GI bleeding.
Mallory-Weiss tears are small rips in the lower esophagus, usually caused by forceful or prolonged vomiting. Tumors in the esophagus or stomach, whether benign or cancerous, can also weaken the digestive lining enough to expose blood vessels.
Alcohol and Pain Relievers Raise the Risk
If you regularly take over-the-counter pain relievers and drink alcohol, your risk goes up substantially. Research published by the American Academy of Family Physicians found that heavy alcohol consumption alone nearly triples the risk of major upper GI bleeding compared to non-drinkers. Combine that with regular aspirin use (more than 325 mg per day), and the relative risk jumps to seven times higher than baseline.
Regular ibuprofen use in people who drink also increases the risk, though occasional ibuprofen with alcohol does not appear to carry the same danger. Even low-dose aspirin taken for heart protection can raise bleeding risk when paired with alcohol consumption. This combination erodes the protective mucus layer of the stomach, leaving the lining vulnerable to acid damage.
Foods and Supplements That Mimic the Look
Before assuming the worst, consider what you’ve recently eaten or taken. Several substances can turn stool dark or granular without any bleeding involved:
- Iron supplements commonly cause black stool
- Bismuth subsalicylate (the active ingredient in Pepto-Bismol) turns stool very dark
- Activated charcoal produces black stool
- Black licorice and blueberries can darken stool noticeably
- Blood sausage and similar foods containing animal blood
The key difference is that these harmless causes typically produce uniformly dark stool without the gritty, granular texture or the distinctly foul odor that accompanies digested blood. If you haven’t taken any of these substances and the coffee-ground appearance persists, bleeding is the more likely explanation.
What Happens During Diagnosis
A doctor will start with your medical history, focusing on any previous bleeding, medications you take (especially NSAIDs and blood thinners), and your alcohol intake. Initial testing usually includes blood work to check for anemia, how well your blood clots, your platelet count, and liver function.
A stool test can confirm whether there’s hidden blood in your stool, which is especially useful if the visual appearance is ambiguous. In some cases, a tube may be passed through the nose into the stomach to examine its contents directly and help pinpoint the source.
The most definitive test is an upper endoscopy, where a thin, flexible tube with a camera is guided down your throat to visually inspect your esophagus, stomach, and the beginning of your small intestine. This lets the doctor see the exact source of bleeding and, in many cases, treat it during the same procedure. If the upper endoscopy doesn’t find the source, a colonoscopy or capsule endoscopy (swallowing a pill-sized camera) may follow. For harder-to-reach areas, specialized scopes or imaging with contrast dye can locate bleeding vessels.
How the Underlying Cause Is Treated
Treatment depends entirely on what’s causing the bleeding. For peptic ulcers and gastritis, the cornerstone is a type of acid-reducing medication called a proton pump inhibitor, or PPI. Common options include omeprazole, esomeprazole, and lansoprazole, several of which are available without a prescription. These are typically taken 30 minutes before your first meal of the day.
If H. pylori bacteria are involved, you’ll likely take a PPI alongside two or three other medications for about two weeks to clear the infection. For ulcers without H. pylori, a PPI course of around eight weeks is common. You’ll also be asked to stop taking NSAIDs and limit alcohol during healing.
More acute causes, like burst varices or actively bleeding ulcers, can often be treated during the endoscopy itself through techniques that seal the bleeding site. Mallory-Weiss tears frequently heal on their own once vomiting stops.
Warning Signs of Severe Bleeding
Coffee-ground stool on its own warrants a call to your doctor, but certain accompanying symptoms signal a more urgent situation. Lightheadedness or dizziness when standing, a racing heartbeat, feeling faint, unusual paleness, or vomiting material that also looks like coffee grounds all suggest significant blood loss. If your stool is jet black, sticky, and tar-like, or if you’re passing large volumes of dark stool with any of these symptoms, go to an emergency room. Rapid blood loss from the GI tract can cause a dangerous drop in blood pressure that requires immediate intervention.

