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 and 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 a table; as the water evaporates, there's less water left to drink.
You probably know that warm water evaporates faster than 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. Storing spices in a warm cabinet or windowsill will make their flavor fade faster. You might know to avoid putting spices next to the oven but the cabinets next to a refrigerator can also get very warm.
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 chunky roots and barks, and finally whole spices, which have the longest life.
Storage containers have a big influence on evaporation too. Glass and metal are the least permeable. Plastic containers are porous enough to allow water and other molecules through and some spices can discolor or degrade plastic. 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 the container and your spices smell like sawdust, they've 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 3-4 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 your 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 or food.