Ultra-high-performance concrete (UHPC) is a sustainable, durable, and strong material. In this work, 359 experimental data are used for predicting its compressive strength (CS) using machine learning (ML). OPC, fly ash, blast furnace slag, coarse and fine aggregates, water, superplasticizers, and curing age were among the variables used in the mixed designs. Different model analysis parameters like mean absolute error (MAE), root mean square error (RMSE), coefficient of efficiency (CE), and coefficient of determination (R2) were used to assess four models such as Extreme Gradient Boosting (XGBoost), Gradient Boosting (GB), Categorical Boosting (CatBoost), and Extra Trees. SHAP (Shapley Additive Explanations) and PDP (Partial Dependency Plot) analysis, the most important variables affecting strength were water, OPC, coarse aggregates, and curing age were measured. Reliability was attained and 10-fold cross-validation was used to avoid overfitting. Feature analysis and model comparisons provide useful information for improving UHPC performance and composition. The study provides insightful suggestions for improving UHPC mix design and enhancing sustainability through the use of industrial byproducts.