The present study aimed to examine the relationship between parental structure, parental chaos, and homework anxiety among elementary school students, as well as the mediating roles of autonomous and controlled motivation in relation to homework. A total of 1,118 elementary school students from grades 4 to 6 completed the Parents as Social Context Questionnaire, Homework Anxiety Scale, and Homework Motivation Scale. Results indicated that parental structure was negatively associated with homework anxiety in elementary school students, while parental chaos exhibited a positive correlation with such anxiety; furthermore, both homework autonomous and controlled motivation mediated the relationship between parental structure and chaos with homework anxiety. Specifically, a structured parenting environment could mitigate homework anxiety by enhancing students' autonomous motivation; conversely, chaotic parenting environments were associated with increased homework anxiety through heightened controlled motivation while simultaneously diminishing autonomous motivation. These findings offer novel insights into alleviating homework-related anxiety among elementary school students and provide empirical support for developing educational interventions focused on parenting practices.