Endoscopy (upper gastrointestinal)
Last published:Dec 14, 2023
This information tells you about upper gastrointestinal endoscopy, a test to look inside your stomach. It explains how the test is done, the risks involved, and what to expect afterwards.
You might also hear doctors call this test a gastroscopy, upper endoscopy, or just endoscopy. You can use this leaflet to discuss your procedure with the doctors and nurses treating you.
What is an upper gastrointestinal endoscopy?
An upper gastrointestinal endoscopy is a test to look inside your:
-
Oesophagus (the tube that food travels in from your mouth down to your stomach)
-
Stomach, and
-
Duodenum (the top part of your bowel or intestine).
This is done using a thin, flexible tube called a gastroscope or endoscope. On the end of the tube are a camera and a light. You swallow the tube, which then passes down your throat and into your stomach.
An endoscopy can check for problems such as:
-
Cancer in the stomach
-
Ulcers in the lining of your stomach or duodenum, and
-
Damage from acid reflux (when acid in the stomach goes back up the oesophagus).
Why might I need an endoscopy?
Your doctor might suggest that you have an endoscopy if you have symptoms of any of the problems listed above.
You should also have an urgent endoscopy if you:
-
Are vomiting blood or
-
Have a lot of blood in your stools.
You doctor will probably also suggest an endoscopy if you have indigestion (heartburn) along with any of the following:
-
Losing weight without trying
-
Vomiting a lot for no clear reason
-
Low levels of iron in your blood (anaemia)
-
Having trouble swallowing.
These things can be possible signs of stomach cancer. But most people who have an endoscopy find that they don’t have cancer.
If you're finding it hard to swallow properly, your oesophagus might have become scarred and narrow because your stomach is making too much acid. This condition is called Barrett's oesophagus.
Your doctor might also suggest that you have an endoscopy if you are over 55 and have started to have severe indigestion for no clear reason.
What will happen?
This type of endoscopy may only take about 15 minutes. But you’ll probably be in the treatment room for longer. And you'll probably need to stay in hospital for at least an hour afterwards to give you time to recover.
Preparing for the endoscopy
You might need to stop taking some of your usual indigestion medicines for 2 weeks before the test. That's because some medicines can hide problems that can be picked up by the test. Your doctor should tell you if you need to stop your usual medicines.
You'll be asked to not eat anything for at least 4 to 6 hours before your endoscopy. This is because food can get in the way of the doctor seeing inside your stomach. Your appointment letter, or your doctor or nurse will tell you when to stop eating and drinking before your test.
You’ll probably be given a sedative medication to help you to relax. You’ll be awake during the test, but you might not remember much about it afterwards.
During the test
The endoscopy happens like this:
-
You'll be asked to swallow the first part of a tube (the endoscope). It is slightly thicker than a pencil, but it's flexible, which makes it easier to swallow.
-
You might be given a local anaesthetic before you swallow the tube. This makes your throat numb so it doesn't hurt when you swallow the tube. The anaesthetic is sprayed into your throat, or given to you as a lozenge to suck.
-
Swallowing the endoscope might make you retch, as if you want to vomit. You shouldn’t be embarrassed if this happens. It’s very common and your doctor will be used to it.
-
When you've swallowed the endoscope, your doctor will push it gently down your throat, through to your stomach and into the top part of your intestines (your duodenum). You'll need to breathe through your nose during the test.
-
The endoscope has a light and a camera on its end. The camera sends pictures to a screen.
-
Your doctor will watch the screen as they look around your oesophagus, stomach, and duodenum.
-
The doctor will look for things like redness from too much acid, holes in the lining of your stomach or duodenum (this could be an ulcer), or lumps and blockages that could possibly be cancer.
-
During the endoscopy, your doctor might also take small samples of your cells to look at later. This is called a biopsy. You won't usually feel anything while the biopsy is happening. But if you're in any pain, signal to your nurse or doctor.
-
When the test is over your doctor will remove the endoscope. This is usually easy and shouldn’t hurt.
Wireless capsule endoscopy
Another new type of endoscopy involves swallowing a capsule, like a large pill, that has a tiny camera inside it. The camera sends pictures to a recorder that you wear on a belt around your waist.
You then pass the camera out in your stools when you go to the toilet.
This test is not widely available and is only done in certain situations. Capsule endoscopy is usually used to look for problems in areas that are hard to reach with traditional endoscopy using a tube. This means it is usually used for looking at your bowels (intestine) rather than your oesophagus or stomach.
What are the risks of an upper gastrointestinal endoscopy?
An upper gastrointestinal endoscopy is usually simple and safe. The only problem that most people might have is a sore throat for a few days.
But other problems do sometimes happen. These can include:
-
Pneumonia. Because your throat may be numb and you might not be able to swallow properly, you might breathe saliva (spit) or tiny pieces of food into your lungs after the test. The food or spit that shouldn’t be there can cause an infection. This is called aspiration pneumonia.
During your endoscopy a nurse will protect your airway and lungs by using suction to remove any spit or objects and prevent you swallowing them. You might be told not to eat for an hour after your endoscopy to reduce your chance of breathing in food. If you get pneumonia, you might be given oxygen to help you breathe
-
Bleeding. Bleeding can happen during an endoscopy, especially if you have a biopsy. But this should be easy to stop. If you are taking blood-thinning medicines, you might need to stop taking them a few days before the procedure
-
Infection. There is a very small chance of developing an infection, for example if a biopsy wound gets infected. Tell your doctor if you start to feel unwell or have a fever (high temperature) after an endoscopy.
-
An allergic reaction. Some people are allergic to the sedative medication. It's important to tell your doctor before the procedure if you have any allergies
-
Damage to the bowel. The endoscope can sometimes tear a hole in your oesophagus or stomach. Doctors call this a perforation. It’s very rare, but if it happens you will need surgery to repair the damage.
-
Breathing problems, a fast heartbeat, or chest pain (angina) after the test. These problems are very rare. Most people recover quickly, although some people need extra treatment and oxygen to help them breathe.
What can I expect afterwards?
You shouldn’t be in any pain after an endoscopy. But if you had a sedative you might feel drowsy for an hour or so afterwards.
Sedatives can slow down your reactions, so you won't be able to drive, and you'll need someone to help you get home.
If you didn’t have a sedative, you might only need 15 minutes to 30 minutes to recover. You can then go home or back to work.
If you had a local anaesthetic you won’t be able to eat or drink anything until it wears off. This takes about an hour.
Your doctor might be able to give you the results of the endoscopy before you go home. For example, they will be able to tell you if they clearly saw an ulcer. But if they take samples (a biopsy), you'll have to wait a little longer for the results.
The hospital might then send your results to your usual doctor, or you might need to go to an outpatient clinic.
What did you think about this patient information guide?
Complete the online survey or scan the QR code to help us to ensure our content is of the highest quality and relevant for patients. The survey is anonymous and will take around 5 minutes to complete.

Use of this content is subject to our disclaimer