BackgroundHomelessness as a complex and persistent public health challenge is an extreme form of social exclusion. Our understanding on the health of homeless populations is largely informed by research on the more visible street homelessness, highlighting ill health, substance dependencies, and reduced life expectancy. These estimates are likely to underestimate individual's health-care needs, alongside barriers to accessing care. We aimed to adopt a broad definition of homelessness to understand COVID-19-related health outcomes for this population. MethodsOur definition includes street homelessness and precarious or insecure housing, thus including those known as hidden homeless who are not in government homelessness statistics. We generated an e-cohort of individuals with recorded lived experience of homelessness in Wales, by combining information across four routine health-care datasets (primary care, inpatient care, emergency department, and substance misuse service. A population comparison group was randomly selected from the Welsh Demographic Service database. We linked the e-cohort and comparison group with COVID-19 NHS Wales Test Trace and Protect, annual district death extract, and the patient episode database to examine the COVID-19 outcomes. This study is exempt from consent due to the anonymised nature of the databank. The independent Information Governance Review Panel approved this study. FindingsThe e-cohort includes 15 472 individuals aged 16 years and older who visited the four health-care services in Wales since Jan 1, 2014, until July 31, 2020, including 1717 currently homeless during the pandemic in 2020 (69·2% were male and 42·0% were younger than 35 years). Of those people currently homeless during COVID-19, 54 (3·2%; 95% CI 2·4–4·1) tested positive for the virus, 16 (0·9%; 0·5–1·5) had COVID-19-related hospital admissions, and five (0·3%; 0·1–0·7) died, involving COVID-19. Compared with the general population comparison group (n=15 472), where 340 (2·20%; 1·97–2·44) tested positive, 11 (0·07%; 0·04–0·13) had COVID-19 related hospital admissions, and nine (0·06%; 0·03–0·11) died, involving COVID-19 (mentioned on death certificate). InterpretationThese findings suggest that COVID-19-related outcomes were worse for individuals who were homeless during the pandemic compared with the general population. The complex health needs and pre-existing vulnerabilities people who are homeless warrant further exploration. This study is likely to underestimate the population size and health needs due to relying on people seeking health care and disclosing their homeless or housing status, to which there are recognised barriers. Accurate and standardised coding of housing status in practise is an area that needs urgent improvement. FundingPublic Health Wales.