Commercial mayonnaise is shelf stable when unopened, meaning you can store a sealed jar in your pantry without refrigeration. Once you open it, though, it needs to go in the fridge and will stay good for about two months. Homemade mayonnaise is a different story entirely and always requires refrigeration.
Why Unopened Mayo Doesn’t Need the Fridge
The acidity in commercial mayonnaise is what keeps it safe on a shelf. Vinegar and lemon juice lower the pH to around 4.1 or below, which is acidic enough to prevent Salmonella and other harmful bacteria from growing. Research has shown that a pH at or below 4.2 effectively controls Salmonella in raw-egg products, and commercial manufacturers carefully formulate their recipes to hit that target consistently.
This is why an unopened jar of Hellmann’s or Duke’s can sit in your pantry for months without any safety concern. The combination of acidity, the sealed environment, and sometimes added preservatives creates conditions where bacteria simply can’t multiply. The “best by” date on the jar is a quality indicator, not a safety cutoff. According to Hellmann’s, food can safely be eaten past those dates as long as it’s been handled properly and shows no signs of spoilage like off smells, flavors, or texture changes.
What Changes Once You Open the Jar
Opening the jar introduces air, moisture, and bacteria from utensils. The USDA recommends keeping opened mayonnaise refrigerated and using it within two months. The acidity still provides some protection, but it’s no longer a sealed system, so refrigeration becomes essential to slow any microbial activity.
If you leave opened mayo out on the counter, the standard food safety rule applies: no more than two hours at room temperature, or one hour if it’s above 90°F. Bacteria multiply fastest between 40°F and 140°F, potentially doubling every 20 minutes in that range. This matters especially for mayo-based dishes like potato salad or chicken salad at cookouts, where the mayo is mixed with other perishable ingredients.
Homemade Mayo Is Not Shelf Stable
Homemade mayonnaise lacks the precise pH control and preservatives of commercial versions. It’s made with raw eggs, and the USDA warns against consuming raw shell eggs due to the risk of Salmonella contamination. You can reduce that risk by using pasteurized eggs or pasteurized egg products, but even then, homemade mayo needs to stay refrigerated and should be used within four days.
The acidity in a homemade batch varies depending on how much vinegar or lemon juice you add and how thoroughly it’s incorporated. Commercial producers test and adjust pH levels precisely. At home, you’re estimating, which means the acidity may not be low enough to reliably inhibit bacteria. Temperature also plays a role: research has found that Salmonella survival in mayonnaise depends on the interaction between pH, temperature, the specific type of acid used, and even ingredients like garlic and ginger. Without laboratory-level control over these variables, homemade mayo should always be treated as perishable.
How to Tell If Mayo Has Gone Bad
Mayo doesn’t always show obvious signs of spoilage. The first clue is usually a change in smell, shifting from tangy and mild to sour or unpleasant. Color changes, particularly yellowing or darkening, can indicate oxidation. If the oil has separated and won’t remix when stirred, the emulsion has broken down, which isn’t necessarily dangerous but signals the product is past its prime.
Any mold, pink or grey discoloration, or a noticeably off taste means you should discard it. Don’t freeze mayo in an attempt to extend its life. The emulsion will separate and curdle after thawing, ruining the texture.
Quick Storage Reference
- Unopened commercial mayo: Pantry storage is fine until the best-by date, and often beyond it if the seal is intact.
- Opened commercial mayo: Refrigerate immediately, use within two months.
- Homemade mayo (pasteurized eggs): Refrigerate immediately, use within four days.
- Mayo-based dishes left out: Discard after two hours at room temperature, or one hour above 90°F.

