Caterpillars are the larval stage of members of the order Lepidoptera (the insect order comprising butterflies and moths).As with most common names, the application of the word is arbitrary, since the larvae of sawflies are commonly called caterpillars as well. Both lepidopteran and symphytan larvae have eruciform body shapes.
Caterpillars of most species are herbivorous (folivorous), but not all; some (about 1%) are insectivorous, even cannibalistic. Some feed on other animal products; for example, clothes moths feed on wool, and horn moths feed on the hooves and horns of dead ungulates.
Caterpillars are typically voracious feeders and many of them are among the most serious of agricultural pests. In fact many moth species are best known in their caterpillar stages because of the damage they cause to fruits and other agricultural produce, whereas the moths are obscure and do no direct harm. Conversely, various species of caterpillar are valued as sources of silk, as human or animal food, or for biological control of pest plants.
Caterpillars have been called "eating machines", and eat leaves voraciously. Most species shed their skin four or five times as their bodies grow, and they eventually enter a pupal stage before becoming adults. Caterpillars grow very quickly; for instance, a tobacco hornworm will increase its weight ten-thousandfold in less than twenty days. An adaptation that enables them to eat so much is a mechanism in a specialized midgut that quickly transports ions to the lumen (midgut cavity), to keep the potassium level higher in the midgut cavity than in the hemolymph.
Most caterpillars are solely herbivorous. Many are restricted to feeding on one species of plant, while others are polyphagous. Some, including the clothes moth, feed on detritus. Some are predatory, and may prey on other species of caterpillars (e.g. Hawaiian Eupithecia). Others feed on eggs of other insects, aphids, scale insects, or ant larvae. A few are parasitic on cicadas or leaf hoppers (Epipyropidae). Some Hawaiian caterpillars (Hyposmocoma molluscivora) use silk traps to capture snails.
Many caterpillars are nocturnal. For example, the "cutworms" (of the family Noctuidae) hide at the base of plants during the day and only feed at night. Others, such as gypsy moth (Lymantria dispar) larvae, change their activity patterns depending on density and larval stage, with more diurnal feeding in early instars and high densities.