The antibiotic dicloxacillin has been shown to induce drug-metabolizing CYP enzymes to a clinically relevant extent. In this study, we investigated whether the use of dicloxacillin confers an increased risk of unwanted pregnancy among oral contraceptive users. The study population comprised Danish women falling pregnant (1997–2015) during oral contraceptive use, defined as having filled a prescription for an oral contraceptive within 120 days both before and after the estimated date of conception. Data were analysed using a case-crossover approach. For each woman, we assessed the use of dicloxacillin preceding the date of conception and during 10 previous control periods and estimated the odds ratio for such unintended pregnancies associated with the use of dicloxacillin. Among 364 women using dicloxacillin prior to conception, 40 (11%) were exposed to dicloxacillin at the time of conception, yielding an odds ratio (OR) associating use of dicloxacillin to unintended pregnancy of 1.18 (95% CI 0.84–1.65). Supplementary and sensitivity analyses generally returned similar estimates, except for a slightly increased risk among users of progestogen-only oral contraceptives (OR 1.83, 95% CI 0.63–5.34). Analysis of other antibiotics as negative controls yielded results close to unity (ORs ranging from 0.83 to 1.13). In conclusion, our study found no evidence for an increased risk of oral contraceptive failure when using dicloxacillin. However, acknowledging study limitations, we suggest the use of supplementary barrier methods during treatment with dicloxacillin, until our findings are confirmed in further studies.