Vanilla, though so commonly used in the United States that we consume an estimated 638 million vanilla beans each year, remains extraordinarily expensive.

In 2017, prices reached an all-time high of $600 for a kilogram of beans; these days, it’s closer to $500 per kilogram with a single bean costing upward of $10 at the grocery store, still 25 times more expensive than it was six years ago.

But despite the high cost, vanilla remains one of the most popular flavors in the world. Plus, it’s a ubiquitous ingredient in baked goods, with nearly every cookie, brownie or cake recipe calling for some form of vanilla. At the grocery store, we have myriad forms we can select, from extracts to pastes to the mysterious “imitation vanilla.” But which ones are best? And does it even make a noticeable difference in our baking?

We talked to sensory scientists to get to the bottom of things. It turns out, it depends on what you’re making.

Most flavor notes in real vanilla don’t stand up to baking

Vanilla beans are the long, edible fruits of an orchid. After being hand-harvested, the beans go through a lengthy process of cooking, drying and curing before they’re ready to be sold.

The curing process helps the beans develop up to 500 unique flavor compounds, and like coffee or wine, the flavor profile can vary significantly depending on where it’s grown. Madagascar (which owns 75% of the market) produces a sweet, creamy all-purpose vanilla, while Tahitian vanilla is familiarly floral with notes of cherry. Mexico is distinctive too, with spicy notes of clove and nutmeg.

Diana Miller via Getty Images A vanilla bean is actually the pod of an orchid.

But when it comes to using vanilla in baking, you’re unlikely to taste the difference.

“If you’re just smelling the bottle or tasting it with a little bit of milk, it might be obvious,” said Alyssa Bakke, a sensory scientist at Penn State University, “But in something like a baked good where there’s a lot of other ingredients, you’re a lot less likely to taste the difference.”

Of the hundreds of flavor compounds in a vanilla bean, the majority are highly volatile ― meaning they can’t stand the heat. When baked, the delicate flavor compounds essentially evaporate into the atmosphere. This is why certain recipes ― like fudge or vanilla custard ― call for adding the vanilla off the heat.

Vanilla Beans

While whole vanilla beans do well when used to infuse milk and cream in a custard or an ice cream base, they’re generally impractical for baking, said Skip Rosskam, a professor of vanilla at Penn State University and the previous president of David Michael flavor company in Philadelphia.

Vanilla Extract

“Vanilla extract is arguably the best reflection of vanilla in culinary applications,” Rosskam told HuffPost. “It’s been extracted by people whose job it is to get as much flavor as possible.”

Vanilla extract is made by soaking split vanilla beans in a solution of ethanol and water. Over time, the alcohol absorbs the flavor compounds of the vanilla beans and preserves them, leaving the extract highly flavorful and shelf-stable. Unless the bottle specifies, vanilla extract is usually made from a blend of beans from Mexico and Madagascar, and maintains a specific strength in accordance with the Federal Standard of Identity.

Vanilla Bean Paste

Another option? Vanilla bean paste. Also called vanilla oleoresin, it’s a concentrated version of vanilla extract that’s been cooked down with sugar and starch into a thick, syrupy consistency. It also contains some whole ground vanilla pods, which does more for what Bakke calls “visual appeal” than added flavor.

“When we’re tasting a food and perceiving it, there’s a lot of psychology behind it,” Bakke told HuffPost. “Those black specks give you a visual cue that there’s vanilla in the product, meaning you’re more likely to notice the vanilla and may actually think there’s more vanilla flavor because of the visual confirmation.” In the case of vanilla bean paste, “it doesn’t necessarily have flavor but you’re getting some kind of perceptual payoff,” Bakke said.

Still, vanilla bean paste can serve as an affordable alternative to whole-bean vanilla in a recipe when you’re looking for that visual appeal in something like whipped cream or ice cream.

When is imitation vanilla just as good an option as the real thing?

Of all the complex flavor compounds in a vanilla bean, the most prominent is known as vanillin. Vanillin is responsible for the sweet, marshmallow-y flavor that we associate with soft-serve vanilla ice cream.

Imitation vanilla is a form of pure synthetic vanillin, manufactured from a number of sources including wood pulp, coal tar, clove oil and the anal glands of beavers.

Though that may sound strange, imitation vanilla is widely used in products without us even realizing it. In fact, less than 1% of the vanilla-flavored products we love are made with natural vanilla. “You may not even be able to tell the difference [between natural and artificial vanilla] because you’re so accustomed to it,” Bakke said.

Synthetic vanillin is also 20 times cheaper than natural vanilla and delivers nearly 30 times the strength. “Flavor-strength wise, one ounce of vanillin is equal to a full gallon of single-fold vanilla extract,” Rosskam told HuffPost. In baked goods, where you’re likely to lose the complex flavor compounds of natural vanilla, it may not be worth the splurge.

eclipse_images via Getty Images Real vanilla extract's flavor is preserved in buttercream frosting, which is never applied to heat.

When is it worth it to use the real stuff?

Natural vanilla is best in any recipes where you’re adding the vanilla off the heat ― like custard or fudge ― because the more sophisticated flavor compounds will remain in the flavor profile of the final product.

You’ll also want to use natural vanilla in any recipes where vanilla is the dominant flavor, like vanilla frosting or vanilla ice cream. “Sometimes I just want a little bit of vanilla flavor and it’s not worth the money to do the real vanilla,” Bakke said. “But if I were making ice cream, I would definitely use a nice vanilla extract because it’s such an integral part of the flavor profile.”

When it comes to baking, “it depends on the composition of the baked good,” Rosskam said. “In something like a brownie, the chocolate flavor is so strong that you may be better off using imitation vanilla, but if you’re making a sugar cookie, you’re not fighting a strong matrix of flavors so you’ll still get that good vanilla flavor.”

Here’s how to store your vanilla

Whole vanilla beans can dry out and lose their flavor over time, so they’re best stored in an airtight bag in the fridge. If they do dry out, you can reconstitute them in a little water, but they may lose their potency.

Vanilla extract is fully shelf-stable and won’t go bad, but look out for something called “fallout.” Over time, the vanilla compounds may separate and sink to the bottom of the jar. “It’s nothing to worry about but you may want to shake your vanilla before using it,” Rosskam said.