Background. This study is aimed at identifying unknown clinically relevant genes involved in colorectal cancer using bioinformatics analysis. Methods. Original microarray datasets GSE107499 (ulcerative colitis), GSE8671 (colorectal adenoma), and GSE32323 (colorectal cancer) were downloaded from the Gene Expression Omnibus. Common differentially expressed genes were filtered from the three datasets above. Gene Ontology and Kyoto Encyclopedia of Genes and Genomes pathway enrichment analyses were performed, followed by construction of a protein-protein interaction network to identify hub genes. Kaplan-Meier survival analysis and TIMER database analysis were used to screen the genes related to the prognosis and tumour-infiltrating immune cells of colorectal cancer. Receiver operating characteristic curves were used to assess whether the genes could be used as markers for the diagnosis of ulcerative colitis, colorectal adenoma, and colorectal cancer. Results. A total of 237 differentially expressed genes common to the three datasets were identified, of which 60 were upregulated, 125 were downregulated, and 52 genes that were inconsistently up- and downregulated. Common differentially expressed genes were mainly enriched in the cellular component of extracellular exosome and integral component of membrane categories. Eight hub genes, i.e., CXCL3, CXCL8, CEACAM7, CNTN3, SLC1A1, SLC16A9, SLC4A4, and TIMP1, were related to the prognosis and tumour-infiltrating immune cells of colorectal cancer, and these genes have diagnostic value for ulcerative colitis, colorectal adenoma, and colorectal cancer. Conclusion. Three novel genes, CNTN3, SLC1A1, and SLC16A9 were shown to have diagnostic value with respect to the occurrence of colorectal cancer and should be verified in future studies.