Managing saltwater intrusion (SWI) in coastal aquifers is critical for safeguarding freshwater quality and ensuring sustainable water resources. This study evaluates the performance of eight machine learning (ML) models in predicting the SWI wedge length ratio (L/Lo) in sloping coastal aquifers. The assessed models encompassed linear, bagging, boosting, and advanced gradient boosting-based approaches, enabling a comprehensive comparison of their predictive capabilities. First, a numerical dataset of 450 samples was compiled, incorporating key dimensionless input variables such as relative density, hydraulic conductivity ratio, bed slope, and recharge well properties. The dataset was split into training and testing subsets in a 70:30 ratio, and model hyperparameters were optimized using Bayesian Optimization (BO). A thorough evaluation was conducted to identify the best-performing predictive model. Results showed that the Extreme Gradient Boosting (XGB) model demonstrated superior predictive accuracy compared to all other models, achieving low root-mean-square-error (RMSE) values of 0.0216 during training and 0.0331 during testing, along with high R2 scores of 0.9801 and 0.9586, respectively. The Categorical Gradient Boosting (CGB) model also exhibited strong performance, with RMSE values of 0.0271 (training) and 0.0316 (testing). SHapley Additive exPlanations (SHAP) analysis revealed that the relative recharge well rate was the most influential predictor, followed by recharge well distance and depth. To facilitate practical application, desktop and web-based graphical user interfaces (GUIs) were developed, allowing users to input variables and effortlessly predict L/L₀. This study demonstrates the effectiveness of ML models in predicting SWI in sloping coastal aquifers and provides user-friendly tools for engineers and researchers.