IntroductionIn today's world, which is progressively oriented towards science and technology and facing a growing demand for skilled professionals, it becomes essential to identify the factors that encourage individuals to pursue careers in STEM fields (Science, Technology, Engineering and Mathematics). Previous research has shown that affective‐motivational factors, math performance and gender influence STEM occupational and academic choices in adulthood. However, few studies examined how these factors may influence STEM choices as early as middle school. This study aims to assess how math anxiety, math self‐efficacy, math performance and gender influence STEM school choices during middle school.MethodsWe longitudinally assessed a group of 109 students (Year 6) over three school years, with measurements taken on three different occasions.ResultsFindings indicated that individuals who made an STEM school choice experienced lower math anxiety, higher self‐efficacy and math performance and were predominantly male. Furthermore, the results indicated that both math anxiety in Year 7 and self‐efficacy in Year 6 made the most substantial unique contributions to the STEM school choice.ConclusionMath anxiety and math self‐efficacy seem to be both crucial in influencing middle school students' STEM choices, offering new perspectives for early interventions aimed at promoting more informed school choices.