PurposeThis study aimed to examine the moderating effect of math anxiety and the mediating role of self-efficacy on the nexus between cognitive awareness and student math performance.Design/methodology/approachThe current study adopted a descriptive-correlational design utilizing a structured questionnaire. The study data was obtained from undergraduate students pursuing a bachelor of science in mathematics Education with a total of 2,672 students and a sample size of 348 students using purposive, stratified and simple random sampling techniques and analyzed using structure equation modeling (SEM) run from Amos Graphics (ver. 23).FindingsThis study's findings revealed that cognitive awareness and student self-efficacy had positively influenced math performance. Moreover, cognitive awareness had a positive direct and statistically significant effect on self-efficacy. Moreover, students' self-efficacy partially mediates the nexus between cognitive awareness and math performance. Finally, math anxiety positively moderates the nexus between cognitive awareness and math performance.Practical implicationsBased on this study's findings, teachers should encourage students to keep math journals where they record their thoughts, strategies and reflections on problem-solving approaches to enhance their awareness of their cognitive processes. Moreover, self-efficacy should be strengthened through mastery experiences, positive feedback and promoting a growth mindset. Ultimately, boosting self-efficacy will lead to better math performance, creating a positive cycle of confidence and achievement.Originality/valueThere is a shortage of empirical studies that examine how math anxiety moderates and self-efficacy mediates the nexus between cognitive awareness and student math performance. Moreover, the concept of this paper can provide a new look into the interplay between cognitive awareness, math anxiety, self-efficacy and math performance.