I am often asked how long will our spices last and it varies from a few months to several years. The shelf life of spices is determined by four main factors: volatility, temperature, surface area, and storage containers, all of which influence the interaction between spices air.
Many spices get their flavor from volatile compounds that will eventually evaporate. Many of the bitter herbs on the other hand get their flavor from alkaloids that are not volatile and they retain their flavor much longer. The more volatile the flavor compounds are, the more quickly their flavor will fade if stored improperly. If a spice smells very strong, it is giving off volatile flavor and scent compounds. The more of those compounds that leave the spice, the less there is left. Think of it like a cup of water left on table; as more water evaporates, there's less water left to drink.
You probably know that warm water evaporates faster then cold water. The same is true for the volatile compounds in spices. Heat also speeds up chemicals reactions that cause foods to go stale or rancid.
The surface area to volume ratio affects how quickly the volatile compounds can diffuse to the surface where they can evaporate. Ground herbs and spices have the largest surface area and lose flavor fastest, then thin leafy herbs, followed by cut and sifted, and whole spices, which have the longest life.
Storage containers have a big influence on the evaporation too. Glass and metal are the least permeable, followed by solid plastic and plastic bags. The best way to tell if your container is keeping the volatile compounds inside is to smell them both closed and open. If you can smell the spices outside a closed container, it's letting those flavors escape. If you open container and your spices smell like sawdust, they're lost their volatile compounds and are no longer useful.
Many bright colored spices like cardamom and lavender can also lose color from exposure to light and should be kept in dark colored or metal containers to limit light exposure.
The size of the container is important too. Keeping a small amount of a spice in a large jar leaves a lot of room for air. The oxygen in this air can react with the spices to cause staleness or, in the case of spice with a high oil content like cacao nibs, rancidity. It's best to choose a container that's just large enough to hold the spices and keep the lid tightly closed.
For example, ground nutmeg kept in a plastic bag next to the stove will only keep about 6 months whereas whole nutmeg stored in airtight tin or glass jar in a cool pantry or basement will keep up to 5 years.
One thing you can do to preserve the flavor of you herbs and spices is to make tinctures (herbs or spices steeped in alcohol) and store the tinctures in glass bottles. You can then blend the liquid into your bitters.