An upper endoscopy is a test that lets a doctor look inside your esophagus (food pipe), stomach and the first part of the small intestine (duodenum) with a thin, flexible tube that has a camera on the end. Its full name is esophagogastroduodenoscopy, or EGD. The scope goes in through your mouth, and medicine helps you relax or sleep, so most people remember little of it. The exam itself usually takes 10 to 30 minutes.
Key points
- Doctors use it to find the cause of heartburn, trouble swallowing, upper belly pain, bleeding and other problems.
- The doctor can take small tissue samples (biopsies) and treat some problems during the same exam.
- Your stomach must be empty, so you’ll stop eating about 6 to 8 hours beforehand.
- You’ll need an adult to drive you home after sedation.
- Serious problems are rare. A sore throat and bloating for a day are common.
Why an upper endoscopy is done
Common reasons include:
- Heartburn or reflux (GERD) that doesn’t improve with medicine, or that has lasted many years
- Trouble swallowing, pain when swallowing, or food that feels stuck
- Ongoing pain in the upper belly, nausea or vomiting
- Vomiting blood, or black, tarry stools
- A low blood count from iron loss, or weight loss without trying
- Checking for celiac disease, ulcers, an H. pylori stomach infection, or allergy-related inflammation of the esophagus (eosinophilic esophagitis)
- Watching for changes in Barrett’s esophagus, or for swollen veins (varices) in people with liver cirrhosis
During the exam, the doctor can also stop bleeding, stretch a narrowed esophagus, remove polyps, remove a swallowed object or a piece of stuck food, band swollen veins, or place a feeding tube.
How to prepare for an upper endoscopy
- Fasting. Usually no food for 6 to 8 hours before. Many clinics allow clear liquids, such as water, up to 2 hours before. Follow your clinic’s exact instructions, because food in the stomach can be inhaled into the lungs during sedation.
- Medicines. Tell your doctor about all your medicines. Blood thinners, insulin and other diabetes medicines may need changes. If you use weekly shots such as semaglutide or tirzepatide, ask what to do, since they slow stomach emptying. You may need a clear liquid diet the day before. Don’t stop any medicine unless told to.
- A ride. Arrange for an adult to drive you home and, ideally, stay with you for a few hours.
- On the day. Wear comfortable clothes and leave jewelry at home. You’ll remove dentures and glasses before the exam.
During the test
A nurse places a small tube (IV) in your arm and attaches monitors to track your pulse, blood pressure and oxygen. You lie on your left side. Your throat may be numbed with a spray that tastes bitter, and a plastic mouth guard protects your teeth and the scope.
Medicine through the IV makes you drowsy or puts you into a light sleep. Many centers use a sedative called propofol, given by an anesthesia team. The doctor, usually a gastroenterologist, passes the scope through the mouth and down into the stomach. Air or carbon dioxide gently opens the space so the doctor can see. You can breathe normally around the scope. If you’re awake, you may feel pressure, gagging or bloating. Taking a biopsy doesn’t hurt.
After an upper endoscopy
- You’ll rest for 30 to 60 minutes while the sedation wears off.
- Your throat may be sore or scratchy for a day or two. Throat lozenges and cool drinks help.
- Bloating, burping and passing gas are normal.
- Start with liquids and light food once you can swallow normally, unless your doctor gives other advice.
- Don’t drive, work, drink alcohol or make big decisions until the next day.
Possible risks
An upper endoscopy is a common, low-risk test. Possible problems include:
- A reaction to the sedation, such as low blood pressure or slowed breathing
- Bleeding, usually after a biopsy, polyp removal or stretching
- A tear in the esophagus or stomach wall (perforation). This happens in fewer than 1 in 1,000 standard exams, and more often when a narrowing is stretched.
- Breathing stomach contents into the lungs (aspiration)
Your results
The doctor usually tells you what they saw before you go home. Since you may not remember the talk, bring someone with you or ask for a written report. Biopsy results take a few days to 2 weeks. Common findings include an inflamed esophagus or stomach lining, ulcers, a hiatal hernia, Barrett’s esophagus or celiac disease. Your doctor will explain whether you need medicine, more tests or a repeat endoscopy.
When to call your doctor
- Fever or chills
- Throat, chest or belly pain that gets worse instead of better
- Trouble swallowing that is worse than before the test
- Nausea or vomiting that doesn’t stop
Call 911 for severe chest or belly pain, vomiting blood, passing large amounts of black or bloody stool, or trouble breathing.
Common questions about upper endoscopy
Will I be asleep during an upper endoscopy?
Most people in the US are sedated, ranging from very drowsy to fully asleep. You breathe on your own and usually remember little afterward. Some people choose only a numbing throat spray so they can drive themselves home. Ask your doctor which option suits you.
Does an upper endoscopy hurt?
No, it shouldn’t hurt. With sedation, most people feel nothing during the exam. Afterward you may have a mild sore throat, bloating or cramps from the air used to open the stomach, which pass within a day. Biopsies are painless because the lining has no pain nerves.
What is the difference between an upper endoscopy and a colonoscopy?
An upper endoscopy goes through the mouth to look at the esophagus, stomach and duodenum. A colonoscopy goes through the anus to look at the large intestine. An upper endoscopy needs only fasting, while a colonoscopy needs a laxative prep. Some people have both on the same day.
Questions to ask your doctor
- Why do I need an upper endoscopy?
- Should I change any of my medicines before the test?
- What kind of sedation will I get?
- Will you take biopsies, and when will I get the results?
- Do I need a repeat exam, and when?
Learn more
- Upper GI endoscopy (National Institute of Diabetes and Digestive and Kidney Diseases)
- EGD (esophagogastroduodenoscopy) (MedlinePlus, U.S. National Library of Medicine)
This guide is general information and doesn’t replace advice from your own doctor. Last updated October 2026.




