Background: Urinary stones are a major problem world, and their incidence has increased significantly in recent years. Objectives: This study aimed to develop a simple and rapid molecular method based on PCR and qPCR assays to detect Oxalobacter formigenes (which causes oxalate degradation in intestines) in fecal samples of healthy volunteers and patients with calcium oxalate nephrolithiasis, and determine the amount of urinary oxalate in the two groups. Methods: This study was performed on urine and fecal samples of 73 patients with kidney stones and 52 healthy individuals. After DNA extraction, PCR and qPCR assays were performed on two gene regions of Oxalobacter formigenes, OXC, and FRC. Also, urine oxalate was measured in the study population using biochemical methods. Results: We found that the presence of Oxalobacter formigenes could reduce the risk of kidney stones and calcium oxalate stones. In fact, both FRC and OXC genes were involved in the diagnosis of Oxalobacter formigenes; however, the results based on the FRC gene showed higher efficiency. In addition, the presence or absence of stones did not affect the amount of urinary excretion of oxalate, rather it is affected by diet. Conclusions: Molecular identification of Oxalobacter formigenes by PCR and qPCR assays allows rapid, specific, and reproducible detection in fecal samples, which also allows immediate processing of these samples in clinical conditions.