BackgroundOral ulceration is a common, painful condition of uncertain aetiology. Ulcers are characterised by immune-mediated mucosal destruction, inflammation, and a proliferative healing phase. Oral ulceration is heritable but the genetic basis remains poorly characterised. We aimed to identify genetic risk factors for oral ulcers, and find evidence for a common genetic basis or causal association between oral ulceration and autoimmune traits. MethodsA genome-wide association study was performed within the UK Biobank and replicated within the Avon Longitudinal Study of Parents and Children (ALSPAC). Outcome in UK Biobank, based on questionnaire data at recruitment (participants aged 40–73 years), was oral ulceration in the previous year. Outcome in ALSPAC, based on questionnaire data from a focus clinic (16–19 years), was ever having oral ulceration. Bidirectional causal effects were estimated with two-sample mendelian randomisation. FindingsAfter exclusions and quality control measures, the genome-wide association study included 119 959 individuals and 9 341 558 genetic variants. The genomic inflation factor (λ) was 1·047. Replication included 2024 individuals. For ulcers, evidence for association was seen in or near IL12A1 (rs17753641, odds ratio 0·969 [95% CI 0·966–0·973], p=2·2E−62 in discovery; 0·72 [0·56–0·92], p=0·01 replication), IL10 (rs3024490, 1·015 [1·012–1·018], p=1·1E−25 in discovery; 1·42 [1·18–1·70], p=0·0001 replication), CCR3 (rs6441955, p=2·4E−17 in discovery; unreplicated). Other variants were nominated in the discovery phase but not replicated in ALSPAC, including variants near HLA-DRB5 (rs11623911, p=1·1E−13), PPP5C (rs8106592, p=4·2E−10) and IKZF1 (rs9649738, p=2·2E−08). When genotypes were used as a proxy for oral ulceration to investigate the impact of oral ulceration on autoimmune outcomes, evidence showed that oral ulceration reduced risk of Crohn's disease (p=0·0037). In a genome-wide analysis no genetic correlation between ulcers and autoimmune traits was seen. InterpretationVariation in loci thought to regulate inflammatory function alters risk of oral ulceration. Oral ulceration appears to be a distinct inflammatory trait rather than a manifestation of other autoimmune diseases. The apparent protective effect of oral ulceration against Crohn's disease is unexpected; this might be a biological effect—for example, divergence in inflammatory type could prevent both conditions from copresenting—or an artifactual finding. FundingUK Biobank was established by the Wellcome Trust, Medical Research Council, Department of Health, Scottish Government, and the Northwest Regional Development Agency. It has also had funding from the Welsh Assembly Government, British Heart Foundation, and Diabetes UK. The Avon Longitudinal Study of Parents and Children receives core support from the Medical Research Council, Wellcome Trust (grant ref 102215/2/13/2), and University of Bristol.