The diet of an annelid varies depending on the type of worm. Many earthworms and freshwater worms, also known as oligochaetes, consume organic matter in soil. Some aquatic oligochaetes feed on small invertebrates.
The digestive tract of an annelid consists of a straight path of a pharynx, an esophagus and an intestine with an anal opening at the end. Their bodies contain a specialized region for separating soil from the digestible organic matter found in it. This region consists of a thin-walled storage area and a muscular gizzard. Annelids swallow soil as they move through the ground. This, combined with their digestive processes, is largely responsible for soil mixing and aeration.