• The direct effect of classroom learning environments on self-regulation was examined. • The mediating role of task value was assessed. • The MacKinnon’s approach using the product of coefficients was applied. Integrating Moos’s (1979) theory scheme on classroom learning environments, subjective task value, and self-regulated theories, we explore the relationships among classroom learning environments, task value, and self-regulation. We used Structural Equation Modeling (SEM) with bootstrapping estimation based on 5000 samples and data from n = 2052 students in grades 5 to 9 from public and private schools in China. The results showed that classroom learning environments (task orientation, teacher support, equity, and cooperation) positively influenced students’ task value and self-regulation. Moreover, task value was found to mediate the relationship between task orientation, teacher support, equity, cooperation, and self-regulation. We discuss the implications of these findings for research and practice in an educational context.