Ulcerative colitis (UC) is characterized by an abnormal immune response, and the pathogenesis lacks clear understanding. The cGAS-STING pathway is an innate immune signaling pathway that plays a significant role in various pathophysiological processes. However, the role of the cGAS-STING pathway in UC remains largely unclear. In this study, we obtained transcriptome sequencing data from multiple publicly available databases. cGAS-STING related genes were obtained through literature search, and differentially expressed genes (DEGs) were analyzed using R package limma. Hub genes were identified through protein–protein interaction (PPI) network analysis and module construction. The ConsensuClusterPlus package was utilized to identify molecular subtypes based on hub genes. The therapeutic response, immune microenvironment, and biological pathways of subtypes were further investigated. A total of 18 DEGs were found in UC patients. We further identified IFI16, MB21D1 (CGAS), TMEM173 (STING) and TBK1 as the hub genes. These genes are highly expressed in UC. IFI16 exhibited the highest diagnostic value and predictive value for response to anti-TNF therapy. The expression level of IFI16 was higher in non-responders to anti-TNF therapy. Furthermore, a cluster analysis based on genes related to the cGAS-STING pathway revealed that patients with higher gene expression exhibited elevated immune burden and inflammation levels. This study is a pioneering analysis of cGAS-STING pathway-related genes in UC. These findings provide new insights for the diagnosis of UC and the prediction of therapeutic response.