The potential impact of increasing test-and-treat coverage on hepatitis B virus (HBV) infection remains unclear in China. The objective of this study was to develop a dynamic compartmental model at a population level to estimate the long-term effect of this strategy.Based on the natural history of HBV infection and 3 serosurvey data of hepatitis B in China, we proposed an age- and time-dependent discrete model to predict the number of new HBV infection, the number of chronic HBV infection, and the number of HBV-related deaths for the time from 2018 to 2050 under 5 different test-and-treat coverage and compared them with current intervention policy.Compared with current policy, if the test-and-treat coverage was increased to 100% since 2018, the numbers of chronic HBV infection, new HBV infection, and HBV-related deaths in 2035 would be reduced by 26.60%, 24.88%, 26.55%, respectively, and in 2050 it would be reduced by 44.93%, 43.29%, 43.67%, respectively. In contrast, if the test-and-treat coverage was increased by 10% every year since 2018, then the numbers of chronic HBV infection, new HBV infection, and HBV-related deaths in 2035 would be reduced by 21.81%, 20.10%, 21.40%, respectively, and in 2050 it would be reduced by 41.53%, 39.89%, 40.32%, respectively. In particular, if the test-and-treat coverage was increased to 75% since 2018, then the annual number of HBV-related deaths would begin to decrease from 2018. If the test-and-treat coverage was increased to above 25% since 2018, then the hepatitis B surface antigen (HBsAg) prevalence for population aged 1 to 59 years in China would be reduced to below 2% in 2035. Our model also showed that in 2035, the numbers of chronic HBV infection and HBV-related deaths in 65 to 69 age group would be reduced the most (about 1.6 million and 13 thousand, respectively).Increasing test-and-treat coverage would significantly reduce HBV infection in China, especially in the middle-aged people and older people. The earlier the treatment and the longer the time, the more significant the reduction. Implementation of test-and-treat strategy is highly effective in controlling hepatitis B in China.