Introduction Transmission of COVID-19 within families and close contacts accounts for the majority of epidemic growth. Community mask wearing, hand washing and social distancing are thought to be effective but there is little evidence to inform or support community members on COVID-19 risk reduction within families. Methods: A retrospective cohort study of 335 people in 124 families and with at least one laboratory confirmed COVID-19 case was conducted from 28 February to 27 March 2020, in Beijing, China. The outcome of interest was secondary transmission of severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) within the family. Characteristics and practices of primary cases, of well family contacts and household hygiene practices were analysed as predictors of secondary transmission. Results: The secondary attack rate in families was 23.0% (77/335). Face mask use by the primary case and family contacts before the primary case developed symptoms was 79% effective in reducing transmission (OR=0.21, 95% CI 0.06 to 0.79). Daily use of chlorine or ethanol based disinfectant in households was 77% effective (OR=0.23, 95% CI 0.07 to 0.84). Wearing a mask after illness onset of the primary case was not significantly protective. The risk of household transmission was 18 times higher with frequent daily close contact with the primary case (OR=18.26, 95% CI 3.93 to 84.79), and four times higher if the primary case had diarrhoea (OR=4.10, 95% CI 1.08 to 15.60). Household crowding was not significant. Conclusion: The study confirms the highest risk of transmission prior to symptom onset, and provides the first evidence of the effectiveness of mask use, disinfection and social distancing in preventing COVID-19. We also found evidence of faecal transmission. This can inform guidelines for community prevention in settings of intense COVID-19 epidemics