Constipation is a heterogeneous, polysymptomatic, multifactorial disease. Acute or transient constipation can be due to changes in diet, travel or stress, and secondary constipation can result from drug treatment, neurological or metabolic conditions or, rarely, colon cancer. A diagnosis of primary chronic constipation is made after exclusion of secondary causes of constipation and encompasses several overlapping subtypes. Slow-transit constipation is characterized by prolonged colonic transit in the absence of pelvic floor dysfunction. This subtype of constipation can be identified using either the radio-opaque marker test or wireless motility capsule test, and is best treated with laxatives such as polyethylene glycol or newer agents such as linaclotide or lubiprostone. If unsuccessful, subspecialist referral should be considered. Dyssynergic defecation results from impaired coordination of rectoanal and pelvic floor muscles, and causes difficulty with defecation. The condition can be identified using anorectal manometry and balloon expulsion tests and is best managed with biofeedback therapy. Opioid-induced constipation is an emerging entity, and several drugs including naloxegol, methylnaltrexone and lubiprostone are approved for its treatment. In this Review, we provide an overview of the burden and pathophysiology of chronic constipation, as well as a detailed discussion of the available diagnostic tools and treatment options.