Yield: 8×4″ magic butterfly pea flower loaf cake // Total Time: 1 hr. 30 min. // Disclaimer: This post includes affiliate links. //
Magic Butterfly Pea Flower Loaf Cake
Vanilla loaf cake with butterfly pea powder
I absolutely love butterfly pea powder and think it deserves more recognition. It creates such a beautiful blue-hue that’s all natural, and doesn’t leave you with a strong taste of anything. If you’ve looked around my blog, you might notice that I also have a butterfly pea powder bundt cake. I wanted to create that cake in loaf form, because I know some of you might prefer loaf cakes and/or don’t have bundt pans. So essentially, I took that bundt cake, made the butterfly pea powder cake two-toned (thanks to lemon juice), and topped it with a dreamy white chocolate ganache.
What is butterfly pea flower?!
The butterfly pea flower is a flowering plant that is most often used to make herbal teas. Butterfly pea flower tea is believed to be good for you thanks to the anthocyanins in the plant, which also give it its distinct blue pigment. Butterfly pea powder is simply the flower in powdered form, and is what we’ll be using for this cake. I will warn that the powder itself has a strong smell like matcha that might seem a little off-putting. However – you really cannot taste the powder in the cake itself as we’re using it for a fun, naturally dyed vanilla cake.
What makes this cake magic?
While butterfly pea powder on its own will give us a beautiful natural blue hue in the cake, there’s something special about butterfly pea powder that makes this cake magic. When you add something acidic (lemon juice in our case), the color changes from a deep blue to a rich purple. After dyeing some of the cake batter blue with the powder, we’ll remove some of the blue cake and mix it with lemon juice for a naturally rich purple-colored cake batter.
Why you’ll love this magic butterfly pea flower loaf cake
1. It’s super light and fluffy. The base of this cake is the same as my espresso marbled loaf cake, the fork just falls through the cake when you go to take a bite!
2. It’s unique. Butterfly pea powder has certainly made its rounds in the beverage world, but I feel like it deserves way more attention in the baking world!
3. It’s sure to impress. While a blue and purple cake might not impress on it’s own – the fact that it’s naturally dyed those colors and marbled surely makes it a topic of conversation!

Recipe tips
Weigh your ingredients
- Weighing your ingredients is important for getting the recipe perfect and getting consistent results. I do provide cup measurements but please note that I test all my recipes in grams and can not guarantee that your bake will turn out like mine. This kitchen scale is super cheap and a great starter scale!
Room temperature ingredients
- It is important for the ingredients to be at room temperature so that they properly incorporate with each other and you don’t end up with a curdled, uneven batter. Take out the egg, butter, sour cream and milk at least 30 minutes and up to 1 hr 30 min. before starting the recipe. Here’s how to get room temperature ingredients FAST if you’re in a time crunch or forgot to take the ingredients out (like I often do):
- Egg: place the egg in a bowl and run hot water over it for 1 continuous minute, or let it sit in a bowl of warm water for 5 minutes.
- Butter: slice the butter into 1 tbsp. slices and place them flat on a plate. Microwave in 5-second intervals until the butter is soft to the touch, but not melting.
- Sour cream and milk: microwave them in 5-second intervals until it is no longer cold, but is not warm (room temp!)
Mix the dough carefully
- When adding in the flour and milk, only fold until the last streak disappears. Overmixing the dough leads to more gluten formation, which will make your cake tough and chewy rather than light and fluffy.
Keep an eye on the cake while it bakes
- Things like to go from under-baked to over-baked super quickly so it is important to keep a close eye on them. Start checking around 50 minutes with a toothpick. If the toothpick comes out wet, check again in 5 minutes and so on, until the toothpick comes out with just a few moist crumbs

