This study explores the mechanism through which online social support influences prosocial behavior among adolescents, with a particular focus on the mediating role of moral identity. Employing a convenience sampling method, approximately 300 adolescents from a middle school were selected as research participants, resulting in 250 valid questionnaires being collected. The research instruments included a Basic Information Questionnaire for Students, the Online Social Support Scale, the Prosocial Behavior Questionnaire, and the Moral Identity Scale. The results indicate a significant positive correlation between online social support and adolescents’ prosocial behavior, with online social support also significantly predicting moral identity positively. Further regression analysis revealed that moral identity partially mediates the relationship between online social support and adolescents’ prosocial behavior. Collinearity diagnostics confirmed the absence of multicollinearity among variables, facilitating the mediation analysis. Limitations of the study include potential biases inherent to self-reporting methods and the restricted sample selection, suggesting future research should broaden the sample scope and incorporate diverse data collection methodologies. This research provides empirical evidence on how online social support influences adolescents’ prosocial behavior through moral identity, offering theoretical and practical insights for fostering positive development in adolescents and the beneficial impacts of online environments.