Background: Although nilotinib hepatotoxicity can cause severe clinical conditions and may alter treatment plans, risk factors affecting nilotinib-induced hepatotoxicity have not been investigated. This study aimed to elucidate the factors affecting nilotinib-induced hepatotoxicity. Methods: This retrospective cohort study was performed on patients using nilotinib from July of 2015 to June of 2020. We estimated the odds ratio and adjusted odds ratio from univariate and multivariate analyses, respectively. Several machine learning models were developed to predict risk factors of hepatotoxicity occurrence. The area under the curve (AUC) was analyzed to assess clinical performance. Results: Among 353 patients, the rate of patients with grade I or higher hepatotoxicity after nilotinib administration was 40.8%. Male patients and patients who received nilotinib at a dose of ≥300 mg had a 2.3-fold and a 3.5-fold increased risk for hepatotoxicity compared to female patients and compared with those who received <300 mg, respectively. H2 blocker use decreased hepatotoxicity by 11.6-fold. The area under the curve (AUC) values of machine learning methods ranged between 0.61–0.65 in this study. Conclusion: This study suggests that the use of H2 blockers was a reduced risk of nilotinib-induced hepatotoxicity, whereas male gender and a high dose were associated with increased hepatotoxicity.