Tuberculosis preventive treatment (TPT) is a key component of tuberculosis elimination. To improve completion and reduce the burden for people and health systems, short, safe, and effective TPT regimens are needed. We aimed to compare safety and treatment completion of various doses and durations of rifampicin in people who were recommended to receive TPT. This partially blinded, parallel-arm, non-inferiority, randomised, controlled, phase 2b trial was done at seven university-affiliated clinics in Canada, Indonesia, and Viet Nam. Participants aged 10 years or older were included if they had an indication for TPT according to WHO guidelines for Indonesia and Viet Nam, or Canadian guidelines for Canadian sites, and a positive tuberculin skin test or interferon-γ release assay. Participants were randomly assigned (1:1:1) to receive oral rifampicin at 10 mg/kg once daily for 4 months (standard-dose group), 20 mg/kg daily for 2 months (20 mg/kg group), or 30 mg/kg daily for 2 months (30 mg/kg group). The randomisation sequence was computer generated with blocks of variable size (three, six, and nine) and stratified by country for Indonesia and Viet Nam, and by city within Canada. Participants and investigators were masked to dose in high-dose groups, but unmasked to duration in all groups. The two co-primary outcomes were safety (in the safety population, in which participants received at least one dose of the study drug) and treatment completion (in the modified intention-to-treat [mITT] population, excluding those ineligible after randomisation). Protocol-defined adverse events were defined as grade 3 or worse, or rash or allergy of any grade, judged by an independent and masked panel as possibly or probably related to the study. A margin of 4% was used to assess non-inferiority. This study is registered with ClinicalTrials.gov, NCT03988933 (active). Between Sept 1, 2019, and Sept 30, 2022, 1692 people were assessed for eligibility, 1376 were randomly assigned, and eight were excluded after randomisation. 1368 participants were included in the mITT population (454 in the standard group, 461 in the 20 mg/kg group, and 453 in the 30 mg/kg group). 589 (43%) participants were male and 779 (57%) were female. 372 (82%) in the standard-dose group, 329 (71%) in the 20 mg/kg group, and 293 (65%) in the 30 mg/kg group completed treatment. No participants in the standard-dose group, one (<1%) of 441 participants in the 20 mg/kg group, and four (1%) of 423 in the 30 mg/kg group developed grade 3 hepatotoxicity. Risk of protocol-defined adverse events was higher in the 30 mg/kg group than in the standard-dose group (adjusted risk difference 4·6% [95% CI 1·8 to 7·4]) or the 20 mg/kg group (5·1% [2·3 to 7·8]). There was no difference in the risk of adverse events between the 20 mg/kg and standard-dose groups (-0·5% [95% CI -2·4 to 1·5]; non-inferiority met). Completion was lower in the 20 mg/kg group (-7·8% [95% CI -13·6 to -2·0]) and the 30 mg/kg group (-15·4% [-21·4 to -9·4]) than in the standard-dose group. In this trial, 2 months of 30 mg/kg daily rifampicin had significantly worse safety and completion than 4 months of 10 mg/kg daily and 2 months of 20 mg/kg daily (the latter, a fully blinded comparison); we do not consider 30 mg/kg to be a good option for TPT. Rifampicin at 20 mg/kg daily for 2 months was as safe as standard treatment, but with lower completion. This difference remains unexplained. Canadian Institutes of Health Research.