The USDA has this to say on it:
Storing Leftovers
One of the most common causes of foodborne illness is improper cooling of cooked foods. Because bacteria are everywhere, even after food is cooked to a safe internal temperature, they can be reintroduced to the food and then reproduce. For this reason leftovers must be put in shallow containers for quick cooling and refrigerated within 2 hours.
You'll find similar statements from government agencies around the world. The safe limit for raw or cooked food is 2 hours in the danger zone (40-140° F or 4.4-60° C).
If you're a restaurant owner or cook, you must follow this rule, hold hot foods above 60° C and quick-cool other foods before refrigerating. If you are not working in a professional capacity then you are not legally required to follow it, but if you are serving guests then it would be irresponsible (and possibly actionable, if someone gets sick) to do otherwise.
If you're an individual serving only yourself, then take whatever liberties and break whatever rules you want; it's your food, and your body. But there's no table or chart anyone can give you; there's no single specific point at which a food transitions from "not entirely safe" to "probably will kill you" because it depends entirely on the food, the environment, your immune system, and a plethora of other variables. The rule is 2 hours, period; any longer and there is some non-trivial risk to your health.
Some hints, tips, and warnings:
The 2-hour rule is a conservative estimate with a safety margin. Don't ask what that margin is. It's like asking what the "real" speed limit is on a posted road; you might know from experience, but it could change depending on circumstances and exceeding it by any amount means you take your chances and accept the risks.
Don't put large, hot items (such as an entire pot of soup or chili) directly into the fridge. The residual heat will warm up and potentially spoil other items in the refrigerator.
To quickly cool large cooked items, use an ice-water bath and/or divide them into small containers. (Note: Don't use an ice-water bath for cast iron.)
Don't assume that re-cooking an improperly-stored item will make it safe. Most bacteria produce protein toxins, which are actually the primary agents responsible for food poisoning, and several of these toxins are heat-resistant. Cooking will not kill or inactivate these toxins and eating the re-cooked food will still make you sick.
Don't assume that cooking "kills everything" and that a cooked food or cooking surface is absolutely sterile. Cooking kills enough to make the food safe to eat, but some organisms - such as bacterial spores from bacillus and clostridium - can survive the cooking process and immediately start producing more bacteria. Sous-vide bags, crock pots, etc. are not safe environments for cooked food in the temperature danger zone.
General comments on the shelf-, fridge-, and freezer-life of foods
The shelf-life is the amount of time a food can be stored before it is considered unsuitable for use. It may be unsuitable due to quality degradation (no longer tasty) or food safety (risk of food poisoning). [1]
As far as food safety goes, food stored frozen at 0°F (-18°C) or below is remains safe forever; only quality degrades over time. [2]. Thus the freezer-storage times below are entirely about quality. This temperature should be maintained fairly closely (within 3°C[6] or 5°F) and a defrost / no-frost freezer should not heat air surrounding the products by enough to heat the products more than that.
If your freezer is set at a temperature higher than -18°C (three-star setting), these times may not apply. Especially the safe storage time in one-star freezers (-6°C) is much reduced.
The times all assume proper storage. Freezers 0°F or below, refrigerators 40°F (4°C) or below. [3] Cans should be stored in a cool, dry place, below 85°F (30°C) [4]. The freezer itself should also be placed correctly: if the environmental temperature drops below 10°C (50°F), oil might be too viscous and work less well or damage the compressor[7], so please refer to the operating manual before deciding on an unheated garage.
The tables given here assume proper storage. Food which requires refrigeration is considered unsafe if left for over two hours at temperatures between 41–135°F (5–57°C) [5].
The Tables
Regardless of the table below, if a food shows signs of spoilage (including mold, with some exceptions described below), its past its shelf-life. Note that the lack of spoilage does not imply safety.
Uncooked Proteins
Item |
Fridge |
Freezer |
Sources |
Ground (meat, poultry) |
1–2 days |
3–4 months |
[KC] |
Non-ground meat |
3–5 days |
steaks: 6–12 months chops: 4–6 months roasts: 4–12 months |
[KC] |
Poultry |
1–2 days |
whole: 12 months pieces: 9 months |
[KC] |
Eggs |
in shell: 3–5 weeks separated: 2–4 days |
in shell: not recommended whites: 12 months yolks: not recommended |
[KC] |
Bacon |
1 week |
1 month |
[CFG] |
tofu |
1 week |
5 months |
[CFG] |
fish |
1–2 days |
lean: 4–8 months fatty: 2–3 months |
[CFG] |
Cooked proteins
Item |
Fridge |
Freezer |
Sources |
luncheon meat |
opened: 1 week unopened: 2 weeks |
1–2 months |
[KC] |
cooked meat and poultry |
3–4 days |
2–6 months |
[KC] |
cooked fish |
3–4 days |
1–2 months |
[CFG] |
hard boiled eggs |
1 week |
not recommended |
[KC] |
hard sausage |
2–3 weeks |
1–2 months |
[CFG] |
Dairy
Item |
Fridge |
Freezer |
Sources |
butter |
1–3 months |
6–9 months |
[CFG] |
hard cheeses |
opened: 3–4 weeks unopened: 6 months |
6 months |
[CFG] |
soft cheeses |
1 week |
6 months |
[CFG] |
cream cheese |
2 weeks |
not recommended |
[CFG] |
Sauces
Item |
Fridge |
Freezer |
Sources |
mayo |
commercial: 2 months home-made: see below |
not recommended |
[CFG] |
gravy, broth |
3–4 days |
2–3 months |
[CFG] |
For home-made mayo, there don't seem to be official shelf-life estimates.
Seasoned Advice has a question on this,
Making "long(er)-life" homemade mayonnaise.
Vegetables
Freezer times are given for cooked or blanched, then frozen. Generally, this is
required, otherwise enzymatic degradation will occur. See "Where can I go for
details on a specific food?" for where to find specific steps for each vegetable.
Refrigerator and shelf times are for storage raw.
If a column is -
, it means that storage type is not recommended. "Ripe" means
"until ripe".
Item |
Shelf |
Fridge |
Freezer |
Sources |
Asparagus |
- |
3–4 days |
8 months |
[FK] |
Green beans |
- |
3–4 days |
8 months |
[FK] |
Beets |
1 day |
7–10 days |
6–8 months |
[FK] |
Cabbage |
- |
1–2 weeks |
10–12 months |
[FK] |
Carrots |
- |
3 weeks |
10–12 months |
[FK] |
Celery |
- |
1–2 weeks |
10–12 months |
[FK] |
Garlic |
1 month |
1–2 weeks |
1 month |
[FK] |
Herbs (fresh) |
- |
7–10 days |
1–2 months |
[FK] |
Lettuce (iceberg) |
- |
1–2 weeks |
- |
[FK] |
Lettuce (leaf) |
- |
3–7 days |
- |
[FK] |
Mushrooms |
- |
2–3 days |
10–12 months |
[FK] |
Onions, non-sweet |
2–3 months |
2–3 months |
10–12 months |
[ST] |
Onions, sweet |
1–2 months |
1–2 months |
10–12 months |
[ST] |
Peppers |
- |
4–5 days |
6–8 months |
[FK] |
Potatoes |
1–2 months |
1–2 weeks |
mashed: 10–12 months |
[FK] |
Squash, summer |
- |
4–5 days |
10–12 months |
[FK] |
Squash, winter |
1 week |
2 weeks |
10–12 months |
[FK] |
Tomatoes |
ripe |
2–3 days |
2 months |
[FK] |
Fruits
Many fruits must be at least partially cooked (blanched) before freezing in
order to deactivate enzymes that would otherwise degrade quality while in
storage. Some are best frozen packed in acid (lemon juice or citric acid)
and/or syrup. See "Where can I go for details on a specific food?" for where to
find specific steps for each fruit.
If a column is -
, it means that storage type is not recommended. "Ripe" means
"until ripe".
Item |
Shelf |
Fridge |
Freezer |
Sources |
apples |
1–2 days |
1–3 weeks |
cooked: 8 months |
[FSG], [FK] |
apricots |
ripe |
2–3 days |
- |
[FK] |
bananas |
ripe |
1–2 days* |
peeled: 1 month |
[FK] |
berries |
- |
1–2 days |
4 months |
[FSG], [FK] |
citrus fruit |
10 days |
3 weeks |
- |
[FSG] |
grapes |
1 day |
1 week |
1 month |
[FK] |
juice |
- |
6 days |
8 months |
[FSG] |
melons |
1–2 days |
1 week |
balls: 1 month |
[FSG], [FK] |
generally: |
|
3-5 days |
|
|
*: bananas stored in the fridge will blacken. This is not a sign of spoilage, and they can be eaten safely.
Cooked dishes
2 hours on the counter, for all of them, unless you prepared a known shelf-stable item which generally does not go in the fridge (like cookies, or a canned jam, or others). It does not matter how long the individual components would have lasted on their own.
Refrigerated: generally 3–4 days in the fridge. This includes pizza, soups, stews,
casseroles, pies, and quiche [KC]. Some salads get a fifth day [CFG].
Freezer time is generally under three months.
Infused oils
Putting any plant matter in oil (such as garlic, chillies or herbs) creates the danger for botulism, a rare but fatal disease. Thus infused oils are not shelf-stable. They can be kept in the refrigerator for 3-5 days, discard them earlier if you see cloudiness or gas bubbles. Or buy commercially produced infused oils, they have been treated with industrial methods to kill the botulinum spores.
Shelf-stable until opened
Item |
Unopened |
Opened, in fridge |
Source |
Commercially canned, low-acid (meat, poultry, fish, soups, stews, vegetables) |
2–5 years |
3–4 days |
[CFG] |
Commercially canned, high-acid |
12–18 months |
5–7 days |
[CFG] |
Olives |
12–18 months |
2 weeks |
[FK] |
jam, jelly, preserves |
1 year |
6 months |
[FK] |
shortening (Crisco) |
8 months |
3 months |
[FK] |
Pantry (not refrigerated even after opening)
Item |
Shelf life |
opened (if different) |
Source |
Baking powder |
18 months |
|
[FSG] |
Baking soda |
2 years |
|
[FSG] |
beans (dry) |
1 year |
|
[FK] |
Bouillon |
1 year |
|
[FSG] |
cornstarch |
18 months |
|
[FK] |
extracts |
3 years |
|
[FK] |
flour |
white: 6–12 months wheat: 1 month |
|
[FK] |
herbs (dry) |
1–2 years |
1 year |
[FK] |
honey |
1 year |
|
[FK] |
pasta (dry) |
2 years |
|
[FSG] |
egg noodles (dry) |
6 months |
|
[FSG] |
rice (dry) |
white: 2 years brown: 6–12 months flavored: 6 months |
|
[FSG] |
vegetable oil |
6 months |
1–3 months |
[FSG] |
vinegar |
2 years |
12 months |
[FSG] |
General tips for storing foods
How do I freeze fruits and vegetables?
Fruit. Ripe (but not overripe) fruit should be used. Wash them, and sort according to size. Working in small batches, remove pits, seeds, and blemishes. For fruits that turn brown, apply ascorbic acid or sugar and citric acid. Most fruits benefit from packing in dry sugar or a sugar syrup. Small, whole fruits (e.g., berries) can be spread on a tray and individually frozen, then packed in a freezer bag or other airtight container.
Vegetables. Most vegetables need blanching. To blanch, immerse in boiling water over high heat or steam over rapidly boiling water (steam). After blanching, transfer to ice bath for the same amount of time as blanched. Drain and dry. Freeze either by packing in a freezer bag with as much air as possible removed, or by allowing to freeze on a tray, then putting in a bag or other container.
General guideline is 8–12 months for best quality.
The above is a very quick summary of Iowa State University's Preserve the
Taste of Summer: Freezing: Fruits and
Vegetables. The
five-page document includes full details on over forty fruits and vegetables.
Feel free to ask here on Seasoned Advice if that guide doesn't answer your
question.
What about mold?
Some foods are expected to have mold in them (e.g., P. roqueforti in
Roquefort cheese). Unexpected mold, however, is something to be concerned
about. Mold can grow even on refrigerated foods, and even those high enough in
salt or sugar to deter bacteria. Some molds produce mycotoxins. Mold growth can
be minimized by cleaning the refrigerator every few months (use a mixture of 1
tablespoon of baking soda per quart of water, then rinse with plain water, then
dry), by keeping dishcloths, sponges, mops, etc. clean and fresh-smelling; and
keeping indoor humidity levels under 40%.
In general, the visible surface mold on a food is only a small part of the
actual mold growth. For most foods, any visible unexpected mold growth means
you should discard the entire item. There are several exceptions:
Food |
How to handle mold |
Hard salami, dry-cured country hams |
Scrub mold off surface. |
Hard cheese |
Cut at least 1 inch around and below mold spot, do not cut through mold. |
Cabbage, bell peppers, carrots |
Cut at least 1 inch around and below mold spot, do not cut through mold. |
Everything else, including soft or shredded cheese, soft fruits and vegetables,
bread, peanut butter, jams and jellies, sour cream, yogurt, luncheon meats,
casseroles, and cooked pasta should be discarded.
All this information comes from the USDA FS&IS's Molds on Food: Are They
Dangerous? fact
sheet.
Where can I go for details on a specific food?
The web site StillTasty maintains a comprehensive list
of food storage times, notes, and procedures for a wide variety of food items.
They draw information from a variety of reputable
sources and should probably
be the first place you check.
Another good source of information is the Food Marketing Institute's Food
Keeper. This is also a searchable database of foods.
Finally, if neither of those two references answer your question, you're at the
right web site. Please ask here on Seasoned
Advice.
Bibliography
Note
This is a work-in-progress. I still need to finish adding information to it. Also, this answer is a community wiki, please feel free to improve it.
Best Answer
Kenji Lopez-Alt did a very in-depth article for Serious Eats about the coronavirus and food that is worth reading. There is no evidence of the coronavirus (or covid) being passed through food, because in general the virus would break down too quickly to be passed on. Viruses survive better on non-porous surfaces. The full article is here:
https://www.seriouseats.com/2020/03/food-safety-and-coronavirus-a-comprehensive-guide.html