How Long Fresh Pesto Lasts in the Refrigerator and How to Store It Properly
Fresh pesto lasts three to four days in the refrigerator when stored correctly
Fresh pesto made with basil, garlic, pine nuts, cheese, and olive oil breaks down quickly because the basil oxidizes and the garlic can develop off-flavors. The three to four day window is your reliable timeframe for pesto that tastes like you made it today. After that, the color dulls to brown-green, the flavor flattens, and you risk bacterial growth if any moisture has collected in the container.
The main enemy is air exposure. Pesto darkens and loses flavor when oxygen touches it, which happens every time you open the jar. Temperature swings matter too—if your refrigerator door opens and closes frequently, the pesto warms slightly each time, speeding up breakdown. A consistently cold back shelf is better than the door.
You can extend pesto's life to five to seven days by using specific storage methods, but you are trading some flavor quality for that extra time. Most home cooks find the three to four day window is when pesto tastes best, so that is the practical target.
Key Takeaways
- Fresh pesto keeps for three to four days in the refrigerator when stored in an airtight container on a back shelf, away from the door.
- Pressing plastic wrap directly onto the pesto surface before sealing the container slows oxidation and extends freshness by a day or two.
- Pesto stored in a jar with a thin layer of olive oil on top lasts longer because the oil creates a barrier against air and bacteria.
- Freezing pesto in ice cube trays or small containers preserves it for two to three months and works better than refrigerator storage if you cannot use it within a week.
Why pesto spoils faster than other refrigerated foods
Pesto is mostly raw ingredients—no cooking step to kill bacteria or stabilize flavors. The basil leaves are delicate and begin breaking down the moment they are crushed. Garlic releases sulfur compounds that intensify over time, turning sharp and unpleasant. The combination of moisture from the basil, acid from the lemon juice or vinegar, and fat from the olive oil and nuts creates an environment where mold can grow if air gets in.
Unlike cooked sauces that have a protective layer of heat-killed bacteria and stable flavors, pesto is a living thing in the refrigerator. It continues to oxidize, darken, and shift flavor every day. This is not dangerous at the three to four day mark—it is just no longer the pesto you made.
The best container and placement for pesto storage
Use a small glass jar with a tight-fitting lid, or a plastic container designed for food storage with a snap-on lid. Glass is better because it does not absorb odors or stains, and you can see the pesto's color and condition without opening it. The container should be just large enough to hold your pesto—a half-full jar means more air space, which speeds oxidation.
Place the pesto on the back shelf of your refrigerator, not on the door. Door shelves experience temperature fluctuations every time the door opens, warming the pesto slightly and encouraging breakdown. The back of the refrigerator stays coldest and most stable. If your refrigerator has a dedicated vegetable drawer or a coldest shelf, use that.
Before sealing the lid, press a piece of plastic wrap directly onto the pesto surface. This creates a barrier that slows air contact. Then seal the lid on top. This two-layer approach is the single most effective storage method for extending pesto life by one to two days.
Using an olive oil layer to protect pesto
Pesto stored under a thin layer of olive oil lasts five to seven days because the oil seals out air and bacteria. Pour a quarter-inch layer of olive oil over the top of your pesto, then seal the container. The oil floats on top and creates a protective barrier. When you scoop out pesto, you are breaking that seal, so this method works best if you plan to use the pesto in one or two portions rather than dipping into it daily.
This method changes the flavor slightly—the pesto absorbs some of the oil's taste, and the oil itself may pick up pesto flavors. Most people find this acceptable, especially if the oil is good quality and neutral-tasting. Avoid strongly flavored oils like garlic-infused or chili oil, which will overpower the basil.
When you are ready to use the pesto, scoop from the top and leave the oil layer intact if possible. If you do break the seal, you can add a fresh thin layer of oil to extend storage another day or two. The pesto underneath the oil stays fresher longer than exposed pesto.
Freezing pesto for longer storage
Freezing is the best option if you made a large batch or know you will not use the pesto within four days. Pesto freezes well and keeps for two to three months. The texture becomes slightly softer when thawed—the basil leaves lose some structure—but the flavor remains close to fresh.
Freeze pesto in ice cube trays for portion control. Fill each cube with about two tablespoons of pesto, freeze solid (usually overnight), then pop the cubes into a freezer bag and label with the date. This way you can thaw exactly what you need. Alternatively, freeze pesto in small glass jars or plastic containers, leaving a half-inch of headspace because pesto expands slightly as it freezes.
Thaw frozen pesto in the refrigerator overnight, or use it straight from the freezer if you are stirring it into a hot pasta or soup—the heat will thaw it. Do not thaw pesto at room temperature, which encourages bacterial growth. Once thawed, use the pesto within one to two days; do not refreeze it.
Signs that pesto has gone bad
Discard pesto if you see mold (white, green, or black spots), if it smells sour or rancid, or if the texture is slimy. A color change from bright green to dull olive or brown is normal and does not mean the pesto is unsafe, but it signals that flavor has declined. Taste a tiny amount on your finger—if it tastes off, musty, or unpleasantly sharp, throw it out.
Pesto that has been left at room temperature for more than two hours should be discarded. If you made pesto and forgot about it on the counter, refrigerate it immediately and use it within two days rather than the usual three to four. The time at room temperature has already stressed the basil and encouraged bacterial growth.
Making pesto last longer from the start
Start with the freshest basil you can find. Basil that is already wilting or bruised will break down faster in pesto. Wash and dry the basil thoroughly before making pesto—excess water dilutes the sauce and promotes mold growth. Pat the leaves dry with paper towels or spin them in a salad spinner.
Use a food processor rather than a mortar and pestle if you want pesto to last longer. A food processor creates a finer, more uniform texture with less exposed surface area for oxidation. A mortar and pestle bruises the basil more aggressively, releasing more juices and speeding breakdown. The trade-off is that mortar-and-pestle pesto tastes slightly better on day one but does not keep as long.
Make smaller batches more often rather than one large batch. A half-cup of pesto used within three days tastes better than a full cup that sits for a week. If you freeze half the batch immediately after making it, you get the best of both: fresh pesto now and a backup supply later.
Frequently Asked Questions
Can I store pesto in the freezer instead of the refrigerator from the start?
Yes. If you know you will not use the pesto within four days, freeze it immediately after making it. Frozen pesto keeps for two to three months and tastes better than refrigerated pesto that has been sitting for a week. Thaw it in the refrigerator when you are ready to use it.
Does store-bought pesto last longer than homemade pesto?
Yes, significantly. Store-bought pesto contains preservatives, stabilizers, and sometimes heat treatment that extend shelf life to two to three weeks after opening. Homemade pesto has none of these, so it lasts only three to four days. Check the jar label for the manufacturer's recommendation after opening.
What if my pesto separates and the oil pools on top?
Separation is normal and does not mean the pesto is bad. Stir it back together before using. If separation happens repeatedly, your pesto may have too much oil relative to other ingredients. Next time, use slightly less oil or add a tablespoon of grated cheese, which helps bind the mixture.
Can I use pesto that has been in the refrigerator for five days if it looks and smells okay?
You can, but flavor will have declined noticeably. The basil will taste dull and the garlic sharp. If the pesto is going into a cooked dish like pasta or soup where it will be heated, five-day-old pesto is acceptable. If you are using it raw on bread or as a garnish, make fresh pesto instead.
Does adding more salt or lemon juice help pesto last longer?
Salt and acid slow bacterial growth slightly, but they do not significantly extend pesto's life. Adding extra salt or lemon juice changes the flavor noticeably. Stick with the original recipe and rely on proper storage—airtight container, plastic wrap, back shelf, or freezing—rather than adjusting the ingredients.