Understanding underlying mechanisms of heterogeneity in test-seeking and reporting behaviour during an infectious disease outbreak can help to protect vulnerable populations and guide equity-driven interventions. The COVID-19 pandemic probably exerted different stresses on individuals in different sociodemographic groups and ensuring fair access to and usage of COVID-19 tests was a crucial element of England's testing programme. We aimed to investigate the relationship between sociodemographic factors and COVID-19 testing behaviours in England during the COVID-19 pandemic. We did a population-based study of COVID-19 testing behaviours with mass COVID-19 testing data for England and data from community prevalence surveillance surveys (REACT-1 and ONS-CIS) from Oct 1, 2020, to March 30, 2022. We used mass testing data for lateral flow device (LFD; data for approximately 290 million tests performed and reported) and PCR (data for approximately 107 million tests performed and returned from the laboratory) tests made available for the general public and provided by date and self-reported age and ethnicity at the lower tier local authority (LTLA) level. We also used publicly available data on mean population size estimates for individual LTLAs, and data on ethnic groups, age groups, and deprivation indices for LTLAs. We did not have access to REACT-1 or ONS-CIS prevalence data disaggregated by sex or gender. Using a mechanistic causal model to debias the PCR testing data, we obtained estimates of weekly SARS-CoV-2 prevalence by both self-reported ethnic groups and age groups for LTLAs in England. This approach to debiasing the PCR (or LFD) testing data also estimated a testing bias parameter defined as the odds of testing in infected versus not infected individuals, which would be close to zero if the likelihood of test seeking (or seeking and reporting) was the same regardless of infection status. With confirmatory PCR data, we estimated false positivity rates, sensitivity, specificity, and the rate of decline in detection probability subsequent to reporting a positive LFD for PCR tests by sociodemographic groups. We also estimated the daily incidence, allowing us to calculate the fraction of cases captured by the testing programme. From March, 2021 onwards, individuals in the most deprived regions reported approximately half as many LFD tests per capita as individuals in the least deprived areas (median ratio 0·50 [IQR 0·44-0·54]). During the period October, 2020, to June, 2021, PCR testing patterns showed the opposite trend, with individuals in the most deprived areas performing almost double the number of PCR tests per capita than those in the least deprived areas (1·8 [1·7-1·9]). Infection prevalences in Asian or Asian British individuals were considerably higher than those of other ethnic groups during the alpha (B.1.1.7) and omicron (B.1.1.529) BA.1 waves. Our estimates indicate that the England Pillar 2 COVID-19 testing programme detected 26-40% of all cases (including asymptomatic cases) over the study period with no consistent differences by deprivation levels or ethnic groups. Testing biases for PCR were generally higher than those for LFDs, in line with the general policy of symptomatic and asymptomatic use of these tests. Deprivation and age were associated with testing biases on average; however, the uncertainty intervals overlapped across deprivation levels, although the age-specific patterns were more distinct. We also found that ethnic minorities and older individuals were less likely to use confirmatory PCR tests through most of the pandemic and that delays in reporting a positive LFD test were possibly longer in populations self-reporting as "Black; African; Black British or Caribbean". Differences in testing behaviours across sociodemographic groups might be reflective of the higher costs of self-isolation to vulnerable populations, differences in test accessibility, differences in digital literacy, and differing perceptions about the utility of tests and risks posed by infection. This study shows how mass testing data can be used in conjunction with surveillance surveys to identify gaps in the uptake of public health interventions both at fine-scale levels and across sociodemographic groups. It provides a framework for monitoring local interventions and yields valuable lessons for policy makers in ensuring an equitable response to future pandemics. UK Health Security Agency.