BACKGROUND: The risk factors for coronavirus disease (COVID-19) among healthcare workers (HCWs) might have changed since the emergence of the highly immune evasive Omicron variant. AIM: To compare the risk factors for severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) infection among HCWs during the Delta- and Omicron-predominant periods. METHODS: Using data from repeated serosurveys among the staff of a medical research centre in Tokyo, two cohorts were established: Delta period cohort (N = 858) and Omicron period cohort (N = 652). The potential risk factors were assessed using a questionnaire. Acute/current or past SARS-CoV-2 infection was identified by polymerase chain reaction or anti-nucleocapsid antibody tests, respectively. Poisson regression was used to calculate the risk ratio (RR) of infection risk. FINDINGS: The risk of SARS-CoV-2 infection during the early Omicron-predominant period was 3.4-fold higher than during the Delta-predominant period. Neither working in a COVID-19-related department nor having a higher degree of occupational exposure to SARS-CoV-2 was associated with an increased infection risk during both periods. During the Omicron-predominant period, infection risk was higher among those who spent ≥30 min in closed spaces, crowded spaces, and close-contact settings without wearing mask (≥3 times versus never: RR: 6.62; 95% confidence interval: 3.01-14.58), whereas no such association was found during the Delta period. CONCLUSION: Occupational exposure to COVID-19-related work was not associated with the risk of SARS-CoV-2 infection in the Delta or Omicron period, whereas high-risk behaviours were associated with an increased infection risk during the Omicron period.