Hepatic viral infections and breast cancer (BC) constitute major global health challenges, yet the interconnection between these hepatic infections and BC continues to be ambiguous. Conducting a comprehensive evaluation of the link between hepatitis virus infection and the incidence of BC and leveraging data from the National Health and Nutrition Examination Survey covering the period from 1999 to March 2022, we utilized logistic regression and subgroup analysis, among other methodologies, to execute a cross-sectional investigation. The univariate logistic regression analysis elucidates that individuals classified as non-Hispanic White exhibit a markedly higher incidence of BC at 2.620 (95% confidence interval [CI], 1.117–7.676; P = .045); moreover, advanced age at 1.063 (95% CI, 1.036–1.093; P < .001), elevated educational attainment at 1.962 (95% CI, 1.17–3.366; P = .012), and higher income levels at 2.835 (95% CI, 1.303–7.439; P = .017) emerge as significant predisposing factors for BC. In contrast, a greater number of live births significantly diminishes the risk of BC, reducing the incidence to 81.1% with each additional birth. Pertaining to hepatitis and vaccination status, our analysis distinctly demonstrates that only hepatitis B at 0.110 (95% CI, 0.018–0.353; P = .002) bears a significant inverse relationship with BC risk, suggesting a protective effect. The multivariate logistic regression analysis further reveals a negative association between hepatitis B infection and BC incidence, whereas hepatitis B vaccination shows a positive correlation with the disease incidence. After adjusting for all covariates, model 3 delineates odds ratios (95% CI) as follows: 0.14 (0.02–0.50; P = .009) and 1.92 (0.99–3.62; P = .046). Our investigation uncovers that within the general populace, there exists an inverse correlation between hepatitis B infection and BC incidence; in addition, the administration of the hepatitis B virus vaccine is potentially positively associated with the prevalence of BC.