STUDY QUESTION: Does pain or volume of used contrast medium impact the effectiveness of oil-based contrast during hysterosalpingography (HSG)? SUMMARY ANSWER: In women who report moderate to severe pain during HSG, the use of oil-based contrast resulted in more ongoing pregnancies compared to the use of water-based contrast, whereas in women who reported mild or no pain, no difference in ongoing pregnancies was found. WHAT IS KNOWN ALREADY: We recently showed that in infertile women undergoing HSG, the use of oil-based contrast results in more ongoing pregnancies within 6 months as compared to the use of water-based contrast. However, the underlying mechanism of this fertility-enhancing effect remains unclear. STUDY DESIGN, SIZE, DURATION: We performed a post-hoc analysis of the H2Oil study, a multicentre randomised controlled trial (RCT) evaluating the therapeutic effect of oil- and water-based contrast at HSG. Here, we evaluated the impact of pain experienced at HSG and volume of used contrast media during HSG on ongoing pregnancy. PARTICIPANTS/MATERIALS, SETTING, METHODS: In a subset of 400 participating women, pain during HSG by means of the Visual Analogue Scale (VAS) (range: 0.0-10.0 cm) was reported, while in 512 women, we registered the volume of used contrast (in millilitres). We used logistic regression analyses to assess whether pain and volume of used contrast media modified the effect of oil-based contrast on ongoing pregnancy rates. Data were analysed according to intention-to-treat principle. MAIN RESULTS AND THE ROLE OF CHANCE: In 400 women in whom pain scores were reported, the overall median pain score was 5.0 (Interquartile range (IQR) 3.0-6.8) (oil group (n = 199) 4.8 (IQR 3.0-6.4); water group (n = 201) 5.0 (IQR 3.0-6.7); P-value 0.28). There was a significant interaction between pain (VAS ≤5 versus VAS ≥6) and the primary outcome ongoing pregnancy (P-value 0.047). In women experiencing pain (VAS ≥6), HSG with oil-based contrast resulted in better 6-month ongoing pregnancy rates compared to HSG with water-based contrast (49.4% versus 29.6%; RR 1.7; 95% CI, 1.1-2.5), while in women with a pain score ≤5, 6-month ongoing pregnancy rates were not significantly different between the use of oil- (28.8%) versus water-based contrast (29.2%) (RR 0.99; 95% CI, 0.66-1.5). In the 512 women in whom we recorded contrast, median volume was 9.0 ml (IQR 5.7-15.0) in the oil group versus 8.0 ml (IQR 5.9-13.0) in the water group, respectively (P-value 0.72). Volume of used contrast was not found to modify the effect of oil-based contrast on ongoing pregnancy (P-value for interaction 0.23). LIMITATIONS, REASONS FOR CAUTION: This was a post-hoc analysis that should be considered as hypothesis generating. The RCT was restricted to infertile ovulatory women, younger than 39 years of age and with a low risk for tubal pathology. Therefore, our results should not be generalised to infertile women who do not share these features. WIDER IMPLICATIONS OF THE FINDINGS: The underlying mechanism of the fertility-enhancing effect induced by HSG with the use of oil-based contrast remains unclear. However, these findings suggest a possible mechanistic pathway, that is increasing intrauterine pressure occurring prior to dislodging pregnancy hindering debris or mucus plugs from the proximal part of otherwise normal fallopian tubes. This information might help in the search of the underlying fertility-enhancing mechanism found by using oil-based contrast during HSG. STUDY FUNDING/COMPETING INTEREST(S): The original H2Oil RCT was an investigator-initiated study that was funded by the two academic institutions (AMC and VUmc) of the Amsterdam UMC. The funders had no role in study design, collection, analysis and interpretation of the data. K.D. reports consultancy for Guerbet. H.V. reports consultancy fees from Ferring. C.B.L. reports speakers' fees from Ferring and research grants from Ferring, Merck and Guerbet. V.M. reports receiving travel and speakers fees as well as research grants from Guerbet. B.W.M. is supported by an NHMRC Practitioner Fellowship (GNT1082548). B.W.M. reports consultancy for ObsEva, Merck KGaA and Guerbet and travel and research grants from Merck KGaA and Guerbet. The other authors do not report conflict of interests. TRIAL REGISTRATION NUMBER: The H2Oil study was registered at the Netherlands Trial Registry (NTR 3270). TRIAL REGISTRATION DATE: 1 February 2012. DATE OF FIRST PATIENT’S ENROLMENT: 3 February 2012.