Previous studies have highlighted the critical role that the belief in a just world (BJW) plays in maintaining and promoting prosocial behaviors within individuals. Considered a stable personality trait, the crux of BJW lies in the conviction that individuals receive what they deserve, and deserve what they receive. Simultaneously, the relationship between BJW and prosocial behavior is impacted by an individual's sense of fairness or unfairness. However, past research has primarily focused on real-life prosocial behavior, with limited exploration into the relationship between BJW and online prosocial behavior. This study, comprising a survey and an experiment, aimed to delve deeper into this relationship. The survey section randomly selected 4212 college students to examine how BJW correlates with online prosocial behavior. Findings predominantly revealed a significant positive correlation between online prosocial behavior and BJW. Additionally, the study explored how gender and place of origin influence these behaviors. Results showed that male students and those from urban areas exhibited significantly higher online prosocial behavior. The experimental research investigated the performance differences in online prosocial behaviors among college students under different fairness scenarios, revealing that the online prosocial behavior in an unfair situation was significantly higher than in fair or neutral situations. Furthermore, in unfair situations, a significant correlation was observed between BJW and online prosocial behavior. The findings from this study significantly advance our understanding of the dynamics between BJW and online prosocial behavior among college students, emphasizing that perceived injustices can markedly enhance prosocial behaviors in virtual settings. This study underscores the profound impact of fairness perceptions and highlights the modulating effects of gender and geographical background on online interactions.