Mathematics is a crucial yet challenging subject for all students. Therefore, it is important to understand the role of academic resilience in mathematics, which enables students to overcome academic challenges. This study applied two machine learning algorithms, Lasso Regression (LR) and Random Forest (RF), to predict the mathematics literacy of resilient students from high-performing economies across cultures in PISA 2022. The findings indicated both RF and LR performed better in Western cultures than in Eastern cultures. Furthermore, in Eastern cultures, mathematics self-efficacy for 21st-century skills played an important role in predicting resilient students’ mathematics literacy, followed by self-efficacy towards mathematics, and mathematics anxiety. In Western cultures, self-efficacy towards mathematics was the predominant predictor, followed by mathematics self-efficacy for 21st-century skills. Theoretically, this study identifies key factors in predicting resilient students’ mathematics literacy across cultures. Methodologically, it is the first to apply ML in exploring resilient students’ mathematics literacy. Practically, it guides educators interested in developing interventions to improve resilient students’ mathematics literacy.