The study aimed to predict hernia risk in peritoneal dialysis (PD) patients using machine learning models and SHAP interpretability analysis. It included 1144 patients with PD from 2010–2024, divided into a training cohort (n=800) and an external validation (n=344). They developed nine ML models, the best being Random Forest (RF) with a training AUC of 97.99% and a validation AUC of 93.66%. RF identified nine major risk factors: abdominal circumference, smoking, history of smoking, history of COPD, and CAPD modality. SHAP analysis explained the non-linear effects of these factors. They developed an online tool on R Shiny that enables real-time risk calculation, risk stratification and personalized recommendations. The RF model achieves high accuracy and interpretability, thus facilitating early intervention and improving patient prognosis.