The respiratory system of gastropods varies greatly in form. These variations were once used as a basis for dividing the group into subclasses. The majority of marine gastropods breathe through a single gill, supplied with oxygen by a current of water through the mantle cavity. This current is U-shaped, so that it also flushes waste products away from the anus, which is located above the animal's head, and would otherwise cause a problem with fouling.
In the pulmonate gastropods, which are found on both land and in freshwater, the gill has been replaced by a simple lung.
In gastropods in many ancient lineages, the gills are bipectinate, having an overall shape that is similar to a bird's feather, with narrow filaments projecting either side of a central stalk.
Gastropods such as abalone and keyhole limpets have two gills, which is believed to be the arrangement in the earliest fossil gastropods. The water current to supply these gills is evacuated through a slit or notch in the upper surface of the shell, below which the anus opens.
In most other gastropods, the right gill has been lost. In groups such as the turban shells the gill still retains its primitive bipectinate form, and in these animals, the water current is oblique, entering the mantle cavity on the left side of the head, flowing over the gill, and then being flushed out on the right side. The anus is also on the right side of the body, so that waste matter is efficiently carried away.
Bipectinate gills have to be supported by membranes, and these can become fouled with debris and sediment, restricting such gastropods to relatively clean-water environments, such as water flowing over solid rock. In living gastropods, a unipectinate arrangement is more common, allowing species to invade muddy or sandy environments. This type of gill is firmly anchored to the mantle wall along its length, with a single row of filaments projecting down into the water stream.
Unipectinate gills are found in a wide range of snails, including marine, freshwater, and even terrestrial forms. Examples include periwinkles, conches, and whelks. The water current is oblique, as it is in the turban shells, but many have developed a siphon formed from the rolled-up margin of the mantle. The siphon sucks in water to the mantle cavity, and may be long enough to extend through the substrate in burrowing species. In one amphibious group, the Ampullariidae, the mantle cavity is divided into two, with a unipectinate gill on one side, and a lung on the other, so that these snails can respire using air or water.