How long does pesto last in the fridge?
Quick answer
- In the fridge
- Homemade: up to 3 days · Opened jar or tub: 3 days, or sooner if the label says so · Unopened: by the date on the pack (USDA FoodKeeper: jarred pesto up to 6 months from purchase, never past that date)
- In the freezer
- Homemade, in cubes: up to 3 months for best quality · Jarred pesto: 1 month (USDA)
- In the pantry
- Shelf-stable jar, unopened: until the date on the jar · Homemade, refrigerated-case or opened pesto: 2 hours at most, 1 hour above 32°C (90°F)
Sources: USDA FoodKeeper: Pesto, jarred, National Center for Home Food Preservation (University of Georgia): Freezing Pesto, USDA FSIS: Shelf-Stable Food Safety, USDA FSIS: Freezing and Food Safety, FDA: Are You Storing Food Safely?, CDC: Botulism Prevention, Oregon State University Extension: Herbs and Vegetables in Oil (SP 50-701), Michigan State University Extension: Savoring summer with pesto – now and later, NC State University, Cooking Essentials: Pick Your Pesto (PDF), Turrini et al., Molecules (2022): A Preliminary Color Study of Different Basil-Based Semi-Finished Products during Their Storage · Last reviewed October 28, 2026
Homemade pesto keeps no more than 3 days in the fridge, according to the National Center for Home Food Preservation (NCHFP), and USDA FoodKeeper gives an opened jar of store-bought pesto the same 3 days. Frozen in small portions, homemade pesto can be stored for up to 3 months, says NC State University's Cooking Essentials program. FoodKeeper's single entry, jarred pesto, gives 6 months from purchase in the fridge and no pantry time; it doesn't say whether the jar was sold chilled, so never go past the date on the pack. A shelf-stable jar can wait in the cupboard until that date, which FSIS says marks quality, not safety. When in doubt, throw it out.
How to store pesto
Classic pesto is raw basil, garlic and nuts blended with cheese and oil, and that mix is why homemade pesto has to stay cold. Oregon State University Extension explains that garlic and herbs are low-acid foods that can carry Clostridium botulinum, and that storing them in oil creates an oxygen-free environment in which these bacteria grow; the CDC counts chopped garlic in oil among known sources of botulism. Commercial garlic-in-oil products are acidified so they can be stored at room temperature, Oregon State notes, but flavored oils made at home, pesto included, must be refrigerated or frozen. Keep your fridge at 4°C (40°F) or colder and your freezer at −18°C (0°F), as the FDA advises.
- Read the label before you put store-bought pesto away. USDA FSIS explains that a product labeled "Keep Refrigerated" is not safe at room temperature, while shelf-stable foods don't need the fridge until they're opened; keep those jars in a cool, dry cupboard below 29°C (85°F), never next to the stove.
- Refrigerate homemade pesto as soon as it's made, in a clean, covered jar with the date on the lid. Make only what you'll eat within 3 days and freeze the rest: NCHFP's limit is 3 days, Oregon State's is 4.
- Write the opening date on every jar or tub of store-bought pesto. FoodKeeper's time for opened jarred pesto is 3 days; if the label gives a shorter one, follow the label.
- Freeze extra pesto in an ice cube tray, then move the frozen cubes into a freezer bag, as NC State University's Cooking Essentials handout suggests. For larger batches, NCHFP recommends glass freezer jars or plastic freezer boxes with 1/2 inch (1.3 cm) of headspace; label and date each one.
- Leave the cheese out of a batch meant for the freezer and stir it in when you heat the pesto, following Michigan State University Extension's method, which also allows a thin layer of olive oil on top before the lid goes on.
- Thaw frozen pesto in the refrigerator, not on the counter, or use the cubes to season soups, stews and sauces, as Oregon State suggests. USDA FSIS points out that microbes can become active again once food thaws, so treat thawed pesto as perishable.
Signs it has gone bad
- Fuzzy spots in the oil film on top, on the green paste beneath or on the inside of the lid are mold: the whole batch goes, not just the spoonful around them.
- A sour, fermented or otherwise off smell, or a paste that feels slimy: discard it without tasting.
- On a sealed store-bought jar: a bulging or loose lid, a crack in the glass, or contents that spurt out when you open it. FSIS lists these among possible botulism warnings and says not even to taste the food.
- Homemade pesto that has been in the fridge longer than 3 days, or out at room temperature longer than 2 hours, goes in the trash even if it looks and smells normal: the CDC warns that you cannot see, smell or taste the toxin that causes botulism.
- Frozen pesto that smells rancid or off once thawed: FSIS says foods that develop a rancid or off odor after too long in the freezer should be discarded.
- A top layer that has turned darker, brownish green: basil loses its bright color as pesto ages. Color alone means lost freshness; throw it out if you also see mold, notice an off smell, or it's past the time limits above.
Frequently asked questions
Does pesto need to be refrigerated?
Homemade pesto always does, and so does pesto bought from the refrigerated case. A shelf-stable jar from an unrefrigerated shelf can stay in the pantry until you open it, then it goes in the fridge. Don't leave opened or homemade pesto out for more than 2 hours, or 1 hour above 32°C (90°F), the FDA's limit for foods that need refrigeration.
How long does store-bought pesto last after opening?
Three days in the fridge for an opened jar, by USDA FoodKeeper's figure, and with no separate official figure for refrigerated tubs, the same 3 days is the closest guide for them too. The FDA advises checking storage directions on labels: if a jar or tub gives a shorter after-opening time, follow the label.
Can you freeze pesto?
Yes. NCHFP says pesto may be frozen for long-term storage, and NC State's Cooking Essentials handout gives frozen portions up to 3 months; FoodKeeper's freezer time for jarred pesto is 1 month. USDA FSIS explains that freezer times like these are about quality, not safety.
Can you can homemade pesto or keep it at room temperature?
No. Oregon State University Extension says no research has been done on safe canning times for pesto, so there is no tested home canning method. Garlic and herbs kept in oil at room temperature are a botulism risk: the CDC tells home cooks to refrigerate homemade garlic or herb oils and throw them out after 4 days, and NCHFP's fridge limit for pesto is 3 days.
Why does pesto turn brown?
Basil's green comes from chlorophyll, which can turn into brownish pigments during storage, and cutting the leaves can set off browning too. University of Genoa researchers found that refrigerated basil-and-oil bases made for pesto turned browner over 3 months at 4°C (39°F). A darker color means the pesto has lost freshness; whether to keep it depends on its smell, any mold and the time limits.
Related foods
Jam
In the fridge: Opened store-bought: 6–12 months · Opened home-canned: about 1 month · Freezer or refrigerator jam: up to 3 weeksKetchup
In the fridge: Opened: up to 6 months for best qualityMayonnaise
In the fridge: Opened jar: up to 2 months (Germany's BLE: 6–8 weeks), never past the best-if-used-by date · Homemade with pasteurized eggs: 3–4 days (FoodKeeper's figure for homemade aioli); with raw eggs FSIS advises against it, and Germany's BLE gives such dishes 1 day at most · Potato salad: 3–5 days; egg or tuna salad: 3–4 daysMustard
In the fridge: Opened: a few months, up to 1 yearSoy Sauce
In the fridge: Opened: 1 month for best quality (USDA FoodKeeper), not past the best-if-used-by dateVinegar
In the pantry: Store-bought: about 2 years from purchase; apple cider vinegar indefinitely; balsamic 3–5 years from purchase · For best quality, use by the date on the bottle