Ingredients and substitutions
For the butterfly pea flower loaf cake:
All purpose flour: gives the cake structure.
Baking powder: helps the cake rise.
Salt: for balancing and bringing out the sweetness of the batter.
Unsalted butter: for tenderizing the cake and adding flavor. You can substitute salted butter, just be sure to omit the extra salt in the batter. You can also use your favorite dairy-free butter stick in its place.
Vegetable oil: for tenderizing the cake. You can substitute any neutral oil, such as canola, in place of vegetable oil.
Granulated sugar: for sweetening the cake and keeping it moist. The sugar also helps aerate the butter to give this cake its rise.
Egg: for binding and for moisture. We’ll use 2 eggs and 1 egg white.
Vanilla: for flavor.
Sour cream: adds moisture and makes the cake tender. I recommend full-fat sour cream for the best texture.
Whole milk: adds moisture – like above I recommend whole for the best results. However, 2%, 1%, or your favorite non-dairy milk should work just fine.
Butterfly pea powder: the star of the show and what gives the cake and icing their beautiful blue hue. This is the butterfly pea powder that I use.
Lemon: fresh or bottled will work here. I also added in the zest of a lemon for an extra little hint of flavor but it’s totally optional!
For the white chocolate ganache:
White chocolate chips: I recommend using a high-quality white chocolate chip, such as Ghirardelli, for the best results (and taste!)
Heavy whipping cream: for thinning out the ganache.
How to make magic butterfly pea flower loaf cake
Here are the basic steps to follow to make this cake and some photos of the beautiful process. You can find the complete recipe at the end of this blog post.



1. Beat together the wet ingredients. Beat together the butter, oil, and sugar until it’s light and fluffy. Then beat in the eggs one at a time, followed by the egg white, vanilla, and sour cream.
2. Alternate adding in the flour and milk. Fold in half of the dry ingredients, followed by all of the milk, and then the rest of the dry ingredients.
3. Dye the batters. In a medium-sized mixing bowl, whisk together the butterfly pea powder and milk until no lumps remain. Add 300g of batter to the bowl and mix until smooth. Remove half of the batter and place it into a small mixing bowl, and mix in the lemon juice (this will turn it purple!)
4. Alternate adding the batters into the pan. Layer the cake batters in the pan in the following order: 1/3 vanilla, all of the purple cake, 1/2 of the remaining vanilla, all of the blue cake, the rest of the vanilla cake.



5. Swirl and bake. Use a knife to gently swirl all the batters together in the pan, then bake until a toothpick stuck in the center of the cake comes out clean.
6. Make the white chocolate ganache. Microwave the white chocolate and cream together in 30-second intervals, stirring after each interval, until the mixture is smooth. Place it in the fridge or in the freezer until set.
7. Serve and enjoy! Once the cake has completely cooled, whip up the white chocolate ganache with a hand mixer. Spread it over the cake, serve, and enjoy!

Butterfly pea flower cake Q & A
Where can I find butterfly pea powder?
I haven’t seen butterfly pea powder at the store, so I always grab mine off of Amazon. Here is the link to the one I use! It’s a large bag relative to the amount we’ll need for this recipe but it does keep well for a long time.
What size loaf pan do I need?
I used an 8×4″ metal loaf pan and I do recommend you do the same. If all you have is a 9×5″ that’s perfectly fine to use, just note that your loaf will be a tad bit shorter and will probably need a little less baking time. I always recommend against glass bakeware because it just doesn’t conduct heat as well which affects bake time and browning on your bakes. So please note that if you do use a glass pan, your bake will take more time.
How to store this loaf cake
Ganache can technically be left out at room temperature in an airtight container for 2 days, but I do recommend refrigerating the frosted cake for the best food safety practices. It will keep well in the fridge for 3-4 days.
Why do you measure in grams?
My recipes are all written in grams because it is the most accurate way to bake. When you use a kitchen scale, you ensure that your baked goods turn out as close to the written recipe as possible. Plus, the cleanup is way easier when using a scale! I will provide standard cup measurements but please note that I have not tested the recipe using cup measurements and therefore can not guarantee your recipe will come out how mine did. Here is my favorite kitchen scale, and here’s an article about why I use a kitchen scale, and why you should too!
A note on oven temperature
Ovens vary and fluctuate in temperature. For example, I always have to set my oven to 330°F if I want it to bake at 350°F. If you love to bake like I do, I highly recommend getting an oven thermometer. They are super helpful for letting you know when your oven might be lying to you! I use this one.

