Genome-wide association studies efficiently and powerfully assay common genetic variation. The application of these studies to Crohn's disease has provided insight into the immunopathogenesis of this disease, implicating a role for genes of the innate and adaptive immune systems. In this Review, I discuss our current understanding of the genetics and immunopathogenesis of Crohn's disease and ulcerative colitis. Crohn's disease, but not ulcerative colitis, is associated with genetic variation in NOD2 and an autophagy gene, ATG16L1, both of which affect the intracellular processing of bacterial components. By contrast, variation in the gene encoding the interleukin-23 (IL-23) receptor subunit, as well as in the IL12B, STAT3 and NKX2-3 gene regions, is associated with both Crohn's disease and ulcerative colitis. Comparative analyses of gene associations between these two inflammatory bowel diseases reveal common and unique mechanisms of their immunopathogenesis.