BACKGROUND:The 69th World Health Assembly approved the Global Health Sector Strategy to eliminate viral hepatitis by 2030. Although no virological cure exists for hepatitis B virus (HBV) infection, existing therapies to control viral replication and prophylaxis to minimise mother-to-child transmission make elimination of HBV feasible. We aimed to estimate the national, regional, and global prevalence of HBsAg in the general population and in the population aged 5 years in 2016, as well as coverage of prophylaxis, diagnosis, and treatment. METHODS:In this modelling study, we used a Delphi process that included a literature review in PubMed and Embase, followed by interviews with experts, to quantify the historical epidemiology of HBV infection. We then used a dynamic HBV transmission and progression model to estimate the country-level and regional-level prevalence of HBsAg in 2016 and the effect of prophylaxis and treatment on disease burden. FINDINGS:We developed models for 120 countries, 78 of which were populated with data approved by experts. Using these models, we estimated that the global prevalence of HBsAg in 2016 was 3·9% (95% uncertainty interval [UI] 3·4-4·6), corresponding to 291 992 000 (251 513 000-341 114 000) infections. Of these infections, around 29 million (10%) were diagnosed, and only 4·8 million (5%) of 94 million individuals eligible for treatment actually received antiviral therapy. Around 1·8 (1·6-2·2) million infections were in children aged 5 years, with a prevalence of 1·4% (1·2-1·6). We estimated that 87% of infants had received the three-dose HBV vaccination in the first year of life, 46% had received timely birth-dose vaccination, and 13% had received hepatitis B immunoglobulin along with the full vaccination regimen. Less than 1% of mothers with a high viral load had received antiviral therapy to reduce mother-to-child transmission. INTERPRETATION:Our estimate of HBV prevalence in 2016 differs from previous studies, potentially because we took into account the effect of infant prophylaxis and early childhood vaccination, as well as changing prevalence over time. Although some regions are well on their way to meeting prophylaxis and prevalence targets, all regions must substantially scale-up access to diagnosis and treatment to meet the global targets. FUNDING:John C Martin Foundation.