When it comes to baking cookies, cakes and pastries, the creamy goodness of butter provides a rich flavor, texture and structure that’s tough to beat. Butter is also used in many savory recipes like dreamy mashed potatoes and creamy baked macaroni and cheese.

But when the butter dish is empty (and you’ve gone through your stash of frozen butter), what should you do? Luckily, many other ingredients you might have on hand can be used in place of butter to achieve similar results. Consider these common butter substitutes so you can keep on baking.

Margarine

Margarine butter on a wooden tablenitrub/Getty Images

Margarine is possibly the most-used butter substitute for baking cookies, cakes, doughnuts or just about anything else. Use margarine as an even swap for the amount of butter a recipe calls for. Margarine actually helps cookies keep their shape slightly better than butter, so if the shape of your cookies is really important to you, keep this alternative top of mind. Just remember that the flavor may not be quite as rich as it would be using real butter.

If you’re wondering, here’s the actual difference between butter and margarine.

Shortening

Shortening in a small bowlLiudmila Chernetska/Getty Images

Like margarine, shortening is a smart butter substitute when baking (here’s the difference between all three). You can use a one-to-one swap for most recipes. But remember, shortening lacks flavor (and water), so bakers will often add a bit more. (If you have butter-flavored shortening, however, you’re golden!) The lack of water also means extra tender and soft baked goods.

Olive and Vegetable Oil

Jug olive oil, and green leaves on wooden tableLiudmila Chernetska/Getty Image

You might be out of butter, but you likely have a bottle of oil on hand. Oils work best for muffins and quick breads, but you can use them for cakes as well. Try 3/4 cup olive or vegetable oil for every 1 cup of butter called for. Vegetable oil won’t change the flavor very much, while olive oil will bring an earthier flavor.

Coconut Oil

Coconut oil and fresh coconuts with palm leaf on wooden backgroundInna Dodor/Getty Images

When you’re out of butter, swap in coconut oil in equal amounts for nearly any baked good. It’s a great butter substitute for cakes, brownies, quick breads, muffins, corn bread and yeast breads. Keep in mind it’s one of few butter substitutes that makes cookies crunchy! If you don’t want too much coconut flavor, make sure to use refined coconut oil.

Vegan Butter

Vegan Butter on a table with blue chothYelenaYemchuk/Getty Image

Vegan butter is an ideal alternative for those who don’t eat food that comes from animals, along with those who follow a dairy-free diet. Use an even swap for the amount of regular butter called for in your recipe. This is one of the best options to consider for baked goods and even buttercream frosting. Use vegan butter sticks for best results.

Mayonnaise

ar of delicious mayonnaise and napkin on light blue wooden tableLiudmila Chernetska/Getty Images

Some people swear by using mayonnaise instead of butter when making the perfect grilled cheese. It’s also a great swap for butter in a variety of other dishes, especially those that use melted butter. Swap half of the amount of butter called for with mayonnaise.

Pumpkin Puree

Pumpkin puree i a bowl Blue and white stripes textileAlyona-Kos/Getty Images

If you love pumpkin, swap it in for the butter in your treats. Multiply the amount of butter in a recipe by 3/4, and you’ll know how much pumpkin puree to use. (In other words, if a recipe calls for 1 cup of butter, you’d use 3/4 cup of pumpkin in its place.) It’s both a fat and a sweetener for quick breads, cakes, cupcakes, bars and cookies. Remember that pumpkin will change the color of your cookies and yield a dense product.

Applesauce

Apple sauce. Fresh homemade applesauceMizina/Getty Images

To lighten up cookies, quick breads and other baked goods, swap in unsweetened applesauce. It’s been a longtime healthy butter substitute that still yields super soft sweets. Replace half of a recipe’s butter amount with applesauce, and you’ll be enjoying sweet treats in no time.

Greek Yogurt

Greek yogurt in a bowl,jenifoto/Getty Images

Full-fat yogurt brings richness to baked goods. Try swapping an equal amount of Greek yogurt for butter when baking cakes and cookies for ultra-soft snacks. Depending on the brand of yogurt, your cookies may have more or less of a tangy flavor.

Bananas

Mashed Bananas on a vintage background HandmadePictures/Getty Images

Fix your cookie craving with a mashed banana. Your cookies will turn out a bit dense and, of course, offer a slight banana flavor, but this is a smart, healthy option when you’re out of butter. Mashed bananas also work well as butter substitutes for cakes, cupcakes, muffins and quick breads. In general, one banana is equal to one stick of butter.

Avocado

Bowl of Avocado puree and sliced avocadolacaosa/Getty Images

We put avocado on toast because it delivers excellent fats in a daily diet. Why not use those same fats in place of butter? To use this alternative, mash or puree an even amount of avocado to swap for the amount of butter called for in the recipe. This can be used for baked goods including muffins, banana bread and cupcakes.

Prune Butter

prunes butter in a bowlvikif/Getty Images

Simmering prunes in water creates prune butter. Once they’re tender, the prunes are blended until smooth. You can use this as an even swap for the amount of butter called for in a recipe, but keep in mind that it may impart a different flavor and is best when paired with chocolate or cinnamon. You can also use a mixture of real butter and prune butter as a way to reduce the fat content of what you’re making while maintaining texture.

Ghee

homemade Ghee or clarified butter in jar on white wooden tableSvittlana/Getty Images

Ghee, or clarified butter, is made by removing the milk solids from butter. Because of that process, it is more similar to oil than real butter. It’s a great substitute for butter when you’re cooking, especially in savory recipes thanks to its unique caramelized, nutty flavor. However, it won’t produce the same texture when using it as a substitute in baking recipes.