This post contains affiliate links. As an Amazon Associate I earn from qualifying purchases. If you click a link and make a purchase, I may receive a small commission at no extra cost to you.
Basil pesto keeps for about 5 to 7 days in the refrigerator when stored properly in an airtight container.
That’s the short answer, but the real question is how you store it and how you handle it from the moment you make or open it.
If you’ve ever wondered how long does basil pesto keep before it goes bad, you’re not alone, because pesto is one of those sauces that seems to spoil overnight if you’re not careful.
The shelf life of basil pesto depends on a few key factors like whether it’s homemade or store-bought, whether the jar has been opened, and whether you’re keeping it cold or freezing it.
In this post, we’ll break down exactly how long does basil pesto keep in the fridge, how long does basil pesto keep in the freezer, and the best signs that your pesto has turned.
Let’s dig in so you never waste another drop of that delicious green sauce.
How Long Does Basil Pesto Keep In The Fridge?
The fridge is where most people store their pesto, and it’s a solid choice, but you need to know the limits.
Basil pesto keeps for about 5 to 7 days when refrigerated, assuming you’ve sealed it well and kept it at a consistent temperature below 40°F.
But that timeline isn’t a magic number, because how long does basil pesto keep can shift based on the ingredients and how fresh they were.
1. Homemade Pesto Has a Shorter Window
Homemade basil pesto keeps for a shorter time than commercial versions because it lacks preservatives.
Fresh basil, garlic, Parmesan, pine nuts, and olive oil are all perishable, and the garlic especially can turn fast.
If you’ve made pesto from scratch, expect it to stay good for about 4 to 5 days in the fridge, maybe 7 if you’re lucky.
The olive oil helps create a barrier against air, but it doesn’t stop bacterial growth forever.
So when you ask how long does basil pesto keep from a homemade batch, the honest answer is closer to 5 days than a full week.
2. Store-Bought Pesto Lasts Longer Before Opening
If you’re wondering how long does basil pesto keep when it’s unopened from the store, the answer is much longer.
An unopened jar of store-bought basil pesto keeps for months, often 6 to 12 months past the production date, because it’s pasteurized and sealed.
Once you pop that lid, though, the clock starts ticking, and it drops to the same 5 to 7 day window as homemade.
The packaging makes a big difference, too, because glass jars with tight lids keep pesto fresher longer than plastic tubs.
3. The Olive Oil Layer Trick Extends Fridge Life
One of the best ways to maximize how long does basil pesto keep in the fridge is to add a thin layer of olive oil on top.
This oil layer acts as a seal, preventing oxygen from reaching the pesto and slowing down oxidation.
Oxidation is what causes pesto to darken and develop off flavors, so blocking air is your best defense.
If you do this and keep the jar tightly closed, you can stretch that 5 day window to a full 7 days.
Just remember to stir the oil in when you use the pesto again, and you’re good to go.
How Long Does Basil Pesto Keep In The Freezer?
When you want pesto to last beyond a week, the freezer is your best friend, and it changes the answer to how long does basil pesto keep dramatically.
Frozen basil pesto keeps for up to 6 months, sometimes even a year, if you store it properly in an airtight container or freezer bag.
The key is to freeze it quickly and keep it away from air, because freezer burn can ruin the texture and flavor.
1. Use Ice Cube Trays for Single Servings
The easiest way to make basil pesto keep for months is to freeze it in ice cube trays.
Spoon the pesto into each cube, freeze it solid, then pop the cubes into a zip-top freezer bag.
Each cube is roughly one tablespoon, which is perfect for tossing into pasta or soups.
This method prevents you from thawing a whole jar and refreezing it, which would mess up the texture.
2. Portion and Wrap Tightly
If you don’t have ice cube trays, you can freeze pesto in small jars or freezer bags.
The trick is to leave a little headspace at the top, because pesto expands as it freezes.
Press out as much air as possible from the bag, and you’ll lock in that fresh basil flavor.
When you’re ready to use it, thaw it overnight in the fridge, not on the counter, to keep it safe.
3. Freezing Changes the Answer To How Long Does Basil Pesto Keep
Here’s the thing, freezing doesn’t make pesto last forever, but it does push that answer from days to months.
After 6 months, the flavor starts to fade, and the color may dull a bit, even if it’s still safe to eat.
So if you’re asking how long does basil pesto keep beyond a few weeks, freezing is your only real option.
It’s a game-changer for meal prep, because you can make a big batch in summer and enjoy it all winter.
How To Tell If Basil Pesto Has Gone Bad
No matter how long does basil pesto keep, there comes a point when you need to toss it, and your senses will tell you.
The first sign of spoilage is a change in smell, because fresh pesto smells bright and garlicky, while bad pesto smells sour or rancid.
The olive oil can go rancid over time, and that rancid smell is a dead giveaway.
1. Watch For Mold or Discoloration
If you see any fuzzy spots of mold, especially green or white patches on the surface, throw the pesto out immediately.
Discoloration is trickier, because pesto naturally darkens from oxidation, but if it turns brown or gray, that’s a bad sign.
A little darkening on top is normal, but if the whole batch looks muddy, it’s past its prime.
2. Check The Texture
Fresh pesto should be smooth and slightly oily, but spoiled pesto becomes watery, slimy, or separates in weird ways.
If the oil separates completely from the solids and it looks broken, that’s not necessarily bad, but if it feels slimy, it’s done.
Sliminess usually means bacteria have moved in, and no amount of cooking will make it safe again.
3. Trust Your Taste Buds
When in doubt, taste a tiny bit on the tip of your tongue, because your palate will catch what your nose might miss.
If it tastes sharp, bitter, or just “off,” don’t risk it, and toss the whole batch.
Food poisoning isn’t worth saving a few dollars, especially when basil pesto is cheap to make fresh.
So, How Long Does Basil Pesto Keep?
Basil pesto keeps for about 5 to 7 days in the fridge and up to 6 months in the freezer when stored correctly.
That’s the simple answer, and it applies whether you’re dealing with homemade or store-bought, opened or unopened.
The biggest factors are air, temperature, and moisture, so always seal it tight and keep it cold.
If you add that olive oil layer, you’ll get closer to the 7 day mark, and if you freeze it, you’ll have pesto for months.
Just rely on your senses to catch spoilage early, and you’ll never have to wonder how long does basil pesto keep again.
Hope this clears things up so you can enjoy your pesto without any guesswork, and happy cooking.