The excretory organs of the earthworm are the nephridia. The earthworm is an invertebrate animal called an annelid. An annelid is an animal that is made up of many rings that are joined together; each ring is called a segment. Each segment of the earthworm contains two nephridia.
Each nephridia is made up of a coiled tube that opens inside the earthworm's body cavity. The beginning of the coiled tube is called the nephridiostome and contains many fine hairs called cilia. The end of the tube is called the nephridiopore. As the earthworm eats food from the soil, the beneficial parts of the food are reabsorbed through the cilia in the nephridiostome.
The majority of the waste, which includes urea, salts and water, is expelled through the nephridiopore as castings. The rest of the waste is carried to the skin where it's secreted as mucus to help keep the earthworm's skin moist.
Earthworms are very beneficial to the environment. The tunnels they create aerate the soil, allowing air, water and nutrients to reach down into the soil to the roots of plants and flowers. The castings that earthworms produce are very nutritious for plants and are sold commercially for use as garden fertilizer.