Chronic hepatitis B virus (HBV) and hepatitis C virus (HCV) infection are the most important causes of hepatocellular carcinoma (HCC), accounting for the majority of the cases worldwide. The geographical distribution of HCC therefore coincides with the distribution of HBV and HCV infections in those areas. Similar to nonviral liver diseases, HBV and HCV infection can cause chronic injury to the liver, with subsequent progression to severe fibrosis and cirrhosis. The presence of cirrhosis is a major risk factor for the development of HCC. However, HCC can occur in the absence of cirrhosis, suggesting that both HBV and HCV may be directly involved in hepatocarcinogenesis. Several HBV factors have been implicated in hepatocarcinogenesis, including the HBx gene, the pre-S2/S gene and the HBV spliced protein. Furthermore, HBV can be integrated into the host genome, leading to changes in genomic function or chromosomal instability. By contrast to HBV, HCV cannot integrate into the host genome. Various HCV proteins, including the core, envelope and nonstructural proteins, have been shown to have oncogenic properties. For HBV infection, antiviral therapy and vaccination have been shown to decrease the risk of HCC. Antiviral therapy for HCV can also reduce the risk of HCC.