BackgroundHomelessness is a complex societal and public health issue, with multiple causes and solutions. Efforts to reduce homelessness have tended to focus on crisis, with little attention paid to early intervention and primary prevention. Dealing with homelessness involves both supporting people at risk of homelessness and addressing personal and structural causes throughout the lifecourse, including adverse childhood experiences (ACEs). We examined the relationship between ACEs and homelessness in Wales. MethodsWe retrospectively analysed data from a 2017 cross-sectional national survey of adults aged 16–69 years, living in Wales (total respondents n=2497), using a stratified random probability sampling methodology. Outcome measures included number of ACEs (0, 1, 2–3, or ≥4) and lived experience of homelessness. The 11 categories of ACEs included childhood abuse (physical, sexual, and emotional); neglect (physical and emotional); parental separation or divorce; exposure to domestic violence; or living in a household affected by alcohol misuse, drug use, mental illness, or where someone is incarcerated. Bivariate analysis, adjusted for sociodemographic variables (age, deprivation, gender, and ethnicity), was used to assess the associations between homelessness and ACEs. FindingsWhen weighted to reflect the Welsh national population using mid-2015 population estimates for lower super output areas by sex, age group, and deprivation quintile, homelessness affected 141 (7·0%) of 2005 people in their lifetime. From the unweighted data (n=2497), of the 2333 participants without lived experience of homelessness, 1259 (54·0%) reported no ACEs, compared with 22 (13·4%) of the 164 with experience of homelessness. By contrast, the proportion of participants who reported four or more ACEs was lower among those without (n=253 [10·8%]) than in those with experience of homelessness (n=82 [50·0%]). Those with four or more ACEs were 16·0 times more likely to report lived experience of homelessness in their adult lives (95% CI 9·73–26·43, p<0·0001). Each ACE type was significantly associated with later homelessness, with the strongest associations seen for physical neglect (adjusted odds ratio 8·0 [95% CI 4·98–12·87], p<0·0001), physical abuse (7·0 [5·00–9·87], p<0·0001), sexual abuse (7·1 [4·69–10·78], p<0·0001), and emotional neglect (6·9 [4·63–10·19], p<0·0001). InterpretationThis large study using national, representative data indicates that early intervention that prevents ACEs, combined with a trauma-informed approach that builds resilience in at-risk children and adults, is likely to contribute to reducing and preventing homelessness. Possible limitations include the potential recall bias from retrospective, self-reported data. FundingPublic Health Wales Pump Prime Fund.