Interleukin-12 (IL-12) and interleukin-23 (IL-23), which belong to the IL-12 family of cytokines, have a key role in intestinal homeostasis and inflammation and are implicated in the pathogenesis of inflammatory bowel disease. Upon their secretion by antigen-presenting cells, they exert both pro-inflammatory and anti-inflammatory receptor-mediated effects. An increased understanding of these biological effects, particularly the pro-inflammatory effects mediated by IL-12 and IL-23, has led to the development of monoclonal antibodies that target a subunit common to IL-12 and IL-23 (p40; targeted by ustekinumab and briakinumab), or the IL-23-specific subunit (p19; targeted by risankizumab, guselkumab, brazikumab and mirikizumab). This Review provides a summary of the biology of the IL-12 family cytokines IL-12 and IL-23, discusses the role of these cytokines in intestinal homeostasis and inflammation, and highlights IL-12- and IL-23-directed drug development for the treatment of Crohn's disease and ulcerative colitis.