STUDY QUESTION: Is the presence or absence of certain vaginal bacteria associated with failure or success to become pregnant after an in vitro fertilization (IVF) or IVF with intracytoplasmic sperm injection (IVF-ICSI) treatment? SUMMARY ANSWER: Microbiome profiling with the use of interspace profiling (IS-pro) technique enables stratification of the chance of becoming pregnant prior to the start of an IVF or IVF-ICSI treatment. WHAT IS KNOWN ALREADY: Live-birth rates for an IVF or IVF-ICSI treatment vary between 25 and 35% per cycle and it is difficult to predict who will or will not get pregnant after embryo transfer (ET). Recently, it was suggested that the composition of the vaginal microbiota prior to treatment might predict pregnancy outcome. Analysis of the vaginal microbiome prior to treatment might, therefore, offer an opportunity to improve the success rate of IVF or IVF-ICSI. STUDY DESIGN, SIZE, DURATION: In a prospective cohort study, 303 women (age, 20-42 years) undergoing IVF or IVF-ICSI treatment in the Netherlands were included between June 2015 and March 2016. PARTICIPANTS/MATERIALS, SETTING, METHODS: Study subjects provided a vaginal sample before the start of the IVF or IVF-ICSI procedure. The vaginal microbiota composition was determined using the IS-pro technique. IS-pro is a eubacterial technique based on the detection and categorization of the length of the 16S-23S rRNA gene interspace region. Microbiome profiles were assigned to community state types based on the dominant bacterial species. The predictive accuracy of the microbiome profiles for IVF and IVF-ICSI outcome of fresh ET was evaluated by a combined prediction model based on a small number of bacterial species. From this cohort, a model was built to predict outcome of fertility treatment. This model was externally validated in a cohort of 50 women who were undergoing IVF or IVF-ICSI treatment between March 2018 and May 2018 in the Dutch division of the MVZ VivaNeo Kinderwunschzentrum Düsseldorf, Germany. MAIN RESULTS AND THE ROLE OF CHANCE: In total, the vaginal microbiota of 192 women who underwent a fresh ET could be analysed. Women with a low percentage of Lactobacillus in their vaginal sample were less likely to have a successful embryo implantation. The prediction model identified a subgroup of women (17.7%, n = 34) who had a low chance to become pregnant following fresh ET. This failure was correctly predicted in 32 out of 34 women based on the vaginal microbiota composition, resulting in a predictive accuracy of 94% (sensitivity, 26%; specificity, 97%). Additionally, the degree of dominance of Lactobacillus crispatus was an important factor in predicting pregnancy. Women who had a favourable profile as well as <60% L. crispatus had a high chance of pregnancy: more than half of these women (50 out of 95) became pregnant. In the external validation cohort, none of the women who had a negative prediction (low chance of pregnancy) became pregnant. LIMITATIONS, REASONS FOR CAUTION: Because our study uses a well-defined study population, the results will be limited to the IVF or IVF-ICSI population. Whether these results can be extrapolated to the general population trying to achieve pregnancy without ART cannot be determined from these data. WIDER IMPLICATIONS OF THE FINDINGS: Our results indicate that vaginal microbiome profiling using the IS-pro technique enables stratification of the chance of becoming pregnant prior to the start of an IVF or IVF-ICSI treatment. Knowledge of their vaginal microbiota may enable couples to make a more balanced decision regarding timing and continuation of their IVF or IVF-ICSI treatment cycles. STUDY FUNDING/COMPETING INTEREST(S): This study was financed by NGI Pre-Seed 2014-2016, RedMedTech Discovery Fund 2014-2017, STW Valorisation grant 1 2014-2015, STW Take-off early phase trajectory 2015-2016 and Eurostars VALBIOME grant (reference number: 8884). The employer of W.J.S.S.C. has in collaboration with ARTPred acquired a MIND subsidy to cover part of the costs of this collaboration project. The following grants are received but not used to finance this study: grants from Innovatie Prestatie Contract, MIT Haalbaarheid, other from Dutch R&D tax credit WBSO, RedMedTech Discovery Fund, (J.D.d.J.). Grants from Ferring (J.S.E.L., K.F., C.B.L. and J.M.J.S.S.), Merck Serono (K.F. and C.B.L.), Dutch Heart Foundation (J.S.E.L.), Metagenics Inc. (J.S.E.L.), GoodLife (K.F.), Guerbet (C.B.L.). R.K. is employed by ARTPred B.V. during her PhD at Erasmus Medical Centre (MC). S.A.M. has a 100% University appointment. I.S.P.H.M.S., S.A.M. and A.E.B. are co-owners of IS-Diagnostics Ltd. J.D.d.J. is co-owner of ARTPred B.V., from which he reports personal fees. P.H.M.S. reports non-financial support from ARTPred B.V. P.H.M.S., J.D.d.J. and A.E.B. have obtained patents 'Microbial population analysis' (9506109) and 'Microbial population analysis' (20170159108), both licenced to ARTPred B.V. J.D.d.J. and A.E.B. report patent applications 'Method and kit for predicting the outcome of an assisted reproductive technology procedure' (392EPP0) and patent 'Method and kit for altering the outcome of an assisted reproductive technology procedure' by ARTPred. W.J.S.S.C. received personal consultancy and educational fees from Goodlife Fertility B.V. J.S.E.L. reports personal consultancy fees from ARTPred B.V., Titus Health B.V., Danone, Euroscreen and Roche during the conduct of the study. J.S.E.L. and N.G.M.B. are co-applicants on an Erasmus MC patent (New method and kit for prediction success of in vitro fertilization) licenced to ARTPred B.V. F.J.M.B. reports personal fees from Advisory Board Ferring, Advisory Board Merck Serono, Advisory Board Gedeon Richter and personal fees from Educational activities for Ferring, outside the submitted work. K.F. reports personal fees from Ferring (commercial sponsor) and personal fees from GoodLife (commercial sponsor). C.B.L. received speakers' fee from Ferring. J.M.J.S.S. reports personal fees and other from Merck Serono and personal fees from Ferring, unrelated to the submitted paper. The other authors declare that they have no competing interests. TRIAL REGISTRATION NUMBER: ISRCTN83157250. Registered 17 August 2018. Retrospectively registered.