It is paramount to understand the epidemiology of chronic hepatitis B to inform national policies on vaccination and screening/testing as well as cost-effectiveness studies. However, information on the national (Scottish) prevalence of chronic hepatitis B by ethnic group is lacking. To estimate the number of people with chronic hepatitis B in Scotland in 2009 by ethnicity, gender and age, the test data from virology laboratories in the four largest cities in Scotland were combined with estimates of the ethnic distribution of the Scottish population. Ethnicity in both the test data and the Scottish population was derived using a name-based ethnicity classification software (OnoMAP; Publicprofiler Ltd, UK). For 2009, we estimated 8720 [95% confidence interval (CI) 7490–10 230] people aged ⩾15 years were living with chronic hepatitis B infection in Scotland. This corresponds to 0·2% (95% CI 0·17–0·24) of the Scottish population aged ⩾15 years. Although East and South Asians make up a small proportion of the Scottish population, they make up 44% of the infected population. In addition, 75% of those infected were aged 15–44 years with almost 60% male. This study quantifies for the first time on a national level the burden of chronic hepatitis B infection by ethnicity, gender and age. It confirms the importance of promoting and targeting ethnic minority groups for hepatitis B testing.