Patients with inflammatory bowel disease (IBD) have a higher risk of developing colorectal cancer (CRC). Glycolysis is involved in the development of both IBD and CRC. However, the mechanisms and outcomes of glycolysis shared between IBD and CRC remain unclear. This study aimed to explore the glycolytic cross-talk genes between IBD and CRC integrating bioinformatics and machine learning. With WGCNA, LASSO, COX, and SVM-RFE algorithms, P4HA1 and PMM2 were identified as glycolytic cross-talk genes. The independent risk signature of P4HA1 and PMM2 was constructed to predict the overall survival rate of patients with CRC. The risk signature correlated with clinical characteristics, prognosis, tumor microenvironment, immune checkpoint, mutants, cancer stemness, and chemotherapeutic drug sensitivity. CRC patients with high risk have increased microsatellite instability, tumor mutation burden. The nomogram integrating risk score, tumor stage, and age showed high accuracy for predicting overall survival rate. In addition, the diagnostic model for IBD based on P4HA1 and PMM2 showed excellent accuracy. Finally, immunohistochemistry results showed that P4HA1 and PMM2 were significantly upregulated in IBD and CRC. Our study reveals the presence of glycolytic cross-talk genes P4HA1 and PMM2 between IBD and CRC. This may prove to be beneficial in advancing research on the mechanism of development of IBD-associated CRC.Supplementary InformationThe online version contains supplementary material available at 10.1007/s10142-023-01170-5.