Some studies had reported that patients with viral hepatitis are at increased risk of reduced bone mineral density and even osteoporosis. However, the interaction between reduced bone mineral density (BMD) and viral hepatitis remains inconclusive. Therefore, our study collected hepatitis test results and bone mineral density from respondents in the NHANES database. The aim of this study was to investigate whether there is an association between hepatitis and a decrease in bone mineral density. The respondents with both hepatitis- and BMD-related indicators from the NHANES database in the United States from 2005-2010, 2013-2014, to 2017-2020 were collected for this study. BMD were compared between respondents who were positive and negative for respondents related to hepatitis B and C. BMD was measured using dual-energy X-ray absorptiometry of the femur and lumbar spine. Finally, multiple regression analysis was performed between hepatitis B surface antigen (HBsAg) and hepatitis C RNA (HCV-RNA) and BMD in the respondents. A total of 15,642 respondents were included in the hepatitis B surface antigen-related survey. Of these, 1,217 respondents were positive for hepatitis B surface antigen. A total of 5111 hepatitis C RNA-related responders were included. Hepatitis C RNA-positive had 268 respondents. According to the results of the multiple regression analysis, the femoral BMD was significantly lower in HBsAg (+) respondents compared to HBsAg (-) respondents: -0.018 (-0.026, -0.009) (P < 0.01). Moreover, spinal BMD was significantly lower in HBsAg (+) respondents compared to HBsAg (-) respondents: -0.020 (-0.030, -0.010) (P < 0.01). According to the results of multiple regression analysis for hepatitis C RNA, HCV-RNA (+) respondents had significantly lower BMD compared to HCV-RNA (-) respondents: -0.043 (-0.059, -0.026) (P < 0.01). During the analysis of respondents in the NHANES database in the United States, positive tests for hepatitis B surface antigen and hepatitis C RNA were found to be associated with a reduction in BMD. Positive serology for these hepatitis indicators may increase the risk of reduced BMD. Of course, this conclusion still needs to be further confirmed by more large clinical trials.