The present study aims to investigate the associations among math self-efficacy, parenting style, and math anxiety in primary school children. The sample comprised 400 participants, aged between 10 and 11 years old, from an elementary school in China. Participants completed three self-reported questionnaires on math anxiety, parenting styles and math self-efficacy. The results revealed that rejection was strongly and positively correlated with math anxiety, while emotional warmth was negatively related to math anxiety. Interestingly, math anxiety was found to be related to rejection, with math self-efficacy playing a mediating role in this relationship. Conversely, math self-efficacy played a mediating role in the relationship between parenting styles and math anxiety, while over protection exhibited no significant correlation with math anxiety. The study also showed that gender differences existed in the level of math anxiety and math self-efficacy, with boys exhibiting lower math anxiety and higher math self-efficacy than girls. These results provide important insights into the development and treatment of math anxiety in primary school children. Specifically, parents and educators should focus on enhancing children’s math self-efficacy beliefs, while adopting a parenting style characterized by emotional warmth and low levels of rejection.