Abstract Background Hepatitis B virus (HBV) infection is associated with a reduced risk of developing dyslipidemia and non-alcoholic fatty liver diseases. Given that the gut microbiota plays a significant role in cholesterol metabolism, we compared the differences in gut microbial diversity and composition between HBV-infected and uninfected subjects. Results A prospective case–control study was designed comprising healthy controls (group A) and HBV-infected individuals (group B) in a 1:1 ratio (57 participants each; total = 114). The patients in group B were divided into two subgroups according to their HBV DNA loads: B1