Microbiota of the reproductive tract may be associated with unexplained infertility in women. We aimed to determine the derangements of vaginal and endometrial microbiota related to unexplained infertility by real-time polymerase chain reaction (real-time PCR) microbiota analyses of vaginal and endometrial samples of the unexplained infertility patients and fertile women. Twenty-six women with unexplained infertility and 26 age-matched fertile women were included. Vaginal and endometrial samples were obtained in the mid-menstrual cycle for analysis by quantitative real-time PCR method. The proportion of lactobacilli-impaired microbiota was significantly higher in the vaginal samples of unexplained infertility patients (76.9% vs. 26.9%; p < 0.001). Those with impaired lactobacilli microbiota of vaginal samples had an increased risk of 9.048 times for infertility than those with normal lactobacilli microbiota. In addition, the mean lactobacilli/total bacterial mass (TBM) ratio in the vaginal samples was significantly lower in the unexplained infertility patients (38.2% vs.76.3%; p=0.001). The present study results supported the role of vaginal and endometrial microbiota derangements in unexplained infertility. Many time-consuming and invasive methods are currently used in the diagnosis of infertility. Our study showed that the quantitative determination of lactobacilli/TBM ratio in vaginal specimens, a less invasive and easily obtainable method, could be used as a diagnostic test during the workup of couples with unexplained infertility.