Postmarketing evaluations have linked myocarditis to COVID-19 mRNA vaccines. However, few population-based analyses have directly compared the safety of the 2 mRNA COVID-19 vaccines.This study aimed to compare the risk of myocarditis, pericarditis, and myopericarditis between BNT162b2 and mRNA-1273.We used data from the British Columbia COVID-19 Cohort (BCC19C), a population-based cohort study. The exposure was the second dose of an mRNA vaccine. The outcome was diagnosis of myocarditis, pericarditis, or myopericarditis during a hospitalization or an emergency department visit within 21 days of the second vaccination dose. We performed multivariable logistic regression to assess the association between vaccine product and the outcomes of interest.The rates of myocarditis and pericarditis per million second doses were higher for mRNA-1273 (n = 31, rate 35.6; 95% CI: 24.1-50.5; and n = 20, rate 22.9; 95% CI: 14.0-35.4, respectively) than BNT162b2 (n = 28, rate 12.6; 95% CI: 8.4-18.2 and n = 21, rate 9.4; 95% CI: 5.8-14.4, respectively). mRNA-1273 vs BNT162b2 had significantly higher odds of myocarditis (adjusted OR [aOR]: 2.78; 95% CI: 1.67-4.62), pericarditis (aOR: 2.42; 95% CI: 1.31-4.46) and myopericarditis (aOR: 2.63; 95% CI: 1.76-3.93). The association between mRNA-1273 and myocarditis was stronger for men (aOR: 3.21; 95% CI: 1.77-5.83) and younger age group (18-39 years; aOR: 5.09; 95% CI: 2.68-9.66).Myocarditis/pericarditis following mRNA COVID-19 vaccines is rare, but we observed a 2- to 3-fold higher odds among individuals who received mRNA-1273 vs BNT162b2. The rate of myocarditis following mRNA-1273 receipt is highest among younger men (age 18-39 years) and does not seem to be present at older ages. Our findings may have policy implications regarding the choice of vaccine offered.