A self-controlled case series using individual-patient-level data from over 38 million people aged 16 years and over, reveals an increased risk of myocarditis within a week of receiving a first dose of ChAdOx1, BNT162b2 and mRNA-1273 vaccines, which was further increased after a second dose of either mRNA vaccine. SARS-CoV-2 infection was associated with even greater risk of myocarditis, as well as pericarditis and cardiac arrhythmia.