Kidney stones are a common and frequently occurring disease worldwide. Stones can cause urinary tract obstruction, pain, haematuria, and other symptoms. In this study, the relationship between calcium oxalate renal calculi and gut microbiota was considered. The dietary habits of 30 patients with calcium oxalate kidney stones and 30 healthy people were investigated. The 16S rDNA sequences and short-chain fatty acids (SCFAs) in their stool samples were analysed. We identified 5 genera of the gut microbiota as biomarkers for calcium oxalate renal calculi, namely, Bacteroides, Phascolarctobacterium, Faecalibacterium, Akkermansia, and Lactobacillus, with a receiver operating characteristic (ROC) curve value of 0.871 (95% confidence interval (CI) 0.785-0.957). Phascolarctobacterium and Faecalibacterium showed a positive relationship with SCFA synthesis to reduce the risk of kidney stones. Meanwhile, according to the analysis, Lactobacillus spp. made the largest contribution (79%) to prevent kidney stones caused by tea consumption, since tea offers the great parts of oxalate in kidney stone formation. Three strains of Lactobacillus spp. were isolated from stools of a healthy person with a high level of tea consumption who did not suffer from kidney stones. All these strains survived in the colon with supplementation of high concentrations of tea and efficiently degraded oxalic acid (Ca. 50%) in an in vitro colonic simulation. Therefore, a suitable adjustment of the gut microbiota or SCFA concentration enhanced the degradation of oxalate from food, which can be applied to prevent the formation of calcium oxalate renal calculi caused by tea. KEY POINTS: • Five genera, including Lactobacillus, were identified as biomarkers for calcium oxalate renal calculi. • Lactobacillus is a potential gut bacterium associated with preventing kidney stone formation. • Isolated Lactobacillus strains have the ability to degrade oxalic acid in vitro.