Previous analyses of the 2016 Brexit referendum used region-level data or small samples based on polling data. The former might be subject to ecological fallacy and the latter might suffer from small-sample bias. We use individual-level data on thousands of respondents in Understanding Society, the UK's largest household survey, which includes the EU referendum question. We find that voting Leave is associated with older age, white ethnicity, low educational attainment, infrequent use of smartphones and the internet, receiving benefits, adverse health and low life satisfaction. These results coincide with corresponding patterns at the aggregate level of voting areas. We therefore do not find evidence of ecological fallacy. In addition, we show that prediction accuracy is geographically heterogeneous across UK regions, with strongly pro-Leave and strongly pro-Remain areas easier to predict. We also show that among individuals with similar socio-economic characteristics, Labour supporters are more likely to support Remain while Conservative supporters are more likely to support Leave.