Tools and ingredients
You can find all my favorite tools and ingredients that I use on my Amazon Storefront page, here!
Did you make this magic butterfly pea flower loaf cake?
If you made this magic butterfly pea flower loaf cake recipe I would love to see it and know your thoughts! Please leave a comment and review down below, and tag me on Instagram @freshbeanbakery. If you have any questions about the recipe I will gladly do my best to answer them in the comments below!

Magic Butterfly Pea Flower Loaf Cake
Ingredients
Vanilla Cake
- 240 g all purpose flour (2 c.)
- 2 ½ tsp. baking powder
- ¾ tsp. salt
- 100 g unsalted butter room temperature (7 tbsp.)
- 60 g vegetable oil (⅓ c.)
- 250 g granulated sugar (1 ¼ c.)
- 2 eggs + 1 egg white room temperature
- 1 tbsp. vanilla
- 120 g sour cream room temperature (½ c.)
- 120 g whole milk room temperature (½ c.)
Butterfly Pea Flower Cake
- 2 tsp. butterfly pea powder
- 2 tbsp. whole milk
- 1 ½ tbsp. lemon juice
White Chocolate Ganache
- 210 g white chocolate chips (1 ¼ c.)
- 70 g heavy whipping cream (2 ½ oz.)
Instructions
Vanilla Cake
- Preheat the oven to 350°F / 175°C. Butter and line an 8×4" loaf pan with parchment paper.
- In a medium-sized bowl, whisk together the flour, baking powder, and salt. Set aside.
- In the bowl of a stand mixer fitted with the paddle attachment, or with a hand mixer, beat together the butter, oil, and sugar for 5 minutes until light and fluffy.
- Scrape down the sides of the bowl, and add in one egg at a time, beating until combined after the two additions.
- Add in the egg white, vanilla, and sour cream and beat until combined.
- Alternate between adding the flour mixture and the milk. Fold in ½ of the flour mixture, then all of the milk, followed by the rest of the flour mixture.
- In a small mixing bowl, whisk together the butterfly pea powder and milk until smooth.
- Add in 300g (~1 ⅓ c.) of the vanilla batter, and fold the mixture together just until fully combined.
- Remove 150g (⅔ c.) of the blue batter and place it into a small mixing bowl. Mix in the lemon juice just until fully combined.
- Time to layer the loaf! Pour ⅓ of the vanilla cake batter into the bottom of your prepared loaf pan, and smooth it out into an even layer.
- Top with the purple cake batter and smooth, followed by ½ of the remaining vanilla cake batter.
- Smooth the blue batter into an even layer on top of that, then finish off with a smooth layer of the remaining vanilla batter.
- Use a knife to swirl the batter together. Bake for 50-60 minutes, until a toothpick inserted in the cake comes out clean or with only a few moist crumbs.
- Allow the cake to cool in the loaf pan for at least 10 minutes before transferring it to a wire rack to cool.
White Chocolate Ganache
- While the cake cools to room temperature, make the ganache.
- Add the white chocolate and heavy cream to a small microwave-safe mixing bowl. Microwave in 30 second intervals, stirring after each, until the mixture is smooth.
- Set the ganache in the fridge to thicken up, or, place it in the freezer and mix every 5 minutes until set.
- Once the ganache has thickened (but not firmed up completely) and the cake has fully cooled to room temperature, beat the ganache with a hand mixer until it's light and fluffy.
- Frost the cake with the whipped white chocolate ganache. If desired, you can mix ¼ tsp. of butterfly pea powder with 1 tbsp. of water and use a tiny paint brush to flick blue speckles on top of the white chocolate ganache.
- Serve and enjoy!
Sam says
Can I substitute sour cream with yoghurt?
Erin says
I haven’t tried it but it should still work!