Spices, both whole and ground, do have a shelf life, although it is longer than some people might imagine. They do not go bad in the sense of becoming rancid or spoiled, but they do lose potency and complex layers of flavor. When spices lose their power, they should be discarded and replaced with fresh ones. Ideally, cooks should try to purchase them whole and grind them, as there is usually no way to tell how long ground ones have been stored in a warehouse or store.
Whole spices will keep the longest, because they have not been cracked or ground, exposing the volatile compounds that make up their flavor to the air. They can last up to four years in an airtight container that is stored in a cool, dry place. It will keep even better in the dark. Extremely strong spices, such as whole cloves, cinnamon, and pepper, may last even longer. Cooks can tell that whole spices are too old to use when they have lost their aroma.
Ground spices have a shorter shelf life, usually between two and three years. They should also be stored in a cool, dry place in airtight containers. To determine whether or not they are still usable, the cook should gently shake the container with the cap on, then remove the cap after a moment and smell the container to see if the rich smell is still present. If ground spices have declined in quality, the cook can carefully use more than is called for in a recipe, or toast them to refresh the flavor. To toast them, they can be placed in a cast iron skillet or a heavy pot over medium heat and tossed periodically to distribute the heat. Toasted spices should be used immediately.
Dried herbs keep for less time, because they are more delicate. Most last between one and three years. Culinary herbs can be tested by crushing them lightly in the hand. If the herbs still smell, they are good, even if the color has changed. If no odor rises after crushing, they should be discarded.
Cooks can prolong the life of spices by storing and handling them well. They do not do well in extreme heat, so should not be stored directly above the stove. They also keep poorly in the cold, so freezing them is not advisable. When using spices in cooking, they should be pre-measured rather than poured directly over a hot dish. The steam will damage the spices, and if the cook's hand slips, he or she may ruin the dish. Clean, dry measuring implements should also be used when dipping into containers.