Objective We characterized patterns of preoperative opioid use in patients undergoing elective surgery to identify the relationship between preoperative use and subsequent opioid fill after surgery. Background Preoperative opioid use is common, and varies by dose, recency, duration, and continuity of fills. To date, there is little evidence to guide postoperative prescribing need based on prior opioid use. Methods We analyzed claims data from Clinformatics DataMart Database for patients aged 18 to 64 years undergoing major and minor surgery between 2008 and 2015. Preoperative use was defined as any opioid prescription filled in the year before surgery. We used cluster analysis to group patients by the dose, recency, duration, and continuity of use. Our primary outcome was second postoperative fill within 30 postoperative days. Our primary explanatory variable was opioid use group. We used logistic regression to examine likelihood of second fill by opioid use group. Results Out of 267,252 patients, 102,748 (38%) filled an opioid prescription in the 12 months before surgery. Cluster analysis yielded 6 groups of preoperative opioid use, ranging from minimal (27.6%) to intermittent (7.7%) to chronic use (2.7%). Preoperative opioid use was the most influential predictor of second fill, with larger effect sizes than other factors even for patients with minimal or intermittent opioid use. Increasing preoperative use was associated with risk-adjusted likelihood of requiring a second opioid fill compared with naive patients [minimal use: odds ratio (OR) 1.49, 95% confidence interval (95% CI) 1.45-1.53; recent intermittent use: OR 6.51, 95% CI 6.16-6.88; high chronic use: OR 60.79, 95% CI 27.81-132.92, all P values Conclusion Preoperative opioid use is common among patients who undergo elective surgery. Although the majority of patients infrequently fill opioids before surgery, even minimal use increases the probability of needing additional postoperative prescriptions in the 30 days after surgery when compared with opioid-naive patients. Going forward, identifying preoperative opioid use can inform surgeon prescribing and care coordination for pain management after surgery.