Conclusions and Relevance Results of this large cohort study indicated that both first and second doses of mRNA vaccines were associated with increased risk of myocarditis and pericarditis. For individuals receiving 2 doses of the same vaccine, risk of myocarditis was highest among young males (aged 16-24 years) after the second dose. These findings are compatible with between 4 and 7 excess events in 28 days per 100 000 vaccinees after BNT162b2, and between 9 and 28 excess events per 100 000 vaccinees after mRNA-1273. This risk should be balanced against the benefits of protecting against severe COVID-19 disease.