Background and Aims Differentiating biliary atresia (BA) from idiopathic neonatal hepatitis (INH) is vital in routine pediatric practice. However, on liver biopsy, few cases offer a diagnostic challenge to discriminate these entities with certainty. Bile ductular reaction (DR), intermediate hepatobiliary cells (IHBC) and extra-portal ductules (EPD) indicate progenitor cell activation, as a response to various hepatic insults. The present study aims to quantify DR, IHBC and EPD by Keratin 7 (CK7) immunohistochemistry (IHC) in BA and INH and to devise a mathematical approach to better differentiate the two, especially in histologically equivocal cases. Methods A total of 98 cases were categorized on biopsy as BA, INH or equivocal histology, favoring BA or INH. CK7 DR mean, IHBC mean and EPD mean values were compared between BA and INH. A formula was derived to help distinguish these two entities, the cut-off value, sensitivity and specificity of which were determined by receiver operating characteristic (ROC) curve. This formula was applied and validated on histologically equivocal cases. Results Univariate logistic regression revealed significant difference between BA and INH with respect to CK7 DR and CK7 EPD mean (p < 0.001 in both); however, CK7 IHBC mean was not significant (p = 0.08). On multivariate logistic regression, only CK7 DR had significant impact on diagnosis (p < 0.001). A formula: (CK7 DR) 2 + (CK7 EPD)/(CK7 IHBC) was derived to help distinguish BA from INH. Cut off value of 10.5 and above, determined by ROC curve, favored a diagnosis of BA (sensitivity= 93.4%, specificity= 94.6%). Histologically equivocal and discrepant cases could be correctly categorized using this formula. Conclusions Formula using CK7 IHC parameters may aid pathologists better distinguish BA from INH, especially in histologically equivocal cases.