Importance: It is unclear when, where, and by whom health care workers (HCWs) working in hospitals are infected with SARS-CoV-2. Objective: To determine how often and in what manner nosocomial SARS-CoV-2 infection occurs in HCW groups with varying exposure to patients with COVID-19. Design, Setting, and Participants: This cohort study comprised 4 weekly measurements of SARS-CoV-2-specific antibodies and collection of questionnaires from March 23 to June 25, 2020, combined with phylogenetic and epidemiologic transmission analyses at 2 university hospitals in the Netherlands. Included individuals were HCWs working in patient care for those with COVID-19, HCWs working in patient care for those without COVID-19, and HCWs not working in patient care. Data were analyzed from August through December 2020. Exposures: Varying work-related exposure to patients infected with SARS-CoV-2. Main Outcomes and Measures: The cumulative incidence of and time to SARS-CoV-2 infection, defined as the presence of SARS-CoV-2-specific antibodies in blood samples, were measured. Results: Among 801 HCWs, there were 439 HCWs working in patient care for those with COVID-19, 164 HCWs working in patient care for those without COVID-19, and 198 HCWs not working in patient care. There were 580 (72.4%) women, and the median (interquartile range) age was 36 (29-50) years. The incidence of SARS-CoV-2 was increased among HCWs working in patient care for those with COVID-19 (54 HCWs [13.2%; 95% CI, 9.9%-16.4%]) compared with HCWs working in patient care for those without COVID-19 (11 HCWs [6.7%; 95% CI, 2.8%-10.5%]; hazard ratio [HR], 2.25; 95% CI, 1.17-4.30) and HCWs not working in patient care (7 HCWs [3.6%; 95% CI, 0.9%-6.1%]; HR, 3.92; 95% CI, 1.79-8.62). Among HCWs caring for patients with COVID-19, SARS-CoV-2 cumulative incidence was increased among HCWs working on COVID-19 wards (32 of 134 HCWs [25.7%; 95% CI, 17.6%-33.1%]) compared with HCWs working on intensive care units (13 of 186 HCWs [7.1%; 95% CI, 3.3%-10.7%]; HR, 3.64; 95% CI, 1.91-6.94), and HCWs working in emergency departments (7 of 102 HCWs [8.0%; 95% CI, 2.5%-13.1%]; HR, 3.29; 95% CI, 1.52-7.14). Epidemiologic data combined with phylogenetic analyses on COVID-19 wards identified 3 potential HCW-to-HCW transmission clusters. No patient-to-HCW transmission clusters could be identified in transmission analyses. Conclusions and Relevance: This study found that HCWs working on COVID-19 wards were at increased risk for nosocomial SARS-CoV-2 infection with an important role for HCW-to-HCW transmission. These findings suggest that infection among HCWs deserves more consideration in infection prevention practice..