Opened pesto lasts ~1 week in the fridge.
How long it keeps — Opened
Fridge times here are mostly quality windows from USDA FoodKeeper and related federal guidance — past them, flavor and texture decline; discard when mold, slime, off odors, or other spoilage signs appear. Freezer times are also quality windows at 0°F (FoodKeeper / FDA where cited). Not medical advice.
Unopened pesto keeps Printed date in the pantry.
How long it keeps — Unopened
Fridge times here are mostly quality windows from USDA FoodKeeper and related federal guidance — past them, flavor and texture decline; discard when mold, slime, off odors, or other spoilage signs appear. Freezer times are also quality windows at 0°F (FoodKeeper / FDA where cited). Not medical advice.
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
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
Any of these means discard it. Do not taste food to check (FDA / CDC). Fridge times above are mostly quality guidance — use these spoilage signs (and package condition) to decide when to toss, rather than treating the day count as a raw-meat-style safety cliff.
What the date on the package means
Jar and bottle dates on shelf-stable condiments are usually "best by" quality dates, not federal safety deadlines — see USDA FSIS food product dating. Unopened product kept cool and dry is typically fine through that date for quality.
After opening, follow the refrigerator (or pantry) window on this page and the label. Discard if mold, off odors, or unusual separation appear — do not scrape mold and keep using it.
FAQ
How long does opened pesto last?
About ~1 week refrigerated per FoodKeeper guidance. Follow the package date if it is shorter.
Is opened pesto still good after 2 weeks?
No. Opened pesto is about 1 week refrigerated. At 2 weeks, discard it.
Can pesto sit out while I cook pasta?
Keep time short. If pesto sat out more than 2 hours, discard it.