Study aims The goal of our study was to determine the current trends for inpatient utilization for endoscopic retrograde cholangiopancreatography (ERCP) and its economic impact in the United States between 2002 and 2013. Patients and methods A Nationwide Inpatient Sample from 2002 through 2013 was examined. We identified ERCPs using International Classification of Diseases (ICD-9) codes; Procedure codes 51.10, 51.11, 52.13, 51.14, 51.15, 52.14 and 52.92 for diagnostic and 51.84, 51.86, 52.97 were studied. Rate of inpatient ERCP was calculated. The trends for therapeutic ERCPs were compared to the diagnostic ones. We analyzed patient and hospital characteristics, length of hospital stay, and cost of care after adjusting for weighted samples. We used the Cochran-Armitage test for categorical variables and linear regression for continuous variables. Results A total of 411,409 ERCPs were performed from 2002 to 2013. The mean age was 59 ± 19 years; 61 % were female and 57 % were white. The total numbers of ERCPS increased by 12 % from 2002 to 2011, which was followed by a 10 % decrease in the number of ERCPs between 2011 and 2013. There was a significant increase in therapeutic ERCPs by 37 %, and a decrease in diagnostic ERCPs by 57 % from 2002 to 2013. Mean length of stay was 7 days (SE = 0.01) and the mean cost of hospitalization was $20,022 (SE = 41). Conclusions Our large cross-sectional study shows a significant shift in ERCPs towards therapeutic indications and a decline in its conventional diagnostic utility. Overall there has been a reduction in inpatient ERCPs.