Endoscopy is a way for a doctor to see inside your body with an endoscope, a thin, bendable tube with a light and a camera at its tip. Most often the word means upper endoscopy, which looks at the esophagus (food pipe), the stomach and the first part of the small intestine. You get medicine to make you sleepy, the test takes about 15 to 30 minutes, and you go home the same day with someone to drive you.
Key points
- Upper endoscopy helps find the cause of heartburn, trouble swallowing, upper belly pain, bleeding and some kinds of anemia.
- During the test, the doctor can take tiny tissue samples, stop bleeding, stretch a narrowed spot or remove something that is stuck.
- Your stomach needs to be empty, so you will have no food for several hours before.
- Tell your doctor about blood thinners, diabetes medicines and weekly shots such as semaglutide or tirzepatide.
- Serious problems, such as a tear or heavy bleeding, are rare.
Kinds of endoscopy
Each type of endoscopy has its own name, based on the part of the body it looks at:
- Upper endoscopy (also called EGD) goes through the mouth to the esophagus, stomach and duodenum (the start of the small intestine).
- Colonoscopy looks at the large intestine (colon) and is used for colon cancer screening.
- Capsule endoscopy uses a camera the size of a large pill that you swallow. It takes pictures of the small intestine as it passes through.
- Bronchoscopy looks at the airways in the lungs. The scope goes in through the nose or mouth and down the windpipe.
- ERCP and endoscopic ultrasound use special scopes to reach the bile ducts and the pancreas.
The rest of this guide is about upper endoscopy.
Why an upper endoscopy is done
- Heartburn that doesn’t improve with medicine, or that has gone on for many years
- Trouble swallowing, or food that feels stuck in the chest
- Pain in the upper belly, or nausea and vomiting that won’t go away
- Throwing up blood, or black, tar-like stools
- Low iron (iron-deficiency anemia) with no clear cause
- Weight loss you can’t explain
- Checking for ulcers, the stomach germ H. pylori, or celiac disease
- Looking for swollen veins in the esophagus in people with scarring of the liver (cirrhosis)
The doctor can also treat problems with tools passed through the scope. They can seal a bleeding ulcer, widen a narrowed esophagus with a small balloon, remove growths (polyps), place bands on swollen veins, or pull out food or an object that is stuck.
Getting ready
- Empty stomach. You will usually have nothing to eat for about 6 to 8 hours before. Clear liquids may be allowed until a couple of hours before. Follow the exact instructions your center gives you.
- Medicines. Most can be taken with a sip of water. Ask ahead of time about blood thinners, insulin and other diabetes medicines.
- Weekly shots for diabetes or weight loss. Medicines such as semaglutide (Ozempic, Wegovy) and tirzepatide (Mounjaro, Zepbound) slow how fast the stomach empties. You may be asked to follow a liquid diet the day before.
- A ride home. The medicine used to make you sleepy affects your judgment for the rest of the day. You can’t drive yourself home.
- Cost. Prices for endoscopy and bronchoscopy vary widely by hospital and insurance plan. Ask your insurer and the billing office for an estimate ahead of time.
During the test
A nurse places a small needle in a vein in your arm (an IV) to give fluids and medicine. Some centers spray the back of your throat with a numbing medicine. You lie on your left side, and a plastic guard goes between your teeth to protect them and the scope.
Most people get sedation. This can be a lighter mix of medicines that makes you relaxed and drowsy, or a deeper medicine called propofol given by an anesthesia team. Many people remember little or nothing of the test.
The doctor guides the scope over your tongue and down your esophagus. It doesn’t block your breathing, because it goes down the food pipe and not the windpipe. A little air or carbon dioxide is puffed in to open up the stomach so the doctor can see. Taking tissue samples doesn’t hurt. The test usually takes 15 to 30 minutes.
Afterward
- You rest in a recovery area for about 30 to 60 minutes while the sleepy medicine wears off.
- A sore throat, bloating and burping are common for a day.
- Most people can eat once they swallow normally. You may get different advice if the doctor stretched your esophagus or removed a growth.
- For the rest of the day, don’t drive, use machines, drink alcohol or sign important papers.
Risks of endoscopy
- Reactions to the sleepy medicine, such as low blood pressure or slow breathing. The team watches your breathing and oxygen the whole time.
- Bleeding, mostly after tissue samples or removing growths
- A tear in the wall of the esophagus or stomach. This is rare and is more likely when a narrowed area is stretched.
- Stomach fluid getting into the lungs, which is why an empty stomach matters
Your results
The doctor usually tells you what they saw before you leave, sometimes with photos. Because the sleepy medicine can blur your memory, it helps to have a family member or friend there to listen. Tissue samples go to a lab, and those results usually take a few days to two weeks.
When to call your doctor
- Fever or chills
- Belly pain that is getting worse
- Black stools, or vomit that looks like blood or coffee grounds
- Trouble swallowing that is worse than before the test
Call 911 for severe chest or belly pain, trouble breathing, or heavy bleeding.
Common questions about endoscopy
What is the difference between endoscopy and bronchoscopy?
Bronchoscopy is one kind of endoscopy. An upper endoscopy goes down the food pipe to look at the esophagus and stomach. A bronchoscopy goes through the nose or mouth into the windpipe to look at the airways and lungs. A lung doctor usually does a bronchoscopy, and a digestive doctor does an upper endoscopy.
Is a bronchoscopy painful?
Most people find it uncomfortable rather than painful. The throat and airways are numbed with spray, and you get medicine to make you sleepy, so you may cough or feel the scope but remember little of it. A sore throat, hoarse voice or cough for a day or two afterward is common.
How do you breathe during an endoscopy?
You breathe normally through your nose and mouth. The scope goes down the food pipe, which sits behind the windpipe, so air still flows to your lungs. A small tube in your nose may give you extra oxygen, and the team watches your breathing and oxygen level the whole time.
Questions to ask your doctor
- Why do I need this test, and what are you looking for?
- Which of my medicines should I stop or change, and when?
- What kind of sedation will I get?
- Will you take samples or treat anything during the test?
- How and when will I get the results?
Learn more
- Upper GI endoscopy (National Institute of Diabetes and Digestive and Kidney Diseases)
- Endoscopy (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.







