To provide more accurate and reliable predictions of the shear strength of ultrahigh-performance concrete (UHPC) beams, in this study, the machine learning (ML) approaches were employed to develop the data-driven models, and the ML models were interpreted using the Shapley additive explanations (SHAP) method. It was found that the ensemble models, particularly CatBoost, outperform individual ML models and traditional empirical models. The geometric dimensions and shear span-to-depth ratio were the most influential features for predicting the shear strength of UHPC beams, followed by the parameters of reinforcement and material properties of the UHPC.