Background: Both COVID-19 infection and COVID-19 vaccines have been associated with the development of myopericarditis. The objective of this study is to (1) analyse the rates of myopericarditis after COVID-19 infection and COVID-19 vaccination in Hong Kong, (2) compared to the background rates, and (3) compare the rates of myopericarditis after COVID-19 vaccination to those reported in other countries. Methods: This was a population-based cohort study from Hong Kong, China. Patients with positive RT-PCR test for COVID-19 between 1st January 2020 and 30th June 2021 or individuals who received COVID-19 vaccination until 31st August were included. The main exposures were COVID-19 positivity or COVID-19 vaccination. The primary outcome was myopericarditis. Results: This study included 11,441 COVID-19 patients from Hong Kong, four of whom suffered from myopericarditis (rate per million: 326; 95% confidence interval [CI] 127–838). The rate was higher than the pre-COVID-19 background rate in 2019 (rate per million: 5.5, 95% CI 4.1–7.4) with a rate ratio of 55.0 (95% CI 21.4–141). Compared to the background rate, the rate of myopericarditis among vaccinated subjects in Hong Kong was similar (rate per million: 5.5; 95% CI 4.1–7.4) with a rate ratio of 0.93 (95% CI 0.69–1.26). The rates of myocarditis after vaccination in Hong Kong were comparable to those vaccinated in the United States, Israel, and the United Kingdom. Conclusions: COVID-19 infection was associated with significantly higher rate of myopericarditis compared to the vaccine-associated myopericarditis.