Analgesics that contain codeine are commonly prescribed for postoperative pain, but it is unclear how they compare with nonopioid alternatives. We sought to compare the effectiveness of codeine and nonsteroidal anti-inflammatory drugs (NSAIDs) for adults who underwent outpatient surgery.