The main objective of this research is to propose two ensemble machine learning models, namely random forest (RF) and adaptive gradient boosting (AGB), for predicting the compressive strength of ultra-high-performance concrete (UHPC). These models are developed based on a total of 810 experimental results of the compressive strength of UHPC collected from published articles. The predicted results from the RF and AGB are evaluated and compared through three conventional metrics, including the coefficient of determination (R2), mean absolute error (MAE), and root-mean-square error (RMSE). The obtained results demonstrate that the RF model reached high accuracy and reliability with R2, MAE, and RMSE values of 0.97, 4.30, and 5.92 for training and 0.93, 7.33, and 9.74 for testing, respectively. The RF model outperforms the AGB model in predicting the compressive strength of UHPC. Additionally, the effect of input variables on the anticipated compressive strength of the UHPC is determined using the SHapley additive explanations (SHAP) method. It was found that age, silica fume, and fiber are the most sensitive variables, whereas fly ash is the least sensitive to the compressive strength of the UHPC. Eventually, a user-friendly web application (UWA) tool is designed based on the proposed RF model to help quickly predict the compressive strength of the UHPC in practical implementation. © The Author(s), under exclusive licence to Springer Nature Switzerland AG 2024.