Given the basic need for opioids in the perioperative setting, we investigated associations between opioid prescription levels and postoperative outcomes using population-based data of orthopedic surgery patients. We hypothesized that increased opioid amounts would be associated with higher risk for postoperative complications. Data were extracted from the national Premier Perspective database (2006-2013); N = 1,035,578 lower joint arthroplasties and N = 220,953 spine fusions. Multilevel multivariable logistic regression models measured associations between opioid dose prescription and postoperative outcomes, studied by quartile of dispensed opioid dose. Compared to the lowest quartile of opioid dosing, high opioid prescription was associated with significantly increased odds for deep venous thrombosis and postoperative infections by approx. 50%, while odds were increased by 23% for urinary and more than 15% for gastrointestinal and respiratory complications (P < 0.001 respectively). Furthermore, higher opioid prescription was associated with a significant increase in length of stay (LOS) and cost by 12% and 6%, P < 0.001 respectively. Cerebrovascular complications risk was decreased by 25% with higher opioid dose (P = 0.004), while odds for myocardial infarction remained unaltered. In spine cases, opioid prescription was generally higher, with stronger effects observed for increase in LOS and cost as well as gastrointestinal and urinary complications. Other outcomes were less pronounced, possibly because of smaller sample size. Overall, higher opioid prescription was associated with an increase in most postoperative complications with the strongest effect observed in thromboembolic, infectious and gastrointestinal complications, cost, and LOS. Increase in complication risk occurred stepwise, suggesting a dose–response gradient.