Skip to main content

How Long Pesto Lasts in the Refrigerator and How to Store It Properly

Pesto lasts three to four days in the refrigerator when stored correctly, though the color and flavor fade faster than the safety window

Pesto is a fresh sauce made from basil, garlic, pine nuts, cheese, and oil, and it spoils more quickly than cooked sauces because it contains no heat-stable preservatives. The main risk is not bacterial growth—the acidic ingredients and oil create an unfriendly environment for pathogens—but rather oxidation, which turns the bright green color brown and flattens the flavor. You can eat pesto safely for up to a week if stored in an airtight container, but most home cooks find it unappetizing after day four.

The reason pesto darkens is that basil contains chlorophyll and polyphenols, compounds that break down when exposed to air and light. This is not a sign of spoilage; it is a sign of age. Pesto that has turned olive-brown is still safe to eat if it smells like pesto and not like rancid oil or fermented garlic, but the fresh, peppery bite you made it for will be gone.

Key Takeaways

  • Store pesto in an airtight glass container with plastic wrap pressed directly onto the surface to minimize air contact.
  • Pesto lasts three to four days at peak quality and up to seven days if stored properly, though color and flavor decline steadily.
  • Freezing pesto in ice cube trays or small containers extends its life to three to four months with minimal flavor loss.
  • A thin layer of olive oil on top of pesto in the jar slows oxidation and can buy you an extra day or two of good color.

The best container and seal method for pesto

Glass containers with airtight lids are the gold standard for pesto storage. Glass does not absorb odors or oils the way plastic does, and an airtight seal keeps oxygen out. If you are transferring homemade pesto from a blender or food processor, pour it into a clean glass jar with a tight-fitting lid—a mason jar works well—and fill it to the top so there is as little air space as possible.

If you have extra headroom in the jar, press a piece of plastic wrap directly onto the surface of the pesto before screwing on the lid. This creates a second barrier against air and slows the browning noticeably. Some cooks pour a thin layer of olive oil on top of the pesto before sealing; the oil floats on the surface and blocks oxygen from reaching the basil below. This method can extend the bright-green window by a day or two, though the pesto will still darken underneath.

Store the jar on a shelf in the coldest part of your refrigerator, not on the door. Door shelves experience temperature swings every time you open the fridge, which speeds up oxidation and can cause the oil to separate.

Why homemade pesto spoils faster than store-bought

Commercial pesto often contains preservatives like citric acid or ascorbic acid (vitamin C), which slow oxidation and extend shelf life to two or three weeks. Homemade pesto has none of these, so it ages faster. Some recipes include lemon juice or vinegar, which adds acid and can slow browning slightly, but the effect is modest.

The freshness of your basil also matters. If you made pesto from basil that was already a few days old, the chlorophyll has already begun to break down, and the pesto will brown faster. Pesto made from basil picked that morning will hold its color longer than pesto made from supermarket basil that has been sitting in a plastic clamshell for days.

Freezing pesto for longer storage

Freezing is the best way to preserve pesto beyond a week. Frozen pesto keeps for three to four months and thaws with minimal flavor loss, though the texture becomes slightly softer because the basil cells rupture as ice crystals form. The color also fades during freezing, but it is already faded compared to fresh, so most people do not notice the difference.

The easiest method is to freeze pesto in ice cube trays. Spoon a tablespoon or so into each cube, freeze until solid (usually four to six hours), then pop the cubes into a freezer bag and label it with the date. One or two cubes thaw quickly and are the right portion for a single serving of pasta or a sandwich. Alternatively, spoon pesto into small glass jars or freezer-safe containers, leaving a half-inch of headroom so the pesto can expand as it freezes without cracking the lid.

Do not freeze pesto in plastic bags or thin containers; they crack easily and allow freezer burn. Freezer burn does not make pesto unsafe, but it causes the surface to dry out and taste stale.

Signs that pesto has gone bad

Pesto that has turned brown or olive-colored is not necessarily bad—that is just age. The real warning signs are smell and mold. If the pesto smells sour, fermented, or like rancid oil, throw it out. If you see any fuzzy growth or dark spots on the surface, discard it immediately.

A thin layer of separation—oil pooling on top and a drier layer below—is normal and not a sign of spoilage. Stir it back together before using. If the pesto smells fine but tastes flat or bitter, it is past its peak but still safe; you can use it in cooked dishes where the flavor will blend with other ingredients, rather than as a fresh topping.

Using pesto before it browns

If you make a large batch and know you will not use it all within three days, freeze half of it immediately. This is easier than watching it brown and then wishing you had frozen it earlier. Pesto freezes best when it is freshest, so do not wait until day five to freeze the leftovers.

You can also extend the life of pesto by using it in cooked dishes. Heat breaks down the compounds that cause browning, and pesto stirred into hot pasta, soup, or roasted vegetables will taste fresher longer than pesto sitting in a jar. Stir it in at the end of cooking so the basil flavor does not cook away.

Storing store-bought pesto

Store-bought pesto in a sealed jar lasts much longer than homemade—usually two to three weeks in the refrigerator, sometimes longer depending on the preservatives used. Check the label for the "use by" date and follow it. Once you open the jar, the clock resets; opened store-bought pesto follows the same rules as homemade and should be used within a week for best quality.

If you open a jar and do not use much, transfer the remainder to a smaller airtight container to reduce air space. The less pesto sits exposed to oxygen, the longer it holds its color and flavor.

Frequently Asked Questions

Can I eat pesto that has turned brown?

Yes, if it smells like pesto and not like rancid oil or fermented garlic. Brown pesto is oxidized, not spoiled. The flavor will be muted and the color unappealing, but it is safe to eat. Use it in cooked dishes where the color does not matter as much.

Does pesto with pine nuts go bad faster than pesto without?

Yes, slightly. Pine nuts contain oils that can turn rancid, especially if the nuts were not fresh when you bought them. Pesto made with pine nuts should be used within three days for best flavor. Pesto made with walnuts or no nuts at all lasts a day or two longer.

What if I forgot to refrigerate pesto for a few hours?

Pesto left at room temperature for two to four hours is still safe if it smells normal. The flavor and color will have degraded, but bacteria grow slowly in acidic, oily environments. If it sat out for more than four hours or smells off, discard it.

Can I freeze pesto with cheese already mixed in?

Yes, but the cheese texture changes slightly when frozen and thawed. Parmesan becomes grainy and less creamy. If you plan to freeze pesto, you can add the cheese before freezing or stir it in after thawing. Either way works; it is a matter of preference.

Does pesto made in a food processor last longer than pesto made by hand?

No. The storage life depends on the ingredients and how you store it, not how you made it. A food processor does introduce slightly more air into the pesto, which can speed browning by a few hours, but the difference is small.