Background: Data for front-line health-care workers and risk of COVID-19 are limited. We sought to assess risk of COVID-19 among front-line health-care workers compared with the general community and the effect of personal protective equipment (PPE) on risk. Methods: We did a prospective, observational cohort study in the UK and the USA of the general community, including front-line health-care workers, using self-reported data from the COVID Symptom Study smartphone application (app) from March 24 (UK) and March 29 (USA) to April 23, 2020. Participants were voluntary users of the app and at first use provided information on demographic factors (including age, sex, race or ethnic background, height and weight, and occupation) and medical history, and subsequently reported any COVID-19 symptoms. We used Cox proportional hazards modelling to estimate multivariate-adjusted hazard ratios (HRs) of our primary outcome, which was a positive COVID-19 test. The COVID Symptom Study app is registered with ClinicalTrials.gov, NCT04331509. Findings: Among 2 035 395 community individuals and 99 795 front-line health-care workers, we recorded 5545 incident reports of a positive COVID-19 test over 34 435 272 person-days. Compared with the general community, front-line health-care workers were at increased risk for reporting a positive COVID-19 test (adjusted HR 11·61, 95% CI 10·93–12·33). To account for differences in testing frequency between front-line health-care workers and the general community and possible selection bias, an inverse probability-weighted model was used to adjust for the likelihood of receiving a COVID-19 test (adjusted HR 3·40, 95% CI 3·37–3·43). Secondary and post-hoc analyses suggested adequacy of PPE, clinical setting, and ethnic background were also important factors. Interpretation: In the UK and the USA, risk of reporting a positive test for COVID-19 was increased among front-line health-care workers. Health-care systems should ensure adequate availability of PPE and develop additional strategies to protect health-care workers from COVID-19, particularly those from Black, Asian, and minority ethnic backgrounds. Additional follow-up of these observational findings is needed. Funding: Zoe Global, Wellcome Trust, Engineering and Physical Sciences Research Council, National Institutes of Health Research, UK Research and Innovation, Alzheimer's Society, National Institutes of Health, National Institute for Occupational Safety and Health, and Massachusetts Consortium on Pathogen Readiness.