USDA-based · How this page was made · Last reviewed July 15, 2026 · Sources ↓

Pesto

The answer

Opened pesto lasts ~1 week in the fridge.

Caution Oil-based pesto still needs refrigeration after opening.

How long it keeps — Opened

Fridge (40°F) ~1 week safe window
Freezer (0°F) 3–4 months best quality
Room temp 2 hours max then discard
Discard Discard if moldy, fermented-smelling, or fizzing.

How to store pesto

Opened pesto keeps about 5–7 days refrigerated — shorter than most jarred condiments.

Smooth the surface and pour a thin layer of olive oil on top before sealing. This excludes air, which both slows the basil from browning and limits mold. Top the oil layer up each time you use some.

Use a clean spoon every time.

Pesto freezes very well for about 6 months and this is the best way to keep it. Freeze it in an ice cube tray, then transfer the cubes to a bag — you get single-serving portions that thaw in minutes.

Homemade pesto without preservatives should be treated at the short end: 4–5 days refrigerated, or frozen straight away.

By state & packaging

State Fridge Freezer Pantry
Opened, refrigerated ~1 week 3–4 months
Unopened, pantry Printed date

Why pesto goes bad

Pesto's ingredients are individually stable and collectively not, which makes it more perishable than it looks sitting on a shelf.

It combines fresh basil — a highly perishable leafy herb — with raw garlic, cheese, nuts, and oil. There is no acid to speak of and no heat processing in a fresh product, so nothing in the jar is doing preservation work except the oil layer excluding air.

The garlic-in-oil consideration is worth stating plainly. Garlic grows in soil and can carry Clostridium botulinum spores; oil creates the oxygen-free environment those spores need; and garlic is low in acid. Homemade garlic-in-oil preparations left at room temperature have caused botulism, which is why homemade pesto must be refrigerated or frozen rather than kept in a cupboard. Commercial shelf-stable pesto is acidified specifically to prevent this.

The browning you see is not spoilage. Basil contains polyphenol oxidase, and cut leaves darken on contact with oxygen exactly as a cut apple does. Brown pesto with a normal smell is fine, and the oil layer prevents it.

The nuts contribute the other failure mode: pine nuts and walnuts are high in unsaturated fat and go rancid, producing a bitter, paint-like taste.

Discard on mold, a fermented or fizzy appearance, or a sharply rancid smell.

Signs it has gone bad

Mold at the cap or surface
Fermented or off smell
Separation with sour odor

FAQ

How long does opened pesto last?

About ~1 week refrigerated per FoodKeeper guidance. Follow the package date if it is shorter.