U.S. Department of Health and Human Services

 Alternate Versions


 Additional Links


Contact Us

Health Information Center


What is ERCP?

Endoscopic retrograde cholangiopancreatography (ERCP) is a procedure that combines upper gastrointestinal (GI) endoscopy and x-rays to treat problems of the bile and pancreatic ducts.

What are the bile and pancreatic ducts?

Your bile ducts are tubes that carry bile from your liver to your gallbladder and duodenum. Your pancreatic ducts are tubes that carry pancreatic juice from your pancreas to your duodenum. Small pancreatic ducts empty into the main pancreatic duct. Your common bile duct and main pancreatic duct join before emptying into your duodenum.

Illustration of the liver, pancreas, duodenum, gallbladder, and bile ducts, including the common bile duct, pancreatic ducts, and pain pancreatic duct. 

Why do doctors use ERCP?

Doctors use ERCP to treat problems of the bile and pancreatic ducts. Doctors also use ERCP to diagnose problems of the bile and pancreatic ducts if they expect to treat problems during the procedure. For diagnosis alone, doctors may use noninvasive tests—tests that do not physically enter the body—instead of ERCP. Noninvasive tests such as magnetic resonance cholangiopancreatography (MRCP)—a type of magnetic resonance imaging (MRI)—are safer and can also diagnose many problems of the bile and pancreatic ducts.

Doctors perform ERCP when your bile or pancreatic ducts have become narrowed or blocked because of

How do I prepare for ERCP?

To prepare for ERCP, talk with your doctor, arrange for a ride home, and follow your doctor’s instructions.

Talk with your doctor

You should talk with your doctor about any allergies and medical conditions you have and all prescribed and over-the-counter medicines, vitamins, and supplements you take, including

Your doctor may ask you to temporarily stop taking medicines that affect blood clotting or interact with sedatives. You typically receive sedatives during ERCP to help you relax and stay comfortable.

Tell your doctor if you are, or may be, pregnant. If you are pregnant and need ERCP to treat a problem, the doctor performing the procedure may make changes to protect the fetus from x-rays. Research has found that ERCP is generally safe during pregnancy.1

Arrange for a ride home

For safety reasons, you can’t drive for 24 hours after ERCP, as the sedatives or anesthesia used during the procedure needs time to wear off. You will need to make plans for getting a ride home after ERCP.

Don’t eat, drink, smoke, or chew gum

To see your upper GI tract clearly, you doctor will most likely ask you not to eat, drink, smoke, or chew gum during the 8 hours before ERCP.

How do doctors perform ERCP?

Doctors who have specialized training in ERCP perform this procedure at a hospital or an outpatient center. An intravenous (IV) needle will be placed in your arm to provide a sedative. Sedatives help you stay relaxed and comfortable during the procedure. A health care professional will give you a liquid anesthetic to gargle or will spray anesthetic on the back of your throat. The anesthetic numbs your throat and helps prevent gagging during the procedure. The health care staff will monitor your vital signs and keep you as comfortable as possible. In some cases, you may receive general anesthesia.

You’ll be asked to lie on an examination table. The doctor will carefully feed the endoscope down your esophagus, through your stomach, and into your duodenum. A small camera mounted on the endoscope will send a video image to a monitor. The endoscope pumps air into your stomach and duodenum, making them easier to see.

During ERCP, the doctor

  • locates the opening where the bile and pancreatic ducts empty into the duodenum
  • slides a thin, flexible tube called a catheter through the endoscope and into the ducts
  • injects a special dye, also called contrast medium, into the ducts through the catheter to make the ducts more visible on x-rays
  • uses a type of x-ray imaging, called fluoroscopy, to examine the ducts and look for narrowed areas or blockages

The doctor may pass tiny tools through the endoscope to

  • open blocked or narrowed ducts.
  • break up or remove stones.
  • perform a biopsy or remove tumors in the ducts.
  • insert stents—tiny tubes that a doctor leaves in narrowed ducts to hold them open. A doctor may also insert temporary stents to stop bile leaks that can occur after gallbladder surgery.

The procedure most often takes between 1 and 2 hours.

What should I expect after ERCP?

After ERCP, you can expect the following:

  • You will most often stay at the hospital or outpatient center for 1 to 2 hours after the procedure so the sedation or anesthesia can wear off. In some cases, you may need to stay overnight in the hospital after ERCP.
  • You may have bloating or nausea for a short time after the procedure.
  • You may have a sore throat for 1 to 2 days.
  • You can go back to a normal diet once your swallowing has returned to normal.
  • You should rest at home for the remainder of the day.

Following the procedure, you—or a friend or family member who is with you if you’re still groggy—will receive instructions on how to care for yourself after the procedure. You should follow all instructions.

A doctor talking with a patient.
You will receive instructions on how to care for yourself after ERCP. You should
follow all instructions.

Some results from ERCP are available right away after the procedure. After the sedative has worn off, the doctor will share results with you or, if you choose, with your friend or family member.

If the doctor performed a biopsy, a pathologist will examine the biopsy tissue. Biopsy results take a few days or longer to come back.

What are the risks of ERCP?

The risks of ERCP include complications such as the following:

  • pancreatitis
  • infection of the bile ducts or gallbladder
  • excessive bleeding, called hemorrhage
  • an abnormal reaction to the sedative, including respiratory or cardiac problems
  • perforation in the bile or pancreatic ducts, or in the duodenum near the opening where the bile and pancreatic ducts empty into it
  • tissue damage from x-ray exposure
  • death, although this complication is rare

Research has found that these complications occur in about 5 to 10 percent of ERCP procedures.2 People with complications often need treatment at a hospital.

Seek care right away

If you have any of the following symptoms after ERCP, seek medical attention right away:

  • bloody or black, tar-colored stool
  • chest pain
  • fever
  • pain in your abdomen that gets worse
  • problems breathing
  • problems swallowing or throat pain that gets worse
  • vomiting—particularly if your vomit is bloody or looks like coffee grounds

1ASGE Standard of Practice Committee, Shergill AK, Ben-Menachem T, et al. Guidelines for endoscopy in pregnant and lactating women. Gastrointestinal Endoscopy. 2012;76(1):18–24.

2Szary NM, Al-Kawas FH. Complications of endoscopic retrograde cholangiopancreatography: how to avoid and manage them. Gastroenterology and Hepatology. 2013;9(8):496–504.

This content is provided as a service of the National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK), part of the National Institutes of Health. The NIDDK translates and disseminates research findings through its clearinghouses and education programs to increase knowledge and understanding about health and disease among patients, health professionals, and the public. Content produced by the NIDDK is carefully reviewed by NIDDK scientists and other experts.

The NIDDK would like to thank:
Christopher E. Forsmark, M.D., University of Florida College of Medicine

This information is not copyrighted. The NIDDK encourages people to share this content freely.

July 2016