Picking up a jar of pesto sauce at the store is easy - knowing how long it stays good once you're home is where most people run into trouble.

The olive oil, parmesan, pine nuts, and fresh basil that make pesto work are exactly the ingredients that spoil fastest once air hits them.
Opened jars need the fridge and a bit of attention; homemade batches are even more time-sensitive. Get the storage right and pesto holds for weeks or longer.
Opened pesto lasts 5-7 days in the fridge with an olive oil layer on top. Unopened commercial jars stay good up to 4 weeks refrigerated or 6-12 months in the pantry. Freeze in small portions for up to 12 months.
How Long Does Pesto Sauce Last?
Pesto's shelf life depends heavily on whether the jar has been opened and where you're storing it. Homemade pesto and opened commercial jars both clock in at 5-7 days refrigerated - the clock starts the moment air hits that surface.
Remember it later
Planning to try this recipe soon? Save it for a quick find later!
Unopened store-bought jars vary by brand and formula. Shelf-stable commercial pesto can sit in a cool pantry for 6-12 months, while refrigerated commercial varieties (check the label - not all shelf-stable pesto looks different from the refrigerated kind) last 2-4 weeks unopened in the fridge.
Pesto mixed into cooked dishes - say, stirred through hot pasta or spread on chicken - behaves more like a perishable leftover and should be used within 3-4 days.
| Method | State | Duration | Notes |
|---|---|---|---|
| 🧊 Fridge | Opened | 5-7 days | Airtight container; thin olive oil layer on surface |
| 🧊 Fridge | Unopened (commercial) | 2-4 weeks | Check manufacturer best-by; refrigerate after opening |
| 🧊 Fridge | Cooked (in dish) | 3-4 days | Treat as a perishable leftover |
| ❄️ Freezer | Opened/portioned | 6-12 months | Portion into cubes; best color and aroma within 6 months |
| 🏠 Pantry | Unopened (shelf-stable) | 6-12 months | Cool, dark spot; discard after best-by date |
The biggest variable for homemade pesto is basil oxidation. Because there are no preservatives, the surface browns faster and microbial activity picks up quicker than in commercial versions.
How to Store Pesto Sauce
How you store pesto after opening makes the difference between five days and two. A few small steps at each use extend the window significantly.
Pantry: Unopened, shelf-stable commercial jars belong in a cool, dark spot - away from the stove or any heat source. Don't transfer to plastic for long-term storage; the original glass jar is better at keeping air out.
Fridge: After opening, move pesto to a shallow airtight glass or BPA-free container. Press out any trapped air, then pour a thin 1-2 mm layer of olive oil over the surface. That oil barrier is what slows browning - without it, basil oxidizes within a day or two.
Freezer: Portion into small amounts before freezing (see the next section). Don't freeze a full open jar; you'll lose the ability to thaw only what you need.
One common mistake worth avoiding: sealing and refrigerating homemade pesto while it's still warm. The condensation that forms inside the container accelerates spoilage.
Let it cool to room temperature first.
Can You Freeze Pesto Sauce?
Yes - and it's one of the better herbs-and-oil sauces to freeze. The key is portioning before it goes in, not after.
Texture changes do happen. The olive oil may separate after thawing and the pesto can look grainy or slightly dull. That's normal behavior from the fat content, not a sign of spoilage. A quick whisk with a teaspoon of fresh olive oil or a splash of lemon juice usually brings it back together.
- Portion it out - Spoon pesto into an ice-cube tray at 1-2 tablespoons per cavity, or use small silicone molds.
- Freeze until solid - Leave in the tray for 2-4 hours until fully frozen through.
- Transfer and label - Pop the cubes into a labeled freezer bag or airtight container, press out excess air, and note the date.
- Thaw correctly - Drop a frozen cube directly into hot pasta or soup, or defrost a larger portion in the fridge overnight. Avoid high-heat microwaving, which worsens discoloration.
Store-bought jarred pesto freezes just as well as homemade. For homemade pesto, briefly blanching the basil before processing helps preserve green color through the freeze-thaw cycle.
Signs Pesto Sauce Has Gone Bad
Most spoilage in pesto is visible or smells wrong before you'd ever taste it. A little surface darkening from oxidation is normal - that's just the basil reacting to air.
What you're watching for goes beyond light color changes.
Mold, a sour or fermenting smell, or a slimy texture are all hard stops - discard the jar without tasting. The parmesan and pecorino in pesto can break down in ways that smell aggressively off before visible mold even appears.
Storing Pesto the Right Way
A few consistent habits keep pesto in good shape from the first use to the last. These apply whether you're working with a commercial jar or a batch of homemade pesto made with fresh basil.
- Oil the surface every time - After each use, scrape down the jar edges and pour a thin layer of olive oil over the surface before resealing.
- Portion before freezing - Single 1-2 tablespoon cubes let you pull exactly what you need without thawing an entire batch.
- Label freezer containers - Use within 6 months for the best aroma and color, even though the pesto stays safe longer.
- Brighten before serving - If thawed pesto looks dull, a small squeeze of lemon juice and fresh olive oil restores it quickly.
If you run out and need a quick swap, there are several pesto sauce alternatives worth knowing for pasta, sandwiches, and dips.
Frequently Asked Questions
Homemade pesto lasts 5-7 days refrigerated in an airtight container. Without preservatives, it oxidizes and spoils faster than commercial versions - an olive oil layer on the surface helps extend that window by a day or two.
Yes. Opened pesto left at room temperature for more than 2 hours enters the danger zone for bacterial growth. Discard any portion that has sat out that long, especially in warm kitchens.
Yes, pesto with Parmesan freezes well. The cheese may contribute to a slightly grainy texture after thawing, but a quick stir with fresh olive oil smooths it out. Some cooks omit the cheese before freezing and add it fresh after thawing for cleaner results.
Only if it's an unopened commercial jar with a best-by date still ahead. Opened pesto - store-bought or homemade - should be discarded after 7 days regardless of how it looks.
Pour a thin layer of olive oil directly over the surface after every use and seal the container tightly. For homemade batches, briefly blanching the basil before processing significantly slows oxidation both in the fridge and freezer.




