Objective Social anxiety is a prevalent and serious issue among college students in China. Physical activity holds significant potential for mitigating social anxiety. Although some studies have illustrated that physical activity could prevent and alleviate social anxiety, the underlying mechanism is still unclear. The study aims to address this gap by examining both the mediating variables that influence social anxiety among college students and the moderating variables that may strengthen the effects of physical activity on social anxiety. Methods Participants were 1,401 Chinese college students (Mage = 18.51, SD = 0.84, 60.7% male) who effectively completed online questionnaires. We assessed a structural equation model examining the mediating role of body image and moderating role of self-esteem in the relationship between physical activity and social anxiety. Results (1) Physical activity was negatively correlated with social anxiety(r=-0.196, p<0.01) and positively correlated with body image (r=0.158, p<0.01) and self-esteem(r=0.161, p<0.01). Conversely, there was a positive correlation between body image and self-esteem(r=0.601, p<0.01) and a negative correlation between body image and social anxiety(r=-0.386, p<0.01). Ultimately, a negative correlation was found between self-esteem and social anxiety(r=-0.499, p<0.01). (2) Both the total effect (beta = -0.188, 95% CI = [-0.242, -0.134]) and the mediating effect of body image were significant (beta = -0.061, 95% CI = [-0.085, -0.041], the mediating effect accounting for 32.45%). (3) The results showed that the interaction term between body image and self-esteem was significantly related to social anxiety(beta=-0.074, p<0.001), indicating that self-esteem moderated the association between body image and social anxiety. According to the results of the simple slope test, for college students with higher levels of self-esteem, body image negatively predicted social anxiety(bsimple =-0.188, p < 0.001, 95% CI = [-0.252, -0.124]). However, for college students with low levels of self-esteem, body image didn't negatively predict social anxiety(b(simple) = -0.039, p = 0.265, 95% CI = [-0.109, 0.03]). Conclusions The results indicated that physical activity significantly and negatively predicted social anxiety in college students. Furthermore, the relationship between physical activity and social anxiety was significantly mediated by body image and significantly moderated by self-esteem. Specifically, higher self-esteem strengthened the connection between body image and social anxiety.