Periodontitis is a cumulative inflammatory disease associated with multiple health conditions and various systemic diseases. As a common disease, virus infection along with its consequences has become a serious health burden. The study aims to evaluate the relationship between common viruses including hepatitis virus, human immunodeficiency virus (HIV), herpes simplex virus (HSV), human papillomavirus (HPV), and periodontitis. The data from the US National Health and Nutrition Examination Survey (NHANES) 2009−2014 was adopted and screened through, including 10 714 participants. Generalized linear regression was conducted to verify the relationships between the virus infections and periodontitis. Moreover, we also performed analyses in age and gender subgroups. The results suggested that the infection of HCV, HSV‐1, and HSV‐2 was significantly associated with the prevalence of periodontitis (odds ratio [OR] 1.46, 95% confidence interval [CI] 1.26−1.70; OR 1.09, 95% CI 1.05−1.13; OR 1.06, 95% CI 1.01 ‐ 1.11, respectively) and risk of developing moderate or severe periodontitis (OR 1.51, 95% CI 1.29−1.77; OR 1.08, 95% CI 1.04−1.12; OR 1.05, 95% CI 1.01−1.10, respectively) after adjusting all relevant co‐factors. Subgroup analyses revealed a steady association between periodontitis and hepatitis C virus (HCV) or HSV‐1 infection, while the relationship between HSV‐2 and HPV infection can also be found in some subgroups. The presence of HCV and HSV infection was found to be significantly associated with the prevalence of periodontitis, including moderate or severe cases. Moreover, the association of periodontitis and HPV infection can also be observed in people < 35 years.