The colonic epithelium facilitates host-microorganism interactions to control mucosal immunity, coordinate nutrient recycling and form a mucus barrier. Breakdown of the epithelial barrier underpins inflammatory bowel disease (IBD). However, the specific contributions of each epithelial-cell subtype to this process are unknown. Here we profile single colonic epithelial cells from patients with IBD and unaffected controls. We identify previously unknown cellular subtypes, including gradients of progenitor cells, colonocytes and goblet cells within intestinal crypts. At the top of the crypts, we find a previously unknown absorptive cell, expressing the proton channel OTOP2 and the satiety peptide uroguanylin, that senses pH and is dysregulated in inflammation and cancer. In IBD, we observe a positional remodelling of goblet cells that coincides with downregulation of WFDC2-an antiprotease molecule that we find to be expressed by goblet cells and that inhibits bacterial growth. In vivo, WFDC2 preserves the integrity of tight junctions between epithelial cells and prevents invasion by commensal bacteria and mucosal inflammation. We delineate markers and transcriptional states, identify a colonic epithelial cell and uncover fundamental determinants of barrier breakdown in IBD.