Anti-tumour necrosis factor-α (TNF-α) is used for treatment of severe cases of inflammatory bowel diseases (IBD), including Crohn's disease (CD) and ulcerative colitis (UC). However, one-third of the patients do not respond to the treatment. A recent study indicated that genetically determined high activity of pro-inflammatory cytokines, including interleukin-1β (IL-1β), IL-6 and interferon gamma (IFN-γ), are associated with non-response to anti-TNF therapy. Using a candidate gene approach, 21 functional single-nucleotide polymorphisms (SNPs) in 14 genes in the Toll-like receptors, the inflammasome and the IFNG pathways were assessed in 482 and 256 prior anti-TNF naïve Danish patients with CD and UC, respectively. The results were analysed using logistic regression (adjusted for age and gender). Eight functional SNPs were associated with anti-TNF response either among patients with CD (TLR5 (rs5744174) and IFNGR2 (rs8126756)), UC (IL12B (rs3212217), IL18 (rs1946518), IFNGR1 (rs2234711), TBX21 (rs17250932) and JAK2 (rs12343867)) or in the combined cohort of patient with CD and UC (IBD) (NLRP3 (rs10754558), IL12B (rs3212217) and IFNGR1 (rs2234711)) (P < 0.05). Only the association with heterozygous genotype of IL12B (rs3212217) (OR: 0.24, 95% CI: 0.11-0.53, P = 0.008) among patients with UC withstood Bonferroni correction for multiple testing. In conclusion, Our results suggest that SNPs associated with genetically determined high activity of TLR5 among patients with CD and genetically determined high IL-12 and IL-18 levels among patients with UC were associated with non-response. Further studies will evaluate whether these genes may help stratifying patients according to the expected response to anti-TNF treatment.