BackgroundColorectal cancer (CRC) is a heterogeneous disease, with subtypes that have different clinical behaviours and subsequent prognoses. There is a growing body of evidence suggesting that right-sided colorectal cancer (RCC) and left-sided colorectal cancer (LCC) also differ in treatment success and patient outcomes. Biomarkers that differentiate between RCC and LCC are not well-established. Here, we apply random forest (RF) machine learning methods to identify genomic or microbial biomarkers that differentiate RCC and LCC.MethodsRNA-seq expression data for 58,677 coding and non-coding human genes and count data for 28,557 human unmapped reads were obtained from 308 patient CRC tumour samples. We created three RF models for datasets of human genes-only, microbes-only, and genes-and-microbes combined. We used a permutation test to identify features of significant importance. Finally, we used differential expression (DE) and paired Wilcoxon-rank sum tests to associate features with a particular side.ResultsRF model accuracy scores were 90%, 70%, and 87% with area under curve (AUC) of 0.9, 0.76, and 0.89 for the human genomic, microbial, and combined feature sets, respectively. 15 features were identified as significant in the model of genes-only, 54 microbes in the model of microbes-only, and 28 genes and 18 microbes in the model with genes-and-microbes combined.PRAC1expression was the most important feature for differentiating RCC and LCC in the genes-only model, withHOXB13,SPAG16,HOXC4, andRNLSalso playing a role.Ruminococcus gnavusandClostridium acetireducenswere the most important in the microbial-only model.MYOM3,HOXC4,Coprococcus eutactus,PRAC1, lncRNA AC012531.25,Ruminococcus gnavus,RNLS,HOXC6,SPAG16andFusobacterium nucleatumwere most important in the combined model.ConclusionsMany of the identified genes and microbes among all models have previously established associations with CRC. However, the ability of RF models to account for inter-feature relationships within the underlying decision trees may yield a more sensitive and biologically interconnected set of genomic and microbial biomarkers.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12885-023-10848-9.