The portion of the alimentary canal of vertebrates between the small intestine and the anus. It consists of the caecum, colon, and rectum and its principal functions are the absorption of water and inorganic ions and the formation of faeces ready for expulsion via the anus. In many herbivorous animals the hindgut is the main site for the bacterial digestion of gut contents, while in humans and other nonruminant animals it contains a complex microbial community.