Several non-hepatocellular cancers were linked with hepatitis B virus (HBV) infection. This study was aimed to quantify the potential associations between HBV infection and multiple non-hepatocellular cancers. Continuous cases, including 5,715 non-cancer and 40,963 cancer cases diagnosed from 2008 to 2014 in Sun Yat-sen University Cancer Center were analyzed. HBV DNA and hepatitis B core antigen (HBcAg) were examed in gastric cancer tissues by polymerase chain reaction and immunohistochemical staining. After adjusting for age, sex, year of diagnosis, smoking, drinking and family history of cancer, significant associations were found between serum HBsAg and frequently reported HBV-related non-hepatocellular cancers, including non-Hodgkin's lymphoma, cholangiocarcinoma and pancreatic cancer [adjusted odds ratio (AOR) and 95% confidence interval (CI): 1.89 (1.65–2.16)], as well as total other non-hepatocellular cancers [AOR and 95% CI: 1.12 (1.03–1.22)]. The median ages at diagnosis, all-cause death and cancer-specific death of serum HBsAg positive cancer patients were all significantly younger than those with serum HBsAg negative. HBV DNA was detected in 12.4% (34/275) gastric cancer tissues and HBcAg was most commonly detected in lymphocytes. This was the first report that HBV infection had a modest but significant nonspecific association with total non-hepatocellular cancers. Median age at diagnosis and death was significantly younger in serum HBsAg positive cancer patients. The underlying mechanism needs further investigation.