ImportanceUse of buprenorphine or methadone to treat opioid use disorder is recommended in pregnancy; however, their teratogenic potential is largely unknown.ObjectiveTo compare the risk of congenital malformations following in utero exposure to buprenorphine vs methadone.Design, Setting, and ParticipantsThis population-based cohort study used health care utilization data from publicly insured Medicaid beneficiaries in the US from 2000 to 2018. A total of 13 360 pregnancies with enrollment from 90 days prior to pregnancy start through 1 month after delivery and first trimester use of buprenorphine or methadone were included and linked to infants. Data were analyzed from July to December 2022.ExposureA pharmacy dispensing of buprenorphine or a code for administration of methadone in the first trimester.Main Outcomes and MeasuresPrimary outcomes included major malformations overall and malformations previously associated with opioids (any cardiac malformations, ventricular septal defect, secundum atrial septal defect/nonprematurity-related patent foramen ovale, neural tube defects, clubfoot, and oral clefts). Secondary outcomes included other organ system–specific malformations. Risk differences and risk ratios (RRs) were estimated comparing buprenorphine with methadone, adjusting for confounders with propensity score overlap weights.ResultsThe cohort included 9514 pregnancies with first-trimester buprenorphine exposure (mean [SD] maternal age, 28.4 [4.6] years) and 3846 with methadone exposure (mean [SD] maternal age, 28.8 [4.7] years). The risk of malformations overall was 50.9 (95% CI, 46.5-55.3) per 1000 pregnancies for buprenorphine and 60.6 (95% CI, 53.0-68.1) per 1000 pregnancies for methadone. After confounding adjustment, buprenorphine was associated with a lower risk of malformations compared with methadone (RR, 0.82; 95% CI, 0.69-0.97). Risk was lower with buprenorphine for cardiac malformations (RR, 0.63; 95% CI, 0.47-0.85), including both ventricular septal defect (RR, 0.62; 95% CI, 0.39-0.98) and secundum atrial septal defect/nonprematurity-related patent foramen ovale (RR, 0.54; 95% CI, 0.30-0.97), oral clefts (RR, 0.65; 95% CI, 0.35-1.19), and clubfoot (RR, 0.55; 95% CI, 0.32-0.94). Results for neural tube defects were uncertain given low event counts. In secondary analyses, buprenorphine was associated with a decreased risk of central nervous system, urinary, and limb malformations but a greater risk of gastrointestinal malformations compared with methadone. These findings were consistent in sensitivity and bias analyses.Conclusions and RelevanceIn this cohort study, the risk of most malformations previously associated with opioid exposure was lower in buprenorphine-exposed infants compared with methadone-exposed infants, independent of measured confounders. Malformation risk is one factor that informs the individualized patient decision regarding medications for opioid use disorder in pregnancy.