How Long Will Pesto Keep? | The 3-Day Flavor Window

Homemade pesto keeps 3 to 7 days refrigerated, while opened commercial pesto is best used within a week, according to most food storage sources.

You open the fridge and spot a jar of pesto pushed behind the olive jar. It has been a few days — maybe a week. The surface looks darker than when you first opened it. Most people in this situation do a quick sniff test and decide on the spot whether lunch gets pesto or gets skipped.

The honest answer is that pesto shelf life depends heavily on whether it is homemade or store-bought and on the specific ingredients inside. Homemade pesto lacks the preservatives commercial jars rely on, so its fridge life is shorter. Most food bloggers suggest a range of 3 to 7 days for homemade pesto, while an open commercial jar is best used within a week for both food safety and peak flavor.

Homemade vs. Store-Bought — Two Different Timelines

The biggest factor deciding how long your pesto lasts is preservatives. Store-bought pesto is often acidified or pasteurized to slow microbial growth. Homemade pesto relies on fresh garlic, basil, cheese, and oil, none of which are heavily preserved on their own.

Commercial pesto usually comes with a “best by” date that stretches months into the future while unopened. Once you pop the seal, the clock starts ticking. Food blogs and consumer guides typically report that an opened commercial jar holds its best quality for about 3 to 7 days in the fridge. The Yahoo food section notes that for optimal flavor, jarred pesto is best within three days at 40°F.

Homemade pesto is a different story. Without preservatives, the garlic and basil are vulnerable to bacteria and mold more quickly. The National Center for Home Food Preservation, cited by several food sources, pegs the safe fridge window at just 3 days. Other home cooks find their pesto stays acceptable for 5 to 7 days if stored properly with an airtight seal.

Why The Fridge Life Varies So Much

You might wonder why one source says 3 days and another says a full week. The variation comes down to a few concrete factors that affect how quickly pesto degrades from the moment you make or open it.

  • Recipe freshness: Your pesto starts degrading the moment you make it. The age of your basil and garlic when you made the batch matters a lot. Older, slightly bruised basil leaves introduce more bacteria from the start.
  • Oil barrier: A thin layer of olive oil on top of the pesto before refrigerating can slow oxidation significantly. This keeps the top layer from browning and limits air exposure.
  • Acidity level: Lemon juice or vinegar is common in pesto recipes. Higher acidity slows bacterial growth, which means a tangier pesto may hold an extra day compared to a low-acid version.
  • Temperature consistency: Pesto that sits on the counter for 20 to 30 minutes every time you use it will degrade faster than pesto that goes straight back into a cold fridge every time.
  • Container type: A nearly empty jar with lots of air inside speeds up oxidation. A tightly packed, small container with minimal headspace keeps the basil greener and fresher for longer.

These variables explain why the same batch of pesto might go bad in 4 days in one household and last a full week in another. It is not random — it is the sum of small choices in preparation and storage.

Signs Your Pesto Has Turned

Color is the most obvious but not the most reliable indicator. Pesto naturally darkens on top due to oxidation — that is the basil reacting with air, similar to how an avocado browns. Mild browning is cosmetic in most cases and the pesto remains edible, though the taste may be less vibrant than the first day.

Texture and smell are better clues for spoilage. If the surface feels slippery or slimy, or if you spot fuzzy mold in green, white, or black, the pesto should go in the trash. A sour or funky smell is another reliable sign that bacteria have taken hold. Slight oil separation at the top is normal, but a watery layer at the bottom of the jar can signal trouble and often accompanies an off odor, notes the pesto stored in fridge guide from Urbanfarmie.

Sign What It Means Action
Top layer brownish-green Oxidation from air exposure Stir it in; pesto is usually still safe
Entire jar dark brown or gray Advanced oxidation or old age Smell test; likely past its prime
Slimy or tacky surface texture Bacterial growth Discard immediately
Visible mold (fuzzy patches) Fungal contamination Discard immediately
Sour, rancid, or funky smell Spoilage bacteria or rancid oil Discard immediately

When in doubt, the general food safety principle applies: if you are unsure, throw it out. A fresh jar of pesto costs much less than a round of foodborne illness, so trusting your senses is completely reasonable here.

How To Make Pesto Last Longer

Getting the maximum shelf life out of your pesto takes a few intentional steps. Most are simple adjustments to how you prep and store it once the jar is open or the batch is made.

  1. Top it with oil. Before sealing the container, pour a thin layer of olive oil over the surface of the pesto. This blocks air from reaching the basil and slows oxidation dramatically.
  2. Press out the air. If using a resealable jar or plastic container, press a piece of plastic wrap directly onto the surface of the pesto before putting the lid on to eliminate headspace.
  3. Keep it cold. Make sure your fridge is running at 40°F or below. That safe temperature zone slows bacterial growth across all perishable foods, including pesto.
  4. Use a clean utensil every time. Dipping a used knife or spoon into the pesto jar introduces new bacteria each time. Always reach for a clean, dry spoon to avoid contamination.
  5. Freeze what you will not eat. Pesto freezes surprisingly well. Spoon it into an ice cube tray, freeze solid, then transfer the cubes to a freezer bag. It keeps for about 2 months frozen.

If you know you will not finish a batch of homemade pesto within the first week, the freezer is the simplest way to stop the clock. Frozen pesto cubes are convenient for quick dinners — drop one directly into hot pasta or into a soup pot for an instant flavor boost.

Frequently Overlooked Storage Details

One detail that trips people up is the difference between refrigerated and shelf-stable shelf lives. Many commercial pesto jars are designed to sit in a pantry or on a grocery store shelf before opening. Sources suggest unopened store-bought pesto can last up to three months past its “best by” date if stored in a cool, dark pantry.

Another detail is pesto’s sensitivity to condensation. Pesto that goes from fridge to counter and back repeatedly builds up moisture inside the jar. That extra moisture creates a breeding ground for bacteria on the surface. A sour-smelling pesto is often the result of this moisture cycle, not necessarily spoiled basil.

Storage Method Homemade Pesto Commercial Pesto (Opened)
Refrigerator (40°F) 3 to 7 days 3 to 7 days
Freezer (0°F) About 2 months Not recommended for best texture
Pantry (Unopened) N/A Up to 3 months past “best by” date

These details matter because pesto is not a uniform product. The ingredients, the production method, and your kitchen habits all shift the timeline in one direction or the other.

The Bottom Line

Pesto keeps longest when you treat it like fresh produce, not a pantry staple. Homemade batches are generally best within 3 to 7 days. Commercial jars hold quality a little longer unopened, but once opened, the 3-to-7-day window is a safe bet. Use the oil trick, keep the jar cold, and trust your nose — if it smells sour or looks slimy, it is time to toss it.

If you rely on pesto for weekly meal prep and want personalized guidance on safe storage limits for your specific fridge temperature and favorite recipe, a registered dietitian or your local public health agency can give you the clearest answers.

References & Sources

  • Urbanfarmie. “How Long Does Pesto Last” The National Center for Home Food Preservation suggests that pesto should be made fresh and stored in the fridge for no more than 3 days.
  • Kimecopak. “How Long Does Pesto Last” Sour-smelling pesto that is also slimy or has a significantly altered texture indicates bacterial spoilage.