How Long Homemade Pesto Stays Fresh in Your Refrigerator
Homemade pesto lasts three to four days in the refrigerator when stored properly
Homemade pesto keeps for three to four days in a standard refrigerator set to 40°F or below. The shelf life is shorter than store-bought pesto because homemade versions contain fresh basil, garlic, and no preservatives. The main threat is oxidation—the basil darkens and the flavor flattens—along with bacterial growth if garlic sits in oil without enough acid. How you store it makes the difference between pesto that tastes bright on day two and pesto that tastes flat and musty by day three.
The exact timeline depends on three things: how much lemon juice or vinegar you used, whether you blanched the basil first, and how you seal the container. A pesto made with plenty of acid and stored in an airtight container will hold better than one made with minimal acid and left loosely covered. Temperature matters too—if your refrigerator runs warmer than 40°F, count on two to three days instead of four.
Key Takeaways
- Homemade pesto keeps for three to four days in the refrigerator when stored in an airtight container at 40°F or below.
- Covering the pesto with a thin layer of olive oil slows oxidation and helps preserve color and flavor for an extra day.
- Pesto made with blanched basil (briefly boiled then shocked in ice water) stays fresher longer than pesto made with raw basil.
- Freezing pesto in ice cube trays or small containers extends shelf life to three to four months, making it practical for batch cooking.
- Signs that pesto has gone bad include dark brown color, sour or fermented smell, or visible mold on the surface.
Why homemade pesto spoils faster than the store version
Store-bought pesto contains preservatives—usually citric acid, sodium benzoate, or potassium sorbate—that slow bacterial growth and oxidation. Homemade pesto has none of these. The fresh basil in your pesto contains natural enzymes and microorganisms that break down the leaves over time, especially once the leaves are bruised during blending. Garlic adds another risk: when raw garlic sits in oil without enough acid, it can harbor botulism spores under anaerobic (oxygen-free) conditions, though this is rare in a refrigerator.
The acid content of your pesto—from lemon juice, lime juice, or vinegar—acts as a natural preservative. Pesto made with a generous squeeze of lemon juice will last longer than pesto made with just a pinch. The oil itself does not preserve; it actually speeds oxidation once the pesto is exposed to air. This is why pesto turns brown: the basil's chlorophyll breaks down when exposed to oxygen, and the oils oxidize, creating off-flavors.
The best way to store pesto in the refrigerator
Use a small glass jar or airtight plastic container—something with a tight-fitting lid that leaves minimal air space. Transfer the pesto while it is still at room temperature, then press a piece of plastic wrap directly onto the surface of the pesto before screwing the lid on. This creates a barrier against air exposure. Alternatively, smooth the top of the pesto flat and pour a thin layer of olive oil (about one-quarter inch) over the entire surface. The oil seals out oxygen and can extend freshness by one to two days.
Store the container on a shelf in the main body of the refrigerator, not in the door. Door storage exposes pesto to temperature fluctuations every time you open and close the refrigerator, which speeds spoilage. Keep the temperature at 40°F or below—check your refrigerator with a thermometer if you are unsure. If your pesto is very thick, you can thin it slightly with a little more lemon juice before storing, which increases the acid content and helps preserve it.
Blanching basil extends refrigerator life
If you blanch the basil before making pesto, you can add one to two extra days to its refrigerator life. Blanching means briefly boiling the basil leaves (about 30 seconds) and then immediately plunging them into ice water to stop the cooking. This deactivates the enzymes that cause browning and breakdown. Pat the basil completely dry before blending it into pesto.
Blanched-basil pesto will keep for four to five days in the refrigerator. The trade-off is a slightly softer, less vibrant basil flavor compared to raw-basil pesto—some cooks prefer the raw version for its brightness and accept the shorter shelf life. If you make pesto regularly and want it to last, blanching is worth the extra step. If you only make it occasionally and plan to use it within two days, raw basil is fine.
Freezing pesto for longer storage
Freezing is the best option if you make large batches or want pesto on hand for weeks. Pesto freezes well and thaws without major texture loss, though the basil will darken slightly. Pour pesto into ice cube trays, freeze until solid (about four hours), then pop the cubes into a freezer bag and label it with the date. Each cube is roughly one tablespoon, which is convenient for adding to pasta, soups, or sandwiches without thawing the whole batch.
Frozen pesto keeps for three to four months at 0°F or below. Thaw it in the refrigerator overnight or add it directly to a hot dish. Do not thaw pesto at room temperature, as this creates conditions for bacterial growth. If you freeze pesto with a layer of oil on top, the oil may separate when thawed—simply stir it back in. Some cooks prefer to freeze pesto without added oil and drizzle fresh oil over it after thawing, which gives a fresher taste.
Signs that pesto has spoiled
Discard pesto if it shows any of these signs: a dark brown or black color (beyond the normal darkening that happens over a few days), a sour or fermented smell, visible mold or fuzzy growth on the surface, or a slimy texture. A slight darkening of the green color is normal and does not mean the pesto is bad—this is oxidation, not spoilage. If the pesto smells like basil and garlic but looks darker, it is still safe to eat.
Trust your nose and eyes more than a calendar. If pesto is on day three and still smells bright and looks mostly green, it is fine. If it is on day two and smells off or looks very brown, throw it out. When in doubt, discard it. The cost of a small batch of pesto is far less than the risk of foodborne illness.
Pesto storage comparison: refrigerator versus freezer
| Storage Method | Shelf Life | Best For | Texture After Storage |
|---|---|---|---|
| Refrigerator (airtight container, no oil layer) | 3–4 days | Using within a few days | Unchanged |
| Refrigerator (airtight container, oil layer on top) | 4–5 days | Slightly longer storage with minimal oxidation | Unchanged |
| Refrigerator (blanched basil pesto) | 4–5 days | Maximum refrigerator life | Slightly softer than raw-basil pesto |
| Freezer (ice cube trays or containers) | 3–4 months | Batch cooking and long-term storage | Slight darkening; texture unchanged when thawed |
Frequently Asked Questions
Can I store pesto in the freezer door instead of the main freezer?
No. Freezer door storage exposes pesto to temperature swings every time you open the door, which causes ice crystals to form and break down the texture. Store it in the main freezer compartment where the temperature stays constant at 0°F or below.
Does adding more garlic make pesto last longer?
No. Garlic does not preserve pesto; acid does. Extra garlic can actually increase the risk of off-flavors developing. If you want pesto to last longer in the refrigerator, add more lemon juice or vinegar instead.
What if my pesto separates into oil and paste?
Separation is normal and does not mean the pesto is bad. Simply stir it back together before using. If it separates repeatedly, your pesto may have too much oil relative to the other ingredients—add a little more lemon juice or grated cheese to help emulsify it.
Can I store pesto in a glass jar with a metal lid?
Yes, as long as the lid seals tightly and the jar is clean and dry before you fill it. Avoid lids with plastic liners that touch the pesto directly, as the acid can degrade the plastic over time. A glass jar with a rubber gasket seal works well.
Is it safe to store pesto in oil at room temperature?
No. Pesto stored in oil at room temperature can develop botulism, a serious foodborne illness. Always refrigerate pesto, even if it is covered with oil. The oil layer slows oxidation but does not preserve the pesto safely at room temperature.