Quick Answer: Refrigerator, Freezer, and Counter

After opening, how long does basil pesto last? A jar of basil pesto lasts about 5 to 7 days in the refrigerator after you break the seal, and up to 3 months in the freezer. Fresh homemade pesto is less forgiving: roughly 3 to 5 days refrigerated, because it has no commercial preservatives and often contains more fresh garlic and cheese than a shelf-stable jar. Those are typical windows, not guarantees. The real clock depends on whether the pesto is jarred or fresh, whether it contains dairy, how clean your spoon was, and how cold your fridge actually runs. This guide breaks down each case, shows the signs that the pesto has turned, and explains how to stretch the window safely.

The Fridge Clock: What Sets the 5-to-7-Day Window

The refrigerated shelf life of opened pesto is governed less by the basil than by the other ingredients. Olive oil, garlic, pine nuts, and hard cheese create an environment where spoilage organisms and, in some cases, moisture-loving bacteria can develop once air and a used spoon enter the jar. Commercial pesto slows this down with added acid (usually citric or ascorbic acid) and a pasteurization step before filling. Once you open the jar, that protective barrier is only as good as your handling. A clean, dry spoon and a tightly resealed lid are the two biggest levers you control. A jar that sits on the counter for an hour after each use will spoil faster than one returned to the fridge immediately.

Jarred versus Fresh: A Side-by-Side Comparison

Factor Refrigerated jarred pesto (opened) Shelf-stable jarred pesto (opened) Fresh homemade pesto
Typical fridge life 5–7 days 5–7 days 3–5 days
Freezer life Up to 3 months Up to 3 months Up to 3 months
Preservatives Often citric or ascorbic acid Usually citric acid None
Dairy content Usually Parmesan and sometimes pecorino Varies; check label Usually Parmesan
Main spoilage risk Mold on the surface, off smells Mold, oil rancidity Mold, garlic-related bacterial risk, oil rancidity
Best storage Airtight, coldest part of fridge Airtight, coldest part of fridge Airtight, pressed flat, thin oil layer on top

The comparison matters because people often lump all pesto together. A shelf-stable jar and a refrigerated tub have different starting points, but once opened, both behave similarly because the protective atmosphere is gone. The table above uses equivalent conditions: all three are opened, refrigerated at about 40°F (4°C), and handled with a clean utensil.

Why Fresh Pesto Has a Shorter Window

Homemade pesto contains raw garlic and fresh basil, both of which carry a higher microbial load than a pasteurized commercial product. Garlic in oil is a known botulism risk when stored at room temperature, which is why fresh pesto should never be left out. In the fridge, the cold slows but does not stop bacterial growth. The cheese also introduces moisture and a medium for mold. If your recipe uses lemon juice, that acidity buys you a little time, perhaps a day. If it uses only oil, basil, nuts, garlic, and cheese, treat 3 days as the safe default and 5 days as the outer edge only if the pesto looks and smells clean and has been refrigerated continuously.

Freezing Pesto: The Three-Month Rule and How to Do It

Freezing is the most reliable way to extend pesto past the first week. Opened jarred pesto and fresh pesto both freeze well for up to 3 months. The oil does not freeze solid at typical freezer temperatures, so the texture stays scoopable. Portion it before freezing. Spoon pesto into ice cube trays, freeze until solid, then transfer the cubes to a freezer bag. Each standard cube is about 1 tablespoon, which is a convenient amount for a single serving of pasta or a sandwich spread. Label the bag with the date. After 3 months, quality declines: the basil darkens, the nuts turn stale, and the oil can pick up freezer odors. It remains safe longer in theory, but the taste is not worth it.

Thawing and Reusing Frozen Pesto

Thaw frozen pesto in the refrigerator overnight, not on the counter. A quick thaw in a warm water bath works if the pesto is sealed in a bag, but avoid microwaving it, which can split the emulsion and cook the basil. Once thawed, use it within 24 hours and do not refreeze. If you thaw a whole batch and only need part, scoop what you need and return the rest to the freezer immediately.

How to Tell If Pesto Has Gone Bad: Sensory Checks

Trust your senses first, but know what to look for. Fresh pesto is bright green, smells of basil and garlic, and tastes nutty and herbal. Spoiled pesto shows one or more of these signs:

Color: Dark brown or gray-green patches, especially on the surface. Some darkening is normal oxidation, but uniform dullness plus an off smell is a bad sign. Mold: Fuzzy white, green, or black spots. Discard the whole jar, not just the top layer, because mold filaments can extend below the surface in soft, oily foods. Smell: Sour, fermented, or rancid notes. Rancid oil smells like old nuts or crayons. Texture: Slimy or watery separation that does not re-emulsify when stirred. Taste: A sharp, bitter, or fizzy sensation. Spit it out and discard.

If any of these appear, throw the pesto away. Do not try to salvage it by scraping off the top, and do not cook with it to "kill" the problem. Heat does not destroy all spoilage toxins.

The Role of Acid, Salt, and Oil in Shelf Life

Three ingredients quietly determine how long your pesto stays good. Acid, usually from lemon juice or added citric acid, lowers the pH and slows bacterial growth. Salt pulls moisture away from microbes and improves flavor. Oil creates a barrier against oxygen, which is why a thin layer of olive oil on top of fresh pesto helps. You can nudge the odds in your favor by pressing plastic wrap directly onto the surface of the pesto before sealing the lid, which limits air contact. None of these tricks extends the safe window indefinitely. They buy time within the ranges above, not beyond them.

Storage Mistakes That Shorten Pesto's Life

A few common habits cut pesto's fridge life short. Leaving the jar out while you cook, dipping a used spoon back into the jar, or storing it in the door shelf where the temperature fluctuates are all culprits. The door is the warmest part of most refrigerators. Store pesto in the main body of the fridge, ideally toward the back where it is coldest. Use a clean, dry spoon each time. If you use pesto as a dip, spoon out what you need into a separate bowl rather than double-dipping. These habits are simple but they matter more than any single ingredient.

A Worked Example: Cost of Wasted Pesto

Suppose a 6-ounce jar of refrigerated pesto costs about $5. You open it, use two spoonfuls for a pasta dinner, and forget about it for ten days. You throw away roughly $4 of pesto. Over a year, if this happens twice a month, that is about $96 in wasted pesto. The fix costs nothing: freeze half the jar in cubes the day you open it, and you keep the value. The arithmetic assumes a $5 jar and two forgotten jars per month; your actual numbers will differ with brand and use.

What About Pesto Made With Other Greens?

Pesto is not always basil. Arugula, spinach, kale, and parsley pesto follow the same basic rules, but the greens change the clock slightly. Arugula pesto tends to oxidize faster and turn brown within a day or two. Kale pesto holds up a bit longer because the leaves are sturdier. The safe windows in this article apply to basil pesto specifically; for other greens, use the same sensory checks and shorten the fridge window by a day if the pesto looks dull.

Frequently Asked Questions

Can I leave pesto out overnight?

No. Opened pesto, especially fresh pesto with garlic, should not sit at room temperature for more than two hours. Garlic in oil at room temperature creates a botulism risk. Discard pesto left out overnight.

Does pesto go bad faster in a plastic container than a glass jar?

Glass is non-porous and does not absorb odors or oils, so it is the better choice for long storage. Plastic is fine for a few days, but glass helps preserve flavor and makes it easier to see spoilage.

Can I freeze pesto in the jar it came in?

Only if the jar is freezer-safe and you leave headspace for expansion. Most commercial pesto jars are not designed for freezing and can crack. Transfer to ice cube trays or a freezer bag instead.

Is it safe to eat pesto past its printed date if it was never opened?

An unopened jar is governed by its printed date, not the opened-jar windows in this article. Once opened, the 5-to-7-day fridge window applies regardless of the printed date.

This article is general food-safety information, not a substitute for official guidance. If you are pregnant, immunocompromised, or preparing food for someone in those groups, consult a qualified health professional or your local food-safety authority about raw garlic and oil-based products. For immediate illness concerns, contact local emergency or health services.