Hematemesis is vomiting blood, and melena is passing black, tarry stools. Both are signs of bleeding somewhere in the upper digestive tract, typically from the esophagus, stomach, or the first part of the small intestine. They often occur together, but either one alone is enough to signal a potentially serious problem that needs medical evaluation.
Why Blood Looks Different Coming Up vs. Going Down
The appearance of blood changes depending on how long it sits in the digestive tract and how much contact it has with stomach acid. Fresh, active bleeding produces bright red vomit. When bleeding slows or stops before vomiting occurs, stomach acid converts the red pigment in blood cells into a brown compound through oxidation. This creates what’s often described as “coffee-ground” vomit: dark brown, granular material that looks nothing like fresh blood but still indicates a bleed.
Melena follows a similar logic but further along the digestive tract. Blood that travels through the stomach and intestines gets digested along the way, turning the stool jet black with a distinctive sticky, tar-like consistency and a strong, foul smell. That smell and texture distinguish true melena from stools that are simply dark in color. It generally takes as little as 50 to 100 milliliters of blood in the upper gut to produce melena, and the blood may have entered the digestive tract hours before it appears in a bowel movement.
The Anatomical Dividing Line
Doctors classify gastrointestinal bleeding as either “upper” or “lower” based on where the bleeding originates. The dividing landmark is a small ligament that suspends the end of the duodenum (the first section of the small intestine) inside the abdomen. Bleeding above this point typically shows up as hematemesis, melena, or both. Bleeding below it more commonly produces bright red or maroon blood in the stool, a symptom called hematochezia. This distinction matters because the causes, diagnostic approach, and treatment differ depending on the source.
Common Causes
Peptic ulcers are the leading cause of upper gastrointestinal bleeding. In population-level data, duodenal ulcers account for roughly 21% of cases and gastric ulcers for about 15%. These ulcers erode into the lining of the stomach or duodenum, and when they reach a blood vessel, bleeding can range from a slow ooze to a rapid hemorrhage.
Other frequent causes include:
- Esophageal varices: Swollen veins in the esophagus, usually caused by liver disease. These can rupture and bleed heavily with little warning.
- Gastritis and erosions: Inflammation or shallow breaks in the stomach lining, often triggered by alcohol, stress, or medications.
- Mallory-Weiss tears: Small tears at the junction of the esophagus and stomach, commonly caused by forceful or prolonged vomiting.
- Tumors: Cancers of the esophagus or stomach can bleed as they grow into surrounding tissue.
Certain medications significantly raise the risk. Nonsteroidal anti-inflammatory drugs (NSAIDs like ibuprofen and naproxen), blood thinners like warfarin, and low-dose aspirin all contribute. Combinations of these drugs are particularly dangerous. In one population-based study, gastric ulcers combined with NSAID use were independent predictors of severe bleeding.
Not All Black Stools Are Melena
Several common substances can turn stool black without any bleeding involved. Iron supplements are a frequent culprit. Bismuth subsalicylate, the active ingredient in Pepto-Bismol, also darkens stool. Activated charcoal, blood sausage, black licorice, and large amounts of blueberries can all produce a similar color change.
The key difference is texture and smell. Drug- or food-related darkening produces stool that looks dark but has a normal consistency. True melena is unmistakably sticky and tar-like, with a pungent odor that’s hard to ignore. If you’re unsure, it’s worth getting checked rather than assuming the cause is dietary.
Warning Signs of Significant Blood Loss
Hematemesis and melena become urgent when they’re accompanied by signs that the body is losing blood faster than it can compensate. Early blood loss (up to about 15% of total blood volume) may produce only mild anxiety and a slight increase in heart rate. You might not feel dramatically different.
As blood loss increases to 15% to 30% of total volume, the heart rate climbs above 100 beats per minute, the skin becomes cool and clammy, and pulse pressure narrows, meaning the difference between the top and bottom blood pressure numbers shrinks. At 30% to 40% loss, blood pressure drops noticeably, thinking becomes confused, and urine output falls. Beyond 40%, blood pressure drops below 90 systolic, the heart races above 120, skin turns pale and cold, and the situation becomes life-threatening.
In practical terms, if you’re vomiting blood or passing black tarry stools and also feel lightheaded, dizzy when standing, unusually thirsty, confused, or notice your heart pounding, those are signs of meaningful blood loss that needs emergency attention.
How Bleeding Is Diagnosed
The primary diagnostic tool is an upper endoscopy, a flexible camera passed through the mouth into the esophagus, stomach, and duodenum. This lets the medical team see the source of bleeding directly and, in many cases, treat it during the same procedure.
Current guidelines recommend performing endoscopy within 24 hours of a patient arriving at the hospital, with a priority on stabilizing blood pressure and heart rate first. Rushing to endoscopy within 6 hours has not consistently shown better survival outcomes compared to performing it within the standard 24-hour window. The one exception may be patients at very high risk for continued bleeding or death, where some evidence suggests earlier intervention could help.
You might wonder about the older approach of placing a tube through the nose into the stomach to check for blood. This technique has largely fallen out of favor. Its sensitivity ranges from just 42% to 84%, meaning it misses a substantial number of active bleeds. A negative result doesn’t reliably rule out an upper source of bleeding.
How Severity Gets Assessed
When you arrive at a hospital with signs of upper gastrointestinal bleeding, the medical team uses scoring systems to estimate how serious the situation is. The most widely used is the Glasgow-Blatchford Score, which ranges from 0 to 23. It factors in heart rate, blood pressure, blood counts, kidney function markers, whether you’ve fainted, whether you’re passing melena, and whether you have existing liver or heart disease.
A score of zero identifies patients at very low risk who may be safe to manage without hospital admission. Higher scores indicate a greater likelihood of needing a blood transfusion, an endoscopic procedure to stop bleeding, or surgery. This scoring happens quickly and helps guide how aggressively the team needs to act.
What Treatment Looks Like
The first priority is replacing lost fluid and blood to stabilize circulation. You’ll have an IV placed, and if blood loss is significant, you may receive a transfusion. Once your vital signs are stable, endoscopy serves double duty: diagnosing the source and stopping the bleed. Depending on what’s found, the bleeding can be controlled with clips, heat application, or injection of substances that seal off the bleeding vessel.
For bleeding caused by peptic ulcers, treatment also targets the underlying cause. This typically means medications that reduce stomach acid production, and if testing reveals a bacterial infection (H. pylori), a course of antibiotics. Medications that contributed to the bleed, particularly NSAIDs, will need to be stopped or replaced.
For variceal bleeding related to liver disease, the approach is different and often involves banding the swollen veins during endoscopy, along with medications that reduce blood flow to the portal vein system.
Outcomes and Recovery
Upper gastrointestinal bleeding carries real risk. A national audit from the United Kingdom estimated in-hospital mortality at roughly 10%. In clinical trials focused on high-risk patients, 30-day mortality ranged from about 7% to 9%. These numbers reflect the full spectrum of severity, including patients with massive hemorrhage and serious underlying conditions like advanced liver disease.
For patients with a single bleeding ulcer and no major comorbidities, outcomes are considerably better. Most bleeding stops on its own or with endoscopic treatment, and the need for surgery during hospitalization is low in population-level studies. Recovery after a successfully treated bleed typically involves a hospital stay of a few days, acid-suppressing medication for weeks to months, and follow-up to confirm healing and prevent recurrence.

