ObjectiveTo examine sociodemographic inequalities in people with SARS-CoV-2 during the second (alpha) and third (delta) waves of the covid-19 pandemic.DesignRetrospective, population based cohort study.SettingResident population of England.Participants39 006 194 people aged 10 years and older who were enumerated in the 2011 census, registered with the NHS, and alive on 1 September 2020.Main outcome measuresAge standardised SARS-CoV-2 case rates (ie, the number of people who received a positive test result per 100 000 person weeks at risk) during the second wave (1 September 2020 to 22 May 2021) or third wave (23 May to 10 December 2021) of the pandemic. Age standardised rates were calculated by sociodemographic characteristics and adjusted rate ratios were estimated using generalised linear regression models with a Poisson distribution (models were adjusted for covariates including sex, age, geographical variables, and sociodemographic characteristics).ResultsDuring the study period, 5 767 584 people (14.8% of the study population) tested positive for SARS-CoV-2. In the second wave, the fully adjusted relative risks of having a positive test were highest for the Bangladeshi and Pakistani ethnic groups compared with the white British group, with rate ratios of 1.75 (95% confidence interval 1.73 to 1.77) and 1.69 (1.68 to 1.70), respectively. Muslim and Sikh religious groups had fully adjusted rate ratios of 1.51 (1.50 to 1.51) and 1.64 (1.63 to 1.66), respectively, compared with the Christian group. Greater area deprivation, disadvantaged socioeconomic position, living in a care home, and low English language proficiency were also associated with higher relative risk of having a positive test. However, the inequalities among groups varied over time. Being Christian, white British, without a disability, and from a more advantaged socioeconomic position were associated with increased relative risk of testing positive during the third wave.ConclusionResearch is urgently needed to understand the large sociodemographic inequalities in SARS-CoV-2 case rates in order to inform policy interventions in future waves or pandemics.