BackgroundInjecting drugs substantially increases the risk of hepatitis C virus (HCV) infection and is common in homeless people and prisoners. Capturing accurate data on disease prevalence within these groups is challenging, and this problem hinders efforts to develop targeted strategies to reduce HCV transmission. The aim of this study was to estimate the prevalence of HCV in these vulnerable populations. MethodsWe conducted a cross-sectional study between May 1, 2011, and June 30, 2013, in London, UK. Using the National Health Service Find and Treat service, we recruited participants from 39 hostels for the homeless, 20 drug treatment services, and a prison. Inclusion criteria were age over 18 years, capacity to consent, and being identified as homeless (living in a homeless hotel), having a history of drug use (using services at drug treatment centres), or being a prisoner at the time of the study. A questionnaire was administered and blood samples were collected to be tested for HCV. FindingsWe recruited 1207 individuals, of whom 491 were homeless (40·7%), 205 were drug users (17·0%), and 511 were prisoners (42·3%). 98 (8·1%) of the 1207 participants had active HCV infection and 38 (3·1%) had a previous HCV infection. Among HCV-positive individuals, 77 (56·6%) had a history all three risk factors (homelessness, imprisonment, and drug use), 37 (27·3%) had two risk factors, and 22 (15·4%) had one risk factor. Multivariate logistic regression identified three factors associated with increased risk of HCV infection: duration of injecting (odds ratio for <1 year 12·62, 95% CI 6·22–25·57; 2–9 years 50·04, 24·80–100·95; and ≥10 years 67·34, 32·29–140·46), age more than 30 years (3·00, 1·33–6·76), and UK-born non-white (0·38, 0·15–0·99). Separate multivariate analysis showed that alcohol problems (2·92, 1·24–6·89), age 30–49 years (8·29, 1·06–64·73), and age more than 50 (13·85, 1·67–114·85) increased the risk of HCV infection in individuals who were not injecting drugs. InterpretationHomeless services, drug treatment services, and prisons provide good opportunities for identifying HCV-positive individuals. More than half of HCV-infected individuals had the three intersecting risk factors, highlighting the vulnerability of these patients. Reducing the burden of HCV among these vulnerable groups is fundamental to lessen HCV transmission. FundingNational Institute for Health Research (NIHR) under the Programme Grants for Applied Research programme (reference number RP-PG-0407-10340). RWA is funded by a Wellcome Trust research training fellowship (097980/Z/11/Z). DNA is funded by an Indonesia Presidential Scholarship.