Does Pesto Go Bad?

The thing that I hate the most about store-bought pesto, and other refrigerated foods for that matter, is the size of the container.

More often than not a single container is more than I need for a single recipe. That leaves me with a half-open jar sitting in the fridge that I have to remember to use.

And at a certain point, the dreaded question comes up: does pesto go bad?

If you’d like to learn more about the shelf life, storage, and going bad of pesto, this article is for you. In it, we cover both the store-bought and the homemade variety. That means we’ve got you covered if you prefer to make this sauce yourself.

Fresh pesto
Fresh pesto

How To Store Pesto

There are two kinds of pesto available on the market. The first one is sold unrefrigerated, while the second one sits in the refrigerated section of the store. The same thing goes for other sauces and dips.

Let’s start with the former. Unrefrigerated pesto usually comes in jars or tins. Since it sits at room temperature at the store, you can store it at room temperature too, as long as it’s unopened.

Make sure it’s in a cool and dry area, away from sunlight and heat sources. Some sunlight and temperature changes won’t make it go bad in the container, but the quality after opening might not be that great.

Once you open the container, make sure it’s always sealed tightly and sits in the fridge when not in use. If the pesto comes in a tin, pour it into a sealable container before refrigerating.

The second variety of commercial pesto is the one that’s sold refrigerated. Storing it is not rocket science: the moment you get home with it, you put it into the fridge and keep it there.

Once you open the container, keep it always sealed tightly. If the original container isn’t sealable, pour the pesto into a small food container.

When it comes to homemade pesto, you should always keep it in the fridge and sealed tightly. If you expect to keep it in the refrigerator for a few days, add some olive oil on top before chucking it into the refrigerator. That will help it retain quality for a bit longer.

Pesto in an airtight container
Pesto in an airtight container

Can You Freeze Pesto?

If you would like to extend pesto’s shelf life, you can freeze it.

Please note that freezing pesto might result in a slight change of texture after thawing. The quality of this sauce after defrosting depends on the ingredients used to make the pesto and when it was frozen.

Also, please remember that in some dishes the altered texture will blend in well, while in others it will be noticeable.

In short, you need to do some testing to figure out if your pesto freezes well and how it works in your favorite dishes.

When it comes to how to freeze pesto, try freezing it in ice cube trays. This way you can easily thaw as much of the sauce as you need.

How long can you store pesto in the freezer, you ask? Buitoni recommends for 30 days only, but obviously, pesto in the freezer won’t spoil. Its quality will degrade over time, though, so the sooner you use it, the better.

Making pesto mortar and pestle
Making pesto mortar and pestle

How Long Does Pesto Last

Once again, let’s start with the shelf life of commercially packaged pesto sold unrefrigerated.

It usually comes with a best-by date on the label. The sauce, as long as you leave it unopened, can easily last a few weeks or maybe even months after that date. Of course, it won’t last in good quality as long as hot sauce, but it’s not like it will go bad a day or two after the date on the label.

Once you open the jar or tin, you can keep the sauce for about 7 to 10 days.

When it comes to the store-bought pesto sold in the refrigerated area, in most cases it has a use-by date on the label. The unopened sauce should retain good quality for maybe up to 5 to 7 days past that date. Sometimes it keeps fresh for longer, but that’s not a given.

Once you open the container, you should finish it within 5 to 7 days. The unrefrigerated pesto usually contains more preservatives than the refrigerated variety, so it also lasts longer after opening.

Homemade pesto lasts for 4 to 5 days in the fridge. Self-made pesto usually doesn’t contain any preservatives, so nothing is preventing it from going bad, hence the short period.

Of course, it would be ideal if you would take a mortar and a pestle and whip up fresh pesto for every dish. But as we all know, it’s an unrealistic scenario.

Related: How Long Does Homemade Salsa Last?
Related: How Long Does Alfredo Sauce Last?


If you would like to prepare a bigger batch, check out the freezing instructions earlier.

Pesto (sold unrefrigerated, unopened)Best-by + 1 – 3 months 
Pesto (sold unrefrigerated, opened) 7 to 10 days
Pesto (sold refrigerated, unopened) Use-by + 5 – 7 days
Pesto (sold refrigerated, opened) 5 – 7 days
Pesto (homemade) 4 – 5 days

Please note that the periods above are rough estimates.

Fresh spaghetti with pesto and chicken
Fresh spaghetti with pesto and chicken

How To Tell If Pesto Is Bad

There are a few things to look out for when it comes to spoiled pesto.

Of course, there are the usual suspects, like mold or any other organic growth. Look for them on both the surface of the sauce and the inside of the container.

The second classic sign of spoilage is an off or rotten smell. If the sauce doesn’t smell fresh like it usually does, it’s past its prime, and you should discard it.

Next in line are the basil leaves. If they’ve changed color from green to brownish, it’s a good indicator that the pesto should be discarded.

Olive oil separated in pesto
Olive oil separated (and quite dense) in pesto – normal in homemade pesto after a few hours of storage

If everything about the sauce seems okay, it should be fine. Give a small amount a taste and decided based on that if it’s good enough to use. If not, discard it.

Last but not least, please remember that pesto spoils quickly. If you’re questioning if it’s okay to eat, it usually means it’s not. Trust your senses and throw the sauce out if that’s the case.

Same thing if it sits in the fridge for an extended period, like over a week for homemade pesto. Even if everything seems to be okay with it, it’s better to stay on the safe side and discard it. The first signs of it going bad are difficult to spot, so assuming it’s already off is the right choice here.