Adult swallowtail butterflies feed on the nectar of flowers, but they also eat manure and mud. As caterpillars, the species eats flowers and leaves from plants. Some species eat only particular plants, including Dutchman's pipe, Virginia snakeroot, wild cherry or carrots.
Many species of swallowtail defend themselves using toxic chemicals. Their caterpillars produce ant-repellent chemicals, and they use camouflage to protect themselves from being eaten. The false eye spots of the butterfly serve to confuse predators, and they are good fliers who evade predators by hiding in trees. Predators of the swallowtail include insect-eating birds, shrews, mice, frogs, spiders and ants, among others.