High-quality data on liver cancers by probable cause are scarce in many regions of the world. The United Nations recently set a goal of eliminating viral hepatitis as a major public health threat by 2030. We aimed to estimate the number of new cases of cancers attributable to hepatitis B virus (HBV) and hepatitis C virus (HCV) at a global, regional and country level, and by development status. We used data on the prevalence of HBV and HCV in hepatocellular carcinoma from a systematic review including 119,000 cases in 260 studies covering 50 countries. A statistical model was constructed to extrapolate empirical data to countries without prevalence data. Country-specific numbers of liver cancer cases attributable to HBV and HCV were calculated using data from GLOBOCAN 2012. Globally, 770,000 cases of liver cancer occurred worldwide in 2012, of which 56% (95% CI: 52-60) were attributable to HBV and 20% (95% CI: 18-22) to HCV. Currently, HBV causes approximately two out of three cases of liver cancer in less developed countries but one in four cases in more developed countries and shows a much higher degree of geographical aggregation in Eastern Asia and sub-Saharan Africa than HCV. These estimates help set priorities for liver cancer prevention. High-coverage HBV vaccination will be transformational in HBV-endemic countries but the prevention of HCV transmission and the treatment of chronic carriers of both viruses requires new scalable solutions.