Previous research has suggested a potential link between folic acid (FA) supplementary therapy and gastric ulcers (GU). To investigate this relationship further, we conducted a Mendelian randomisation (MR) analysis using data from the UK Biobank. Our analysis primarily employed inverse-variance weighted (IVW) methods, including both fixed-effect and random-effect models. To ensure the robustness of our findings, additional methods such as the simple median, the weighted median and the penalised weighted median were also applied. The MR analysis aimed to explore the causal effect of FA supplementary therapy on GU. Seven SNP at genetic loci associated with FA supplementary therapy were identified. Both the random-effect and fixed-effect IVW models indicated that genetically predicted FA supplementary therapy significantly reduced the risk of GU (OR, 0·870; 95 % CI 0·826, 0·917, P < 0·001). This result was consistent across other methods, with similar outcomes observed using the simple median (OR, 0·835; 95 % CI 0·773, 0·901, P < 0·001), the weighted median (OR, 0·854; 95 % CI 0·794, 0·919, P < 0·001) and the penalised weighted median (OR, 0·849; 95 % CI 0·789, 0·914, P < 0·001). Leave-one-out sensitivity analysis confirmed that no individual SNP significantly drove the association between FA supplementary therapy and GU. This MR study provides genetic evidence that FA supplementary therapy may decrease the risk of GU.