Most spices have an expiration or best before date stamped on their bottles. Ground spices are generally good for two to three years past their best before dates, while whole spices may be good for up to six years past the dates stamped on their bottles.
Ground spices such as allspice, cayenne pepper and chili powder are good for two to three years after the date printed on the bottle. Spices lose their potency over time, however, so storage affects their freshness. Resealing the spices after use increases their shelf life, while some spices such as those in the red pepper family remain fresher when stored in a refrigerator.