Cocoa powder has a low moisture content and thus stays fresh indefinitely when properly stored. Keep it out of the moist environment of the refrigerator, which will hasten spoilage. All types of cocoa powder, including natural process and alkalized cocoa, have similar shelf lives.
Cocoa should be shielded from light and oxygen to stay its freshest. Keep cocoa in opaque tins or cans. If you purchase it in bulk, transfer it to a dark, tightly sealed container before putting it in the pantry.
If cocoa has obvious signs of mold, toss it; otherwise, it's unlikely to spoil. Old cocoa may lose some of its flavor, however. Check to see if your canister of cocoa has an expiration date, which reflects when the cocoa is no longer at its best for cooking and baking. Quality cocoa tastes naturally sweet, with a slight acidity, and smells lightly of chocolate.