Digestive health

ERCP explained: why it is done, how to prepare and recovery

Written byWM Health Editorial Team

7 min read

Medically reviewed byProf. Dr. K. ÖzdilGastroenterology

Key takeaways

  • ERCP combines an endoscopy through the mouth with X-ray imaging to examine and treat the bile and pancreatic ducts.
  • It is mainly used when a problem such as a stuck gallstone or a narrowed duct is expected to be treated during the same procedure.
  • Less invasive scans, such as ultrasound, MRI or MRCP, are usually done first to clarify the diagnosis.
  • Preparation involves an empty stomach, a full review of your medicines and someone to take you home after sedation.
  • Bloating and a sore throat are common afterwards; severe pain, fever, vomiting or black stools need urgent medical care.

Endoscopic retrograde cholangiopancreatography, usually shortened to ERCP, is a procedure that allows a specialist to look at and treat the bile ducts and the pancreatic duct from the inside. It combines an endoscopy, in which a thin, flexible tube with a camera is passed through the mouth, with X-ray imaging. Many people are offered ERCP because a gallstone or a narrowing is blocking the flow of bile, which can lead to pain, jaundice or infection. This guide explains why ERCP may be suggested, how to get ready for it, what happens on the day and what recovery usually involves.

What the bile and pancreatic ducts do

Bile is a digestive fluid produced by the liver and stored in the gallbladder. It travels through a network of small tubes, the bile ducts, into the duodenum, which is the first part of the small intestine. The pancreas releases its own digestive juices through the pancreatic duct, and both ducts drain into the duodenum close to one another.

When one of these ducts becomes blocked, narrowed or starts to leak, fluid can back up. A blockage in the bile duct can cause jaundice: yellowing of the skin or the whites of the eyes, sometimes with itchy skin, darker urine and paler stools. Yellowing can be harder to notice on brown or black skin, although the whites of the eyes usually still look yellow. Jaundice should always be assessed promptly by a doctor, because it can be a sign of a condition that needs treatment.

ERCP is used mainly to treat problems in the bile and pancreatic ducts when they are leaking, narrowed or blocked. Common reasons include:

  • a gallstone that has moved out of the gallbladder and become stuck in the common bile duct;
  • a narrowed section of duct that needs to be widened or drained;
  • infection linked to a blocked duct;
  • some cases of acute pancreatitis;
  • a growth in the bile ducts or pancreas, where a blockage needs relieving or tissue samples are needed.

Because ERCP is an invasive procedure, doctors usually use other tests first to work out what is happening. These may include an ultrasound scan, a CT scan, an MRI, a specialised MRI of the ducts called MRCP, or endoscopic ultrasound. These tests can diagnose many problems with less risk. ERCP tends to be chosen when the team expects to treat the problem during the same procedure, rather than purely to look.

What can be done during ERCP

Once the endoscope is in position, the specialist can pass small instruments through it. Depending on what the images show, this may allow them to:

  • remove gallstones from the bile duct, or crush them into smaller pieces;
  • widen the opening of the bile duct so that stones can pass through;
  • open up narrowed ducts or drain areas that are blocked;
  • take small tissue samples (biopsies) for laboratory testing.

Your specialist will explain in advance which of these steps are planned for you and which might become necessary depending on what is found. If you have gallstones in your gallbladder as well as in the bile duct, ask how this will be managed in the longer term.

How to prepare for ERCP

Preparation is usually simple, but following your care team's instructions closely matters, because it helps keep the procedure safe and gives the specialist a clear view.

Share your full medical history

Tell your team about your health conditions, any allergies and every medicine or supplement you take. It is especially important to mention blood thinners, aspirin and other anti-inflammatory painkillers, as well as medicines for diabetes, blood pressure or arthritis, because some may need adjusting for a short time. Never pause a prescribed medicine on your own; wait for specific advice from your team. Let them know if you have ever reacted to iodine or to the contrast dye used for X-rays, and if you are or might be pregnant.

Eating and drinking

Your stomach needs to be empty for the procedure. You will be asked not to eat or drink for a number of hours beforehand. Hospitals give slightly different instructions, so follow the timings you are given.

Plan your journey home

ERCP is carried out under sedation, and occasionally under a general anaesthetic. These medicines take time to wear off, so arrange for someone to take you home. You should not drive yourself afterwards. It also helps to leave jewellery and valuables at home.

What happens on the day

