Porcupines are herbivores, so their diet consists entirely of plants. Their exact diet varies by season and location, but North American porcupines mostly eat leaves, twigs, bark, acorns, buds and flowers.
Porcupines have special bacteria in their digestive system that break down the cellulose in wood, so most porcupines have a lot of wood in their diets. They live primarily on the inner bark of trees during the winter, but also eat evergreen needles. Depending on the location, they may primarily feed off of sugar maple, ponderosa pine and hemlock trees. Porcupines eat fruit, especially apples. They also like the taste of salt and seek out salt licks and other areas of salt buildup.