Primary central nervous system lymphoma (PCNSL) is a rare extranodal form of non-Hodgkin lymphoma (NHL). The present study aimed to investigate the potential association between infection with the Hepatitis B virus (HBV) and PCNSL. The prevalence of HBV infection in 199 patients with PCNSL was compared in our hospital with that of an age-and sex-matched group of patients with other cancers (except liver cancer), and with a national population-based control group. Enzyme-linked immunosorbent assays were used to test blood samples for HBV markers. It was found that the prevalence of HBV infection in PCNSL was 16.1%, which was higher as compared with patients with other non-hematologic cancers and the national population-based control group. In conclusion, the present study demonstrated that PCNSL patients had a higher prevalence of HBV infection and suggested a potential association between infection with HBV and PCNSL.