Aminotransferase level is presumed to be a marker of hepatic inflammation, but uncertainty remains whether elevated aminotransferase levels are associated with an increased risk of hepatocellular carcinoma (HCC). We evaluated the incidence of HCC by aminotransferase level in 19 812 middle-aged and older individuals with and without hepatitis virus infection from a large-scale population-based cohort study (JPHC Study cohort II) in Japan. Hepatitis virus infection was identified at baseline in 1236 participants, namely 737 (3.7%) with hepatitis C virus, 479 (2.4%) with hepatitis B virus, and 20 (0.1%) with both. By the end of follow-up, a total of 109 newly arising HCC cases were diagnosed (71 men, 38 women), of which 87 (79.8%) had evidence of viral etiology. Alanine aminotransferase (ALT) was concentration-dependently associated with an increased risk of HCC in both virus-positive and virus-negative participants. Compared with virus-negative participants with ALT levels of less than 30 IU/l, a significant increase in the risk of HCC was observed in virus-negative participants with an ALT level greater than 30 IU/l, and in virus-positive participants with an ALT less than 30 IU/l, 30–69 IU/l, and ≥70 IU/l [Hazard ratio (95% confidence interval): 9.4 (3.9–22.3), 15.2 (6.1–37.6), 180.5 (89.4–364.2), 454.2 (221.5–931.2), respectively; P for trend <0.001]. In conclusion, our findings suggest that elevated ALT levels are strongly associated with the incidence of HCC regardless of hepatitis virus positivity. This finding indicates that ALT level is a good independent determinant of the need for intervention. Clinical application of these findings may help decrease HCC-associated mortality in hepatitis virus-endemic regions.