The amount of time a moth can remain in the pupal stage of development, during which it exists in a cocoon, can vary based of the type of moth. The duration can range from two to four weeks, up to several years.
For example, the atlas moth, the largest known moth in the world, remains in the pupal stage for about four weeks. The emperor gum moth, a large moth native to Australias, stays in its cocoon for an average of two to five years. While in the pupal stage, the moth does not feed or move as the body transforms from a caterpillar to a moth through a process called histolysis.