Opioid dependence is associated with substantial health and social burdens, and opioid agonist treatment (OAT) is highly effective in improving multiple outcomes for people who receive this treatment. Methadone and buprenorphine are common medications provided as OAT. We aimed to examine buprenorphine compared with methadone in the treatment of opioid dependence across a wide range of primary and secondary outcomes. We did a systematic review and meta-analysis in accordance with GATHER and PRISMA guidelines. We searched Embase, MEDLINE, CENTRAL, and PsycINFO from database inception to Aug 1, 2022; clinical trial registries and previous relevant Cochrane reviews were also reviewed. We included all RCTs and observational studies of adults (aged ≥18 years) with opioid dependence comparing treatment with buprenorphine or methadone. Primary outcomes were retention in treatment at 1, 3, 6, 12, and 24 months, treatment adherence (measured through doses taken as prescribed, dosing visits attended, and biological measures), or extra-medical opioid use (measured by urinalysis and self-report). Secondary outcomes were use of benzodiazepines, cannabis, cocaine, amphetamines, and alcohol; withdrawal; craving; criminal activity and engagement with the criminal justice system; overdose; mental and physical health; sleep; pain; global functioning; suicidality and self-harm; and adverse events. Single-arm cohort studies and RCTs that collected data on buprenorphine retention alone were also reviewed. Data on study, participant, and treatment characteristics were extracted. Study authors were contacted to obtain additional data when required. Comparative estimates were pooled with use of random-effects meta-analyses. The proportion of individuals retained in treatment across multiple timepoints was pooled for each drug. This study is registered with PROSPERO (CRD42020205109). We identified 32 eligible RCTs (N=5808 participants) and 69 observational studies (N=323 340) comparing buprenorphine and methadone, in addition to 51 RCTs (N=11 644) and 124 observational studies (N=700 035) that reported on treatment retention with buprenorphine. Overall, 61 studies were done in western Europe, 162 in North America, 14 in north Africa and the Middle East, 20 in Australasia, five in southeast Asia, seven in south Asia, two in eastern Europe, three in central Europe, one in east Asia, and one in central Asia. 1 040 827 participants were included in these primary studies; however, gender was only reported for 572 111 participants, of whom 377 991 (66·1%) were male and 194 120 (33·9%) were female. Mean age was 37·1 years (SD 6·0). At timepoints beyond 1 month, retention was better for methadone than for buprenorphine: for example, at 6 months, the pooled effect favoured methadone in RCTs (risk ratio 0·76 [95% CI 0·67-0·85]; I·=74·2%; 16 studies, N=3151) and in observational studies (0·77 [0·68-0·86]; I·=98·5%; 21 studies, N=155 111). Retention was generally higher in RCTs than observational studies. There was no evidence suggesting that adherence to treatment differed with buprenorphine compared with methadone. There was some evidence that extra-medical opioid use was lower in those receiving buprenorphine in RCTs that measured this outcome by urinalysis and reported proportion of positive urine samples (over various time frames; standardised mean difference -0·20 [-0·29 to -0·11]; I·=0·0%; three studies, N=841), but no differences were found when using other measures. Some statistically significant differences were found between buprenorphine and methadone among secondary outcomes. There was evidence of reduced cocaine use, cravings, anxiety, and cardiac dysfunction, as well as increased treatment satisfaction among people receiving buprenorphine compared with methadone; and evidence of reduced hospitalisation and alcohol use in people receiving methadone. These differences in secondary outcomes were based on small numbers of studies (maximum five), and were often not consistent across study types or different measures of the same constructs (eg, cocaine use). Evidence from trials and observational studies suggest that treatment retention is better for methadone than for sublingual buprenorphine. Comparative evidence on other outcomes examined showed few statistically significant differences and was generally based on small numbers of studies. These findings highlight the imperative for interventions to improve retention, consideration of client-centred factors (such as client preference) when selecting between methadone and buprenorphine, and harmonisation of data collection and reporting to strengthen future syntheses. Australian National Health and Medical Research Council.