Pesto, the staple Italian sauce, enlivens everything from simple pasta dishes to seared fish with its bright, earthy depth. But it also would’ve made a standout member of the Groundlings, because its greatest strength is improvisation.
The sauce is a strong ally when you’re locked in a losing battle with a jumbo clamshell of mixed greens and are desperate to avoid tossing them in the compost. In fact, leafy greens are among the most wasted produce in American households, often going slimy before we get to them. Pesto can turn them into something you’ll want to use—and save—before that happens.
Yes, traditional pesto—pesto alla Genovese—is all about that basil. It originates from the Liguria region on the Mediterranean coastline, where cooks create magic in a mortar and pestle by grinding together the herb, garlic, pine nuts, Parmigiano-Reggiano, and good extra virgin olive oil. But this sauce is as much about the formula as the flavor: As long as you maintain the basic ratios, you can substitute whatever greens and nuts you have without affecting the sauce’s depth and character.
“Any time you use pesto, you’re adding a herbaceous, fatty sauce to something,” says chef Mike Friedman, who owns several popular Italian restaurants, including All-Purpose Pizzeria and The Red Hen in Washington, D.C. “It truly is one of the best sauces on the planet.”
Staring down a wilting bunch of cilantro? Half-used bag of arugula? The rattling remains of a couple containers of nuts? Tag ’em in. Pesto can handle it. Once you understand how flexible the base can be, options open up.
What’s the magic pesto formula?
The traditional pesto formula is 1:2:2:8. That is, 1 part toasted pine nuts, 2 parts olive oil, 2 parts Parmigiano-Reggiano, and 8 parts basil. Most recipes also see a few cloves of garlic and some lemon juice. (This is a great base recipe to use.) Add everything except the olive oil, pound in a mortar and pestle until your kitchen smells like a Ligurian nonna’s (or blitz ‘em in the blender), and then slowly drizzle in the golden stuff. Taste. Does it need more olive oil? More acid? Salt? Adjust. It’s all about the balance.
Then, use it in everything. “Pesto is so versatile that it becomes a fan favorite very quickly,” says Friedman. “It can be a spread on toasted focaccia, a sauce base in pasta, or an accompaniment to meat or fish. It’s also amazing folded into mayonnaise or stirred into a warm potato or tuna salad.”
So, what separates a magical pesto from a meh one? Quality and technique, says Friedman. “If you use mediocre ingredients in your pesto, you get a mediocre final product,” he says. So: Good olive oil. Good cheese. Good herbs. Friedman also cautions against over-processing, which can turn pesto into a bitter, gray paste. “A mortar and pestle is ideal, but if you’re using machinery, pulse in bursts and watch the texture closely before the herbs oxidize.”
No basil? No pine nuts? No problem.
Now, about the improvising. No basil but have a bunch of random herbs and greens? Chances are any of them will do. Friedman is a traditionalist and loves basil pesto. But he also likes a base of parsley with some chervil, mint, and oregano or one made with a high ratio of any of those herbs. Mixed salad greens work nicely, too, as do radish greens and carrot fronds. Play with combinations.
When it comes to more assertive greens like arugula or kale, they work well but need a bit of transformation. Friedman’s advice: Blanch them for 20-30 seconds, shock them in ice water, and strain them well before blending. This removes the bitterness and makes them easier to blend smoothly. Add some herbs to them as well.
There are few herbs and greens that won’t work. But be sure to avoid rosemary. sage, or other hard herbs, advises Friedman. Their essential oils are too harsh and will overpower the sauce.
Another great area to incorporate different flavors—the nut component. “I love swapping out nuts from time to time when it comes to pesto,” says Friedman. Toasted hazelnuts or almonds make a great substitute. Pistachios and walnuts do, too. Even pumpkin or sunflower seeds can do in a pinch. Whatever swaps you make, be sure to taste and adust until the flavor and texture feel right.
Once you understand the basic structure, there are a lot of variations to try. Here are some suggestions to help guide you.

Once made, pesto lasts about five days in the fridge—longer if you drizzle a bit of olive oil on top to prevent it from browning. It also freezes beautifully in ice cube trays for quick portions later on. It’s flexible, flavorful, and rescues ingredients on the brink of going to waste. All it takes is a little blending and balancing—and a bit of faith in the formula.