Doctors may perform an upper gastrointestinal endoscopy to diagnose and help treat stomach ulcers. During the procedure, a healthcare professional inserts an endoscope through the mouth and into the stomach.

An upper gastrointestinal endoscopy is a minimally invasive procedure. It involves a healthcare professional using an endoscope to examine a person’s stomach and the upper portion of the small intestine that connects to the stomach, or duodenum.

An endoscope is a long, thin, flexible tube with a light and camera at the end.

Doctors order endoscopies to better visualize what is going on inside a person’s body. During endoscopies, they may take photos inside the body and take biopsy samples for further analysis. Sometimes, they perform treatments.

This article reviews when an upper gastrointestinal endoscopy may be necessary, what to expect during the procedure, and treatments for stomach ulcers.

A doctor is looking at an endoscopy of a stomach ulcerShare on Pinterest
Tom Werner/Getty Images

Doctors may use an upper gastrointestinal endoscopy to check for and diagnose stomach ulcers.

A person with a stomach ulcer may or may not present with symptoms. If symptoms do occur, they can include:

A person presenting with stomach ulcer symptoms should consider scheduling an appointment with a doctor. Healthcare professionals can work out the underlying cause of a person’s symptoms and recommend appropriate treatment, if necessary.

If a doctor suspects a person has a stomach ulcer, they will likely order an endoscopy. Healthcare professionals may use the procedure to help identify any ulcers and rule out other possible causes of symptoms, including:

According to a 2018 study, doctors may also use an endoscope to successfully and safely treat a bleeding ulcer. Bleeding is one possible complication of having a stomach ulcer.

A person with the following symptoms should contact emergency medical services by calling 911 right away because they can be signs of stomach ulcer complications:

An endoscopy is a minimally invasive procedure that involves a healthcare professional inserting an endoscope through a person’s esophagus, or food pipe, and into their stomach and duodenum.


When preparing for an endoscopy, a person should discuss what they need to do with the doctor who ordered the procedure. A person should discuss any medications and supplements they are taking. A doctor may recommend the person temporarily stops taking certain medications before the procedure.

A person will also likely need to stop eating and drinking for about 8 hours before the procedure.

Individuals will take sedatives for the procedure, so they should also make sure someone can drive them home. A person will not be able to drive for 24 hours after an endoscopy. This is to allow time for the sedatives to wear off.

Doctors perform the procedure in an outpatient or hospital setting. A healthcare professional will insert an intravenous line into a person’s arm to administer a mild sedative. They may also provide a spray or gargle to numb the throat and prevent gagging.


During the procedure, a person will lie on their side while the doctor inserts the tube into their mouth and down their throat.

The healthcare professional can then use the endoscope to view the esophagus, stomach, and duodenum. They may also take a small sample of tissue for biopsy, stop any bleeding ulcers, or perform other procedures.


Once the procedure is complete, the healthcare professional will remove the endoscope from the person’s mouth. Other healthcare professionals will then move the person to a recovery room to rest for about 1–2 hours as the sedative wears off. They will then typically rest at home for the remainder of the day.

A person may experience the following after the procedure:

  • a sore throat, which can last for a few days
  • nausea
  • abdominal bloating

People can return to eating their typical diet when they are able to swallow as usual.

The treatment a doctor recommends for stomach ulcers may vary depending on their cause.

If medications, such as nonsteroidal anti-inflammatory drugs, caused the ulcer, a healthcare professional will likely recommend discontinuing the use of the medication and suggest an alternative.

People with a Helicobacter pylori infection, which is a common cause of ulcers, may need to take several medications, such as:

In some cases, doctors may also recommend a repeat endoscopy after completing treatment to ensure the ulcer has healed or has not become cancerous.

Doctors often use endoscopies to help diagnose stomach ulcers. They may also use the endoscope to take a tissue sample for a biopsy, stop any bleeding ulcers, or perform other procedures.

During the procedure, a doctor will insert the endoscope into a person’s throat and down into their stomach. The procedure is minimally invasive, but a person will need to rest for about a day after the procedure to allow the sedative to wear off.

If a doctor finds stomach ulcers, the treatment they recommend will depend on the underlying cause. They may treat them with medications or advise a person to stop taking certain medications, for example.