Purpose: To validate the use of International Classification of Diseases, Tenth Revision, Clinical Modification (ICD-10-CM) codes to identify patients with chronic hepatitis B virus (HBV) and hepatitis C virus (HCV) infection in the Taiwan National Health Insurance (NHI) Outpatient Claims Dataset. Methods: We conducted a retrospective study using results of HBV surface antigen (HBsAg), HBV e antigen (HBeAg), and anti-HCV antibody tests in the NHI Lab & Exam Dataset from January 1 to March 31, 2018, as the reference standard to confirm HBV and HCV infection cases. We calculated sensitivity, specificity, positive predictive value (PPV), and negative predictive value (NPV) to assess the performance of HBV infection-specific ICD-10-CM codes (B180, B181, and B191) and HCV infection-specific ICD-10-CM codes (B182 and B192) recorded in the NHI Outpatient Claims Dataset to identify patients with HBV or HCV infection. Results: In total, 196,635 and 120,628 patients had analyzable results for HBsAg/HBeAg tests and anti-HCV tests, respectively. Moreover, 44,574 and 14,443 were confirmed to have HBV and HCV infection, respectively. The sensitivity, specificity, PPV, and NPV were, respectively, 46%, 83%, 45%, and 84% for HBV infection-specific ICD-10-CM codes and 47%, 99%, 81%, and 93% for HCV infection-specific ICD-10-CM codes. The sensitivity demonstrated great variation by region, clinical setting, and physician specialty. Conclusion: The HBV and HCV infection-specific ICD-10-CM codes recorded by physicians in Taiwan NHI outpatient claims data in 2018 had moderate sensitivity and high specificity for both HBV and HCV infection. The PPV was high for HCV ICD-10-CM codes, yet moderate for HBV ICD-10-CM codes.