As an inflammatory bowel disease, ulcerative colitis (UC) does not respond well to current treatments. It is of positive clinical significance to further study the pathogenesis of UC and find new therapeutic targets. B lymphocytes play an important role in the pathogenesis of UC. The effect of anti-CD20 therapy on UC also provides new evidence for the involvement of B cells in UC process additionally, suggesting the important role and potential therapeutic value of B cells in UC. In this study, we screened the most critical immune cell-related gene modules associated with UC and found that activated B cells were closely related to the gene modules. Subsequently, key activated B cell-associated gene (BRG) signatures were obtained based on WGCNA and differential expression analysis, and three overlapping BRG-associated genes were obtained by RF and LASSO algorithms as BRG-related diagnostic biomarkers for UC. Nomogram model was further performed to evaluate the diagnostic ability of BRG-related diagnostic biomarkers, subsequently followed by UC molecular subsets identification and immunoinfiltration analysis. We also further verified the expressions of the three screened BRGs in vitro by using an LPS-induced NCM460 cell line model. Our results provide new evidence and potential intervention targets for the role of B cells in UC from a new perspective.