Unicorn Cake Recipe: How to Make a Magical Layer Cake

Updated November 26, 2026

Total time
2 hr 30 min
prep 40 min · cook 30 min
Serves
12
portions as written

Jump to recipe

Unicorn cake is a whimsical, pastel-colored layer cake with a swirled or striped interior, topped with a silky buttercream and a golden horn. It’s a showstopper for birthdays and celebrations, and while it looks elaborate, it’s made with simple vanilla cake and American buttercream. The magic comes from dividing the batter and tinting each portion with gel food coloring, then stacking the layers to reveal a rainbow when sliced.

Ingredients

  • 3 cups (360 g) all-purpose flour
  • 2 teaspoons baking powder
  • 1/2 teaspoon baking soda
  • 1 teaspoon salt
  • 1 cup (226 g) unsalted butter, softened
  • 1 3/4 cups (350 g) granulated sugar
  • 4 large eggs, at room temperature
  • 1 tablespoon vanilla extract
  • 1 cup (240 ml) buttermilk, at room temperature
  • Gel food coloring: pink, purple, blue, green, yellow
  • For the buttercream:
  • 2 cups (452 g) unsalted butter, softened
  • 4 cups (480 g) powdered sugar, sifted
  • 2 tablespoons heavy cream
  • 1 teaspoon vanilla extract
  • Pinch of salt
  • For decoration:
  • 1 store-bought sugar cone (for the horn)
  • Gold luster dust (optional)
  • Sprinkles, edible glitter, or star-shaped candies

Instructions

  1. Preheat the oven to 350°F (175°C). Grease and flour three 8-inch round cake pans, and line the bottoms with parchment paper.
  2. In a medium bowl, whisk together the flour, baking powder, baking soda, and salt. Set aside.
  3. In a large bowl, beat the butter and sugar with an electric mixer on medium speed until light and fluffy, about 3 minutes. Add the eggs one at a time, beating well after each, then beat in the vanilla.
  4. Reduce the mixer speed to low. Add the flour mixture in three additions, alternating with the buttermilk, starting and ending with the flour. Mix until just combined; do not overmix.
  5. Divide the batter evenly among five bowls. Tint each bowl with a different gel food color (pink, purple, blue, green, yellow), using about 1/4 teaspoon per color, or more for deeper shades.
  6. Spoon the colored batters into the prepared pans in alternating colors. For a striped effect, drop spoonfuls of each color in a random pattern, then gently tap the pans on the counter to settle the batter. Do not swirl with a knife—the colors will marble too much.
  7. Bake for 25–30 minutes, until a toothpick inserted in the center comes out clean. Cool in the pans for 10 minutes, then turn out onto a wire rack to cool completely.
  8. While the cakes cool, make the buttercream. In a large bowl, beat the butter on medium speed until smooth and creamy, about 2 minutes. Gradually add the powdered sugar, then the cream, vanilla, and salt. Beat on high for 3–4 minutes until light and fluffy.
  9. Once the cakes are completely cool, level the tops with a serrated knife if needed. Place one layer on a cake board or serving plate. Spread about 1 cup of buttercream over the top. Repeat with the second layer, then place the third layer on top.
  10. Frost the outside of the cake with a thin crumb coat (a thin layer of buttercream to seal in crumbs). Refrigerate for 20 minutes to set.
  11. Apply a final layer of buttercream, smoothing the sides and top with an offset spatula. For a textured look, leave the buttercream in soft peaks.
  12. For the horn, brush the sugar cone with gold luster dust if using. Place it on top of the cake, slightly off-center, pressing gently to secure. Decorate the base of the horn with sprinkles or candies, and add more sprinkles around the top of the cake.
  13. Refrigerate the cake for at least 30 minutes to set the frosting before slicing. Serve chilled or at room temperature.

Tips

  • Use gel food coloring instead of liquid drops—liquid will thin the batter and produce muted colors. Gel colors are more concentrated and give vibrant pastels.
  • Make sure the cakes are completely cool before frosting, or the buttercream will melt and slide off.
  • If you don’t have buttermilk, make a quick substitute: add 1 tablespoon of lemon juice or white vinegar to 1 cup of milk, let sit for 5 minutes, then use.
  • For a cleaner slice, use a warm knife (dip in hot water and dry) and wipe between cuts.

Serving Suggestions

Serve as the centerpiece at a birthday party, baby shower, or any celebration. Pair with a scoop of vanilla ice cream or a glass of cold milk. For a festive touch, add extra sprinkles on each plate.

Variations

  • Chocolate unicorn cake: Replace 1/2 cup (60 g) of the flour with unsweetened cocoa powder, and use chocolate buttercream.
  • Vegan version: Use plant-based butter, flax eggs (1 tablespoon ground flax + 3 tablespoons water per egg), and almond milk with a splash of vinegar instead of buttermilk.
  • Cupcakes: Divide the batter into 24 cupcake liners and bake for 18–20 minutes. Frost with a swirl of buttercream and top with a mini horn made from a candy melt.
  • Different colors: Use any pastel palette—mint, lavender, peach, or even a rainbow of six colors.

Storage and Reheating

Store the frosted cake in an airtight container in the refrigerator for up to 4 days. Bring to room temperature for 30 minutes before serving for the best flavor and texture. You can also freeze the unfrosted cake layers, wrapped tightly in plastic wrap and foil, for up to 2 months; thaw overnight in the refrigerator before frosting.

Frequently Asked Questions

Can I use a boxed cake mix? Yes, but the texture and flavor will be slightly different. Use a white or vanilla boxed mix, and follow the package instructions. You can still divide and color the batter as described.

Why did my cake layers come out lopsided? This often happens if the batter is not evenly distributed or the oven rack is tilted. Use a kitchen scale to weigh the batter in each pan, and make sure the oven is level. Also, rotate the pans halfway through baking.

Can I make the cake ahead of time? Absolutely. Bake the layers up to 2 days ahead and store them wrapped in plastic wrap at room temperature. Frost the cake the day you plan to serve it, or up to 1 day ahead and refrigerate.

How do I get a smooth buttercream finish? Use a bench scraper and a turntable. After applying the final coat, run the bench scraper around the sides while spinning the turntable slowly. Dip the scraper in hot water and dry it for a smoother result.

Can I use natural food coloring? Yes, but natural colors tend to be less vibrant and may alter the flavor slightly. For pastels, use beet powder (pink), turmeric (yellow), and spirulina (green). Expect softer shades.

Is the sugar cone horn edible? Yes, a sugar cone is edible and tastes like a sweet wafer. You can also make a horn from white chocolate molded into a cone shape, or use a store-bought candy horn.

Related

More recipes to cook

Safety notes: safe minimum internal temperatures from USDA FSIS; raw and undercooked fish guidance from the U.S. FDA. Food safety notes

Spotted an error? Tell us and we will correct it (corrections policy).