Abstract Background Research has revealed that angiotensin-converting enzyme inhibitors (ACEIs) and angiotensin II receptor blockers (ARBs) may prevent cancers such as hepatocellular carcinoma (HCC). The comparative chemopreventive effects of ACEIs and ARBs in high-risk populations with hepatitis B virus (HBV) or hepatitis C virus (HCV) infection have yet to be investigated. Methods From 2005 to 2014, high-risk HBV and HCV cohorts of hypertensive patients without HCC history were recruited from three linked national databases of Taiwan, and were classified into two groups based on the ACEI or ARB exposure within the initial six months after initiating antiviral agent. Intergroup differences in clinical characteristics and duration of drug exposure within study period were evaluated. HCC-free survival was compared using the log-rank test. Multivariate Cox regression including time-dependent variables for the use of ACEIs or ARBs and other medications was applied to adjust for confounders. Results Among the 7724 patients with HBV and 7873 with HCV, 46.3% and 42.5%, respectively, had an initial exposure to ACEIs or ARBs. The median durations of exposure were 36.4 and 38.9 months for the HBV and HCV cohorts, respectively. The median durations of ACEI or ARB use during study period between initial exposure and nonexposure groups were 41.8 vs. 18.3 months and 46.4 vs. 22.7 months for the HBV and HCV cohorts, respectively. No significant difference was observed in HCC risk within 7 years between the initial exposure and non-exposure groups. After adjustment for comorbidities, namely liver cirrhosis, diabetes mellitus (DM), and hyperlipidemia, and medications, namely aspirin, metformin, and statins, the hazard ratios (HRs) for ACEI or ARB exposure for HCC risk were 0.97 (95% confidence interval [CI]: 0.81–1.16) and 0.96 (0.80–1.16) in the HBV and HCV cohorts, respectively. In the HCV cohort, the increased HCC risk was associated with ACEI or ARB use in patients without cirrhosis, DM, and hyperlipidemia (HR: 4.53, 95% CI: 1.46–14.1). Conclusion Compared with other significant risk and protective factors for HCC, ACEI or ARB use in the HBV and HCV cohorts was not associated with adequate protective effectiveness under standard dosages and may not be completely safe.