Why do canned foods have an expiration date? The cans are air tight, hermetically sealed containers, and the food is sterile

It’s a clever marketing strategy. Sales would suffer if individuals simply stocked up on canned goods and kept them for years. Companies can be fairly certain that people will consume the goods by the best before or sell by dates, or put it in the garbage if the dates are exceeded, by including a best before or sell by date.