Current genetic research of nonalcoholic steatohepatitis (NASH) cirrhosis is limited by our ability to accurately identify cases on a large scale. Our objective was to develop and validate an electronic health record (EHR) algorithm to accurately identify cases of NASH cirrhosis in the EHR. We used Clinical Query 2, a search tool at Beth Israel Deaconess Medical Center, to create a pool of potential NASH cirrhosis cases (n = 5415). We created a training set of 300 randomly selected patients for chart review to confirm cases of NASH cirrhosis. Test characteristics of different algorithms, consisting of diagnosis codes, laboratory values, anthropomorphic measurements, and medication records, were calculated. The algorithms with the highest positive predictive value (PPV) and the highest F score with a PPV ≥ 80% were selected for internal validation using a separate random set of 100 patients from the potential NASH cirrhosis pool. These were then externally validated in another random set of 100 individuals using the research patient data registry tool at Massachusetts General Hospital. The algorithm with the highest PPV of 100% on internal validation and 92% on external validation consisted of ≥ 3 counts of "cirrhosis, no mention of alcohol" (571.5, K74.6) and ≥ 3 counts of "nonalcoholic fatty liver" (571.8-571.9, K75.81, K76.0) codes in the absence of any diagnosis codes for other common causes of chronic liver disease. We developed and validated an EHR algorithm using diagnosis codes that accurately identifies patients with NASH cirrhosis.