Background Scarce data are available on what variables affect the risk of transmission of severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), the development of symptomatic COVID-19, and, particularly, the relationship with viral load. We aimed to analyse data from linked index cases of COVID-19 and their contacts to explore factors associated with transmission of SARS-CoV-2. Methods In this cohort study, patients were recruited as part of a randomised controlled trial done between March 17 and April 28, 2020, that aimed to assess if hydroxychloroquine reduced transmission of SARS-CoV-2. Patients with COVID-19 and their contacts were identified by use of the electronic registry of the Epidemiological Surveillance Emergency Service of Catalonia (Spain). Patients with COVID-19 included in our analysis were aged 18 years or older, not hospitalised, had quantitative PCR results available at baseline, had mild symptom onset within 5 days before enrolment, and had no reported symptoms of SARS-CoV-2 infections in their accommodation or workplace within the 14 days before enrolment. Contacts included were adults with a recent history of exposure and absence of COVID-19-like symptoms within the 7 days preceding enrolment. Viral load of contacts, measured by quantitative PCR from a nasopharyngeal swab, was assessed at enrolment, at day 14, and whenever the participant reported COVID-19-like symptoms. We assessed risk of transmission and developing symptomatic disease and incubation dynamics using regression analysis. We assessed the relationship of viral load and characteristics of cases (age, sex, number of days from reported symptom onset, and presence or absence of fever, cough, dyspnoea, rhinitis, and anosmia) and associations between risk of transmission and characteristics of the index case and contacts. Findings We identified 314 patients with COVID-19, with 282 (90%) having at least one contact (753 contacts in total), resulting in 282 clusters. 90 (32%) of 282 clusters had at least one transmission event. The secondary attack rate was 17% (125 of 753 contacts), with a variation from 12% when the index case had a viral load lower than 1 × 10⁶ copies per mL to 24% when the index case had a viral load of 1 × 10¹⁰ copies per mL or higher (adjusted odds ratio per log 10 increase in viral load 1•3, 95% CI 1•1-1•5). Increased risk of transmission was also associated with household contact (3•0, 1•59-5•65) and age of the contact (per year: 1•02, 1•01-1•04). 449 contacts had a positive PCR result at baseline. 28 (6%) of 449 contacts had symptoms at the first visit. Of 421 contacts who were asymptomatic at the first visit, 181 (43%) developed symptomatic COVID-19, with a variation from approximately 38% in contacts with an initial viral load lower than 1 × 10⁷ copies per mL to greater than 66% for those with an initial viral load of 1 × 10¹⁰ copies per mL or higher (hazard ratio per log 10 increase in viral load 1•12, 95% CI 1•05-1•20; p=0•0006). Time to onset of symptomatic disease decreased from a median of 7 da...