Most condiments have a long shelf life, especially if you store them in the fridge (like ketchup). But mayonnaise is a different story—it contains egg. And eggs aren’t known for their lengthy lifespan.
If you’re wondering how long is too long to leave out mayo, then we have the answers. Properly storing mayonnaise is key to avoiding foodborne illness.
How Long Can You Leave Mayo Out?
Ideally, mayonnaise is stored in the fridge or served up immediately to reduce your risk of foodborne illness. But sometimes potato salad sits out at a barbecue, leaving you wondering: when should I toss it out? Is it still okay to eat?
Like all items that require refrigeration (including leftovers), mayo has a two-hour rule. The USDA recommends not leaving mayo out at room temperature for more than two hours before moving it back into the fridge. While that potato salad might be fine to eat after a few hours, your risk goes up as the clock ticks on, especially if it’s a warm day.
If you can cover the food and keep it chilled in a basin of ice or something similar, you can extend your serving time a bit. Mayo stored at 50°F or more (even if cold but not cold enough) should be discarded after 8 hours. For reference, a refrigerator keeps food at about 40°F.
How to Store Mayonnaise
Most commercial mayonnaises, like Hellman’s Real Mayonnaise or Sir Kensington’s Mayonnaise, are shelf-stable before opening. That’s why the bottle or jar can sit unrefrigerated in the supermarket. You can leave the container at room temperature in your pantry until you open it and break the seal.
Once you open it up, you’ve got to store mayo in the fridge. Sir Kensington’s notes that refrigerated mayonnaise will “be safe to enjoy approximately 2 months after you first open your jar or bottle.” The USDA also recommends storing open mayo in the fridge and tossing it after 2 months.
Storing Homemade Mayonnaise
It’s the inclusion of egg (typically just the yolk) that makes mayo perishable. “Traditionally, mayonnaise is made with raw egg yolks, and therefore carries a slight risk of salmonella infection,” explains food scientist Harold McGee in his book On Food and Cooking: The Science and Lore of the Kitchen. For this reason, homemade mayonnaise and aioli have a short shelf life and should be stored in the fridge for up to 1 week max.
The lessen your risk of foodborne illness, you can make homemade mayonnaise using pasteurized eggs. This is what mass market manufacturers use when producing store-bought mayo. According to the USDA, homemade mayonnaise made with pasteurized eggs can be stored in a covered container in the fridge for up to 4 days. But since homemade mayonnaise using pasteurized eggs is basically the same as store-bought, most home cooks successfully store it in the fridge for 1 month or more.
When to Toss Mayonnaise
In general, the FDA recommends tossing perishable foods, including mayo, which have been left out at room temperature for 2 or more hours. Unopened containers of store-bought mayo will keep in the pantry until the sell-by date, and opened mayonnaise will keep for about 2 months in the refrigerator.
If mayonnaise has visible mold, an off-smell, or an unnatural hue, toss it immediately.
A version of this article originally appeared on MyRecipes.com