Determine the accuracy of diagnostic codes in identifying Prenatal Opioid Exposure (POE) and Neonatal Opioid Withdrawal Syndrome (NOWS). A cross-sectional study of 374,222 mother-infant dyads with delivery from 01/01/2010 to 12/31/2019. We ascertained maternal diagnostic codes for opioid use during pregnancy and infant diagnostic codes for drug exposure and withdrawal. We assessed sensitivity and positive predictive value (PPV) for POE and NOWS, defined using laboratory, pharmacy, and clinical data. Maternal codes had low sensitivity (36.4%) and PPV (34.7%) for POE. Infant codes for drug exposure were neither sensitive for POE (14%) nor NOWS (31.6%) and had low PPV. Codes for newborn withdrawal had low sensitivity (31.6%) for detecting NOWS, but high PPV (85%). Sensitivity improved (95.1%) for NOWS requiring pharmacologic treatment. Diagnostic codes identify POE and NOWS poorly. Improved case identification would include pharmacy and laboratory results, and clearly defined criteria for evidence of withdrawal.