Diagnosing a peptic ulcer typically involves a combination of symptom evaluation, testing for a common bacterial infection, and in many cases, a visual examination of your stomach lining with a thin, flexible camera. The process is straightforward, but one surprising fact shapes the entire diagnostic approach: roughly 70% of peptic ulcers cause no symptoms at all. That means many ulcers are discovered only after a complication like bleeding occurs, making it important to understand what prompts testing and what each test actually reveals.
Symptoms That Trigger an Evaluation
The hallmark symptom is a burning or gnawing pain in the upper abdomen, right below your breastbone. About 80% of people with endoscopically confirmed ulcers report this type of pain. It can radiate to the sides of the upper abdomen, and occasionally to the back, though back pain alone would be unusual.
The timing of the pain often provides a clue. Duodenal ulcers (those in the first part of the small intestine) classically hurt two to five hours after eating, once food has cleared the stomach and acid has nothing left to buffer. Nighttime pain between roughly 11 PM and 2 AM is also characteristic, since acid secretion peaks during those hours. Gastric ulcers (in the stomach itself) are more likely to cause pain during or shortly after meals.
Beyond pain, nearly half of people with peptic ulcers experience heartburn or acid regurgitation. Other common complaints include bloating, feeling full quickly, nausea, belching after meals, and an intolerance to fatty foods. These overlap heavily with general indigestion, which is exactly why testing is needed to confirm whether an ulcer is actually present. Symptoms alone can’t distinguish an ulcer from other causes of upper abdominal discomfort.
Some ulcers announce themselves through more alarming signs: vomiting blood (which can look like coffee grounds), black or tarry stools, sudden sharp abdominal pain, or unexplained weight loss. Between 43% and 87% of people who show up with a bleeding ulcer had no prior warning symptoms at all.
Testing for H. Pylori Infection
One of the first steps in diagnosing an ulcer is checking whether you’re infected with H. pylori, a bacterium that burrows into the stomach lining and is one of the two leading causes of ulcers (the other being regular use of pain relievers like ibuprofen or aspirin). Three non-invasive tests can detect it without requiring a scope.
The urea breath test is the most widely used. You swallow a small capsule or drink a solution containing a tagged form of urea. If H. pylori is present in your stomach, the bacteria break down the urea and release carbon dioxide that can be measured in your breath about 15 to 30 minutes later. Sensitivity runs around 92% to 94%, meaning it correctly identifies the infection in the vast majority of cases.
The stool antigen test detects H. pylori proteins in a stool sample. It performs comparably to the breath test and is often more convenient, since it doesn’t require specialized equipment or an office visit to collect the sample.
A blood antibody test can confirm past exposure to H. pylori but can’t distinguish between a current and a previous infection. For that reason, it’s less useful for guiding treatment decisions and is generally not the preferred first choice.
Medications That Interfere With Testing
If you’re taking a proton pump inhibitor (a common type of acid-reducing medication), you’ll need to stop it at least two weeks before a breath test or stool test. These drugs suppress H. pylori activity enough to produce a false negative. Antibiotics taken for any reason can also interfere, so a four-week gap after finishing any antibiotic course is standard before testing. Your provider will give you specific instructions, but knowing this in advance helps you avoid a wasted test.
Upper Endoscopy: The Definitive Look
An upper endoscopy (also called an EGD) is the gold standard for diagnosing ulcers. A gastroenterologist threads a thin, flexible tube with a camera and light on its tip through your mouth, down your esophagus, and into your stomach and the first part of your small intestine. The whole procedure typically takes 15 to 20 minutes.
The camera transmits real-time color images, allowing the doctor to see an ulcer directly, assess its size and depth, and look for active bleeding or scarring. More importantly, the scope allows tissue samples (biopsies) to be taken during the same procedure. Current guidelines recommend that all gastric ulcers be biopsied, because a small percentage of stomach ulcers that look benign turn out to be cancerous. Duodenal ulcers carry a much lower malignancy risk and may not require biopsy unless something looks unusual. The biopsy tissue can also be tested for H. pylori, giving both a diagnosis and a cause in one visit.
If you’re scheduled for an endoscopy, you’ll need to fast. The standard instruction is nothing to eat or drink for at least eight hours beforehand, with no solid food after midnight the night before. Essential medications can usually be taken up to four hours before the procedure with tiny sips of water, but antacids and stomach-coating medications should be skipped. You’ll receive sedation through an IV, so you won’t feel the scope and likely won’t remember the procedure. Plan for someone to drive you home afterward, and expect mild throat soreness for a day or so.
Imaging as an Alternative
An upper GI series (sometimes called a barium swallow) is a non-invasive alternative that uses X-rays to visualize the stomach lining. You drink a chalky liquid containing barium, which coats the digestive tract and makes ulcers visible on the X-ray. A double-contrast version, which introduces both air and barium, provides a clearer picture of the stomach lining.
This test can identify ulcers but has a significant limitation: it can’t take tissue samples. If the X-ray reveals something suspicious, you’ll still need an endoscopy for biopsy. For this reason, the upper GI series has largely been replaced by endoscopy as the primary diagnostic tool, though it may still be used when endoscopy isn’t available or when a patient can’t tolerate sedation.
How Clinicians Pinpoint the Cause
Once an ulcer is confirmed, the next step is determining why it developed. The diagnostic workup narrows the cause to one of a few categories. If H. pylori testing comes back positive, the infection is treated as the primary driver. If H. pylori is negative, your doctor will look at your medication history. Regular use of NSAIDs (ibuprofen, naproxen, aspirin) is the other major culprit, and an ulcer in someone who tests negative for H. pylori but takes NSAIDs frequently points clearly to the medication.
In rarer cases, when both H. pylori and NSAIDs are ruled out, additional testing may be needed to investigate less common causes like excess acid production from a hormone-secreting tumor. But this scenario accounts for a very small fraction of ulcers.
Follow-Up After Diagnosis
Gastric ulcers typically require a repeat endoscopy after treatment, usually six to eight weeks later, to confirm the ulcer has healed and to re-biopsy if needed. This follow-up step is important for catching the small number of gastric ulcers associated with malignancy. Duodenal ulcers that respond well to treatment generally don’t need repeat scoping unless symptoms persist.
If your initial diagnosis came through H. pylori testing without endoscopy, your provider will usually retest after treatment to confirm the bacteria have been eradicated. The breath test and stool antigen test are both effective for this confirmation step, again with the same medication washout requirements before testing.