ERCP takes place in a hospital or an outpatient centre and is performed by a specialist trained in the technique. The team will explain the procedure and its risks and ask you to sign a consent form. A small plastic tube (cannula) is placed in a vein in your hand or arm so that sedation and other medicines can be given. A spray or gargle may be used to numb the back of your throat.

You will usually lie on your front or on your left side. The specialist passes the endoscope through your mouth, down the oesophagus and through the stomach into the duodenum. A little air is used to open the area so that the lining can be seen clearly. A thin tube called a catheter is then guided into the bile duct or pancreatic duct, and a contrast dye is injected. Real-time X-ray imaging, known as fluoroscopy, shows the outline of the ducts and highlights any narrowing or blockage. If treatment is needed, it is normally carried out at this stage using instruments passed through the endoscope.

Recovery after ERCP

After the procedure you will rest in a recovery area while the sedation wears off. Many people stay for a few hours, while others are kept in overnight for observation, depending on what was done and how they feel. Your team will tell you when it is safe to drink and eat again; some people begin with clear fluids before returning to solid food.

It is common to feel bloated or a little nauseous for a short time, and your throat may be sore for a few days. Keep your activity light, avoid heavy lifting for as long as your team advises, and ask which pain relief is suitable, because some common painkillers may not be recommended straight after the procedure.

Some findings may be shared with you once the sedation has worn off. If tissue samples were taken, the results take longer, often several days or more, and your team will explain how they will reach you.

Possible risks and warning signs

ERCP is a well-established procedure, but like any treatment it carries some risks. Your specialist will discuss these in relation to your own situation. Possible complications include:

  • inflammation of the pancreas (pancreatitis), which can be serious;
  • infection of the bile ducts or gallbladder;
  • bleeding;
  • a tear (perforation) in a duct or in the wall of the duodenum;
  • a reaction to the sedation, the contrast dye or other medicines, including breathing or heart problems.

Seek urgent medical care, or contact emergency services, if after ERCP you develop:

  • severe or worsening pain in your abdomen or chest;
  • a fever or chills;
  • vomiting, especially if it contains blood or looks like coffee grounds;
  • black, tarry stools or bleeding from the bottom;
  • difficulty breathing, or swallowing problems or throat pain that are getting worse.

Questions to ask your specialist

Feeling well informed can make the day less stressful. Before ERCP, you may find it useful to ask:

  • What is the main aim in my case: removing stones, relieving a blockage or taking samples?
  • Which scans have already been done, and what did they show?
  • Which of my medicines should I continue, and should any be paused?
  • Will I have sedation or a general anaesthetic, and should I plan for an overnight stay?
  • How and when will I receive the results?
  • Will I need any further treatment afterwards, for example for my gallbladder?

Next steps

If you have been told you may need ERCP, or you have symptoms such as jaundice or pain linked to gallstones, a gastroenterologist can review your scans and explain your options in detail. Read more about our gastroenterology care, or use Find my physician to be matched with a specialist who can look at your case.

Frequently asked questions

References

  1. Endoscopic Retrograde Cholangiopancreatography (ERCP)(opens in a new tab)National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK) · Accessed November 1, 2026
  2. ERCP: MedlinePlus Medical Encyclopedia(opens in a new tab)MedlinePlus (U.S. National Library of Medicine) · Accessed November 1, 2026
  3. Treatment for Gallstones(opens in a new tab)National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK) · Accessed November 1, 2026
  4. Gallstones(opens in a new tab)NHS · Accessed November 1, 2026
  5. Jaundice(opens in a new tab)NHS · Accessed November 1, 2026

This article is for general information and is not a substitute for a medical consultation.

Share this article

Digestive health

Crohn's disease and ulcerative colitis: diagnosis and long-term care

Crohn's disease and ulcerative colitis are long-term inflammatory bowel conditions. Learn how they differ, how they are diagnosed and how treatment and self-care keep them under control.

Reviewed by Prof. Dr. K. Özdil

7 min read

Digestive health

Bloating and IBS: understanding long-lasting digestive symptoms

Bloating, cramps, diarrhoea and constipation that keep coming back are often due to irritable bowel syndrome. Learn how IBS is recognised, which signs need checking and what helps.

Reviewed by Prof. Dr. K. Özdil

7 min read

Digestive health

Gallstones: symptoms, tests and treatment options

Many gallstones never cause trouble, but a blocked bile duct can bring sudden pain. Learn the symptoms, the warning signs, how gallstones are found and the treatment choices.

Reviewed by Prof. Dr. K. Özdil

7 min read