A gastroscopy is a procedure where a thin, flexible tube called an endoscope is used to look inside the oesophagus (gullet), stomach and first part of the small intestine (duodenum).

It's also sometimes referred to as an upper gastrointestinal endoscopy.

The endoscope has a light and a camera at one end. The camera sends images of the inside of your oesophagus, stomach and duodenum to a monitor.

Why a gastroscopy may be used

A gastroscopy can be used to:

  • investigate problems such as dysphagia (swallowing problems) or persistent stomach ache
  • diagnose conditions such as stomach ulcers or gastro-oesophageal reflux disease (GORD) which is when you keep getting heartburn and acid reflux
  • treat conditions such as bleeding ulcers, a blockage in the oesophagus, non-cancerous growths (polyps) or small cancerous tumours

A gastroscopy used to check symptoms or confirm a diagnosis is known as a diagnostic gastroscopy. A gastroscopy used to treat a condition is known as a therapeutic gastroscopy.

The gastroscopy procedure

A gastroscopy often takes less than 15 minutes, although it may take longer if it's being used to treat a condition.

It's usually carried out as an outpatient procedure, which means you will not have to spend the night in hospital.

Before the procedure, your throat will be numbed with a local anaesthetic spray. You can also choose to have a sedative, if you prefer. This means you will still be awake, but will be drowsy and have reduced awareness about what's happening.

The doctor carrying out the procedure will place the endoscope in the back of your mouth and ask you to swallow the first part of the tube. It will then be guided down your oesophagus and into your stomach.

The procedure is not usually painful, but it may be unpleasant or uncomfortable at times.

What are the risks?

A gastroscopy is a very safe procedure, but like all medical procedures it does carry a risk of complications.

Possible complications that can occur include:

  • a reaction to the sedative, which can cause problems with your breathing, heart rate and blood pressure
  • internal bleeding
  • tearing (perforation) of the lining of your oesophagus, stomach or duodenum

Why should it be done?

A gastroscopy can be used to check symptoms or confirm a diagnosis, or it can be used to treat a condition.

Checking symptoms

A gastroscopy may be recommended if you have symptoms that suggest a problem with your stomach, oesophagus (gullet), or the first section of your small intestine (duodenum).

Problems that are sometimes investigated using a gastroscopy include:

  • abdominal (tummy) pain or stomach ache
  • heartburn or indigestion
  • persistently feeling and being sick
  • difficulties swallowing or pain when swallowing (dysphagia)
  • a reduced number of red blood cells (iron deficiency anaemia), which may be caused by persistent internal bleeding
  • severe bleeding, which may have caused a sudden, sharp pain in your abdomen, vomiting blood or very dark or "tar-like" poo

Diagnosing conditions

A gastroscopy is also used to help confirm (or rule out) suspected conditions, such as:

  • stomach ulcers (sometimes know as peptic ulcers) – open sores that develop on the lining of the stomach and small intestine
  • gastro-oesophageal reflux disease (GORD) – heartburn, where stomach acid keeps leaking back up into the oesophagus
  • coeliac disease – a common digestive condition, where a person has an adverse reaction to gluten in food
  • Barrett's oesophagus – abnormal cells on the lining of the oesophagus
  • portal hypertension – where the blood pressure inside the liver is abnormally high, causing swollen veins (varices) to develop on the lining of the stomach and oesophagus
  • stomach cancer and oesophageal cancer

As well as examining the oesophagus, stomach and duodenum, the endoscope (a thin, flexible tube that's passed down your throat) can be used to remove small samples of tissue for testing. This is known as a biopsy.

Treating conditions

A gastroscopy can also be carried out to treat some problems affecting the oesophagus, stomach and duodenum.

For example, a gastroscopy can be used to:

  • stop bleeding inside the stomach or oesophagus, such as bleeding caused by a stomach ulcer or enlarged veins (varices)
  • widen a narrowed oesophagus that's causing pain or swallowing difficulties – this can be caused by GORD, oesophageal cancer, or radiotherapy to the oesophagus
  • remove cancerous tumours, non-cancerous growths (polyps) or foreign objects
  • provide nutrients – a gastroscopy can help doctors guide a feeding tube into the stomach, when a person is unable to eat in the normal way

How is it performed?

Instructions about how to prepare for a gastroscopy should be included with your appointment letter.

Phone the hospital if there's anything you're unsure about.

Preparing for a gastroscopy

If you're referred for a gastroscopy, you'll be told whether you need to stop taking any of your medicines beforehand.

You may need to stop taking any prescribed medicines for indigestion for up to 2 weeks before the procedure. This is because the medicine can mask some of the problems that a gastroscopy could find.

If you're taking any of the following medicines, you should phone the endoscopy unit before your appointment because special arrangements may need to be made:

  • any medicine that's used to treat diabetes, such as insulin or metformin
  • blood-thinning medicine (used to prevent blood clots), such as low-dose aspirin, warfarin or clopidogrel

It's important that your stomach is empty during a gastroscopy, so that the whole area can be seen clearly. You'll usually be asked not to eat or drink anything for 6 to 8 hours before the procedure. Follow the instructions given to you by the hospital.

The procedure

A gastroscopy often takes less than 15 minutes, although it may take longer if it's being used to treat a condition.

The procedure will usually be carried out by an endoscopist (a healthcare professional who specialises in performing endoscopies) and assisted by a nurse. You'll meet the nurse before the procedure and they'll be able to answer any questions you have and you’ll also have an opportunity to ask the endoscopist.

The procedure is not usually painful, but it may be unpleasant or uncomfortable at times. A local anaesthetic spray will be used to numb your throat for the procedure and you'll be asked beforehand if you'd like to have a sedative injection. Young children may have the procedure under general anaesthetic, which means they'll be asleep while it's carried out.

If you have the sedative, it will help you feel drowsy and relaxed during the procedure, but you'll need to stay in hospital for a bit longer while you recover, and you'll need someone to pick you up from the hospital and stay with you for at least 24 hours. You will not be able to work or drive during this period (see below).

Before the procedure starts, you'll be asked to remove any glasses, contact lenses, tongue studs or false teeth. (Talk to the hospital if you're worried about this). You will not usually need to get undressed, but you may be asked to wear a hospital gown over your clothes.

The local anaesthetic spray is then given and a small plastic mouth guard placed in your mouth, to hold it open and protect your teeth.

You'll be asked to lie down on your left-hand side and the endoscopist will insert the endoscope into your throat. They'll ask you to swallow it to help move it down into your oesophagus. This may be uncomfortable at first and you may feel sick or gag, but this should pass as the endoscope is moved further down.

Diagnosing a condition

If the gastroscopy is being used to diagnose a certain condition, air will be blown into your stomach once the endoscope is inside. This allows the endoscopist to see any unusual redness, holes, lumps, blockages or other abnormalities.

It may feel a bit uncomfortable when the air is blown into your stomach, and you may burp or feel bloated. This should start to improve once the procedure is finished.

If abnormalities are detected, a tissue sample (biopsy) can be removed and sent to a laboratory for closer examination under a microscope.

Treating bleeding varices

If you have bleeding varices (enlarged veins), the endoscopist will use the endoscope to locate the site of the bleeding.

They can then stop the bleeding by either tying the base of the varices with a small rubber band (band ligation), or injecting them with a chemical that seals the hole or tear in the blood vessel (sclerotherapy).

Treating bleeding stomach ulcers

If you have bleeding stomach ulcers, a number of techniques may be used to treat them. For example:

  • a probe may be passed through the endoscope to seal the ulcer with heat, or small clips may be used to stop the bleeding
  • medicine may be injected around the ulcer to activate the clotting process

During the procedure, you may also receive an injection of an acid-reducing medicine called a proton-pump inhibitor (PPI) to stop the bleeding recurring.

Widening the oesophagus

If you have a narrowed oesophagus, the endoscopist can pass instruments down the endoscope to help stretch and widen it.

The instruments can also be used to insert a balloon or stent (a hollow plastic or metal tube) to hold the sides of your oesophagus open.


After the procedure, you'll be taken to the recovery area.

If you didn't have a sedative, you can usually go home soon after the procedure is finished.

If you had a sedative, you'll need to rest quietly for a few minutes or hours until the sedative has worn off. You'll also need to arrange for someone to take you home and to stay with you for at least 24 hours.

Even if you feel very alert, the sedative can stay in your blood for 24 hours and you may experience further episodes of drowsiness. 

During this time, you should not:

  • drive
  • operate heavy machinery
  • drink alcohol
  • take sleeping tablets
  • go to work
  • sign any contracts or legal documents
  • be responsible for small children or dependents

Before you're discharged, the nurse or doctor may be able to explain the results of the procedure to you. Sometimes, you may need to have an appointment with the doctor or your GP a few days or weeks later to discuss the results.

You'll be told if you need to make any changes to your diet during the hours or days after going home.

When to seek medical advice

It's normal to feel bloated or have a sore throat for a day or 2 after a gastroscopy.

You should contact your GP or the endoscopy unit immediately if you develop signs of a more serious problem, such as:

  • severe or worsening chest pain or stomach ache
  • passing dark or "tar-like" poo
  • persistent vomiting or vomiting blood
  • shortness of breath
  • a high temperature of 38C or above


A gastroscopy is a very safe procedure and the risks of serious complications are small.

Some of the possible complications of a gastroscopy include:

  • reaction to the sedation
  • bleeding
  • perforation (tearing)

These are described below.


Sedation is usually safe, but it can occasionally cause problems, such as:

  • feeling or being sick
  • a burning sensation at the site of the injection
  • small particles of food falling into the lungs and triggering an infection (aspiration pneumonia)
  • an irregular heartbeat
  • breathing difficulties

Very rarely, complications from sedation can result in a stroke or heart attack.


Sometimes, during a gastroscopy, the endoscope can accidentally damage a blood vessel, causing it to bleed. However, significant bleeding is very rare.

Signs of bleeding can include vomiting blood and passing black or "tar-like" poo.

The site of the bleeding can usually be repaired during a further gastroscopy. A blood transfusion may also be required to replace lost blood.


During a gastroscopy, there's a very small risk of the endoscope tearing the lining of your oesophagus, stomach or the first section of your small intestine (duodenum). This is known as perforation.

Signs of perforation can include:

  • neck, chest or stomach pain
  • pain when swallowing
  • a high temperature of 38C or above
  • breathing difficulties

If the perforation isn't severe, it can usually be left to heal by itself. You may be given antibiotics to prevent an infection occurring at the site of the tear. Surgery may be needed to repair more serious perforations.

The information on this page has been adapted by NHS Wales from original content supplied by NHS UK NHS website
Last Updated: 16/03/2022 13:53:11