Unicorn Sheet Cake: Easy Rainbow Layer Cake Recipe

Updated November 5, 2026

Total time
1 hr 30 min
prep 30 min · cook 25 min
Serves
24
portions as written

Jump to recipe

Unicorn Sheet Cake: Easy Rainbow Layer Cake Recipe

Unicorn sheet cake is a whimsical, colorful dessert that brings the magic of a unicorn to your table. This single-layer cake is baked in a sheet pan, making it perfect for parties, birthdays, or any celebration. The moist vanilla cake is topped with a creamy, pastel-swirled frosting and finished with sprinkles and edible glitter, creating a truly enchanting treat that is as fun to make as it is to eat.

Ingredients

  • 2 3/4 cups (350 g) all-purpose flour
  • 1 1/2 cups (300 g) granulated sugar
  • 1 tbsp baking powder
  • 1/2 tsp salt
  • 3/4 cup (170 g) unsalted butter, softened
  • 4 large eggs, at room temperature
  • 1 cup (240 ml) whole milk, at room temperature
  • 2 tsp vanilla extract
  • 1/2 cup (120 ml) vegetable oil
  • 1 cup (226 g) unsalted butter, softened (for frosting)
  • 4 cups (480 g) powdered sugar
  • 2-3 tbsp heavy cream or milk
  • 1 tsp vanilla extract (for frosting)
  • Gel food coloring: pink, blue, purple, and yellow
  • Rainbow sprinkles, for decoration
  • Edible glitter or star sprinkles, for decoration

Instructions

  1. Preheat your oven to 350°F (175°C). Grease a 9×13-inch (23×33 cm) sheet pan and line it with parchment paper, leaving an overhang on two sides for easy removal.
  2. In a large bowl, whisk together the flour, sugar, baking powder, and salt. Add the softened butter and mix with an electric mixer on low speed until the mixture resembles coarse sand.
  3. In a separate bowl, beat the eggs, milk, vanilla extract, and vegetable oil together. Pour the wet ingredients into the dry ingredients and mix on medium speed until the batter is smooth and well combined, about 2 minutes. Scrape down the sides as needed.
  4. Pour the batter into the prepared pan and spread it evenly. Bake for 25-30 minutes, or until a toothpick inserted into the center comes out clean. The top should be golden and spring back when lightly touched.
  5. Let the cake cool in the pan on a wire rack for 10 minutes, then use the parchment overhang to lift it out and cool completely on the rack. This takes about 45 minutes.
  6. While the cake cools, make the frosting: In a large bowl, beat the softened butter until creamy. Gradually add the powdered sugar, beating on low speed, then increase to medium and beat until fluffy. Add the heavy cream and vanilla, and beat for another 2 minutes until light and airy.
  7. Divide the frosting into four small bowls. Tint each bowl with a different gel food coloring: pink, blue, purple, and yellow. Stir each until the color is uniform.
  8. To create the unicorn swirl, place dollops of each colored frosting onto a sheet of plastic wrap. Roll the plastic wrap into a log and twist the ends to seal. Snip off one corner of the log with scissors.
  9. Pipe the frosting onto the cooled cake in a swirling pattern, starting from the outside and working inward, or just cover the top with the multicolored frosting. Use an offset spatula to spread it into an even layer if desired.
  10. Decorate with rainbow sprinkles and edible glitter while the frosting is still soft. For a unicorn look, you can also add a horn made from a sugar cone or a few star sprinkles.
  11. Refrigerate the cake for at least 30 minutes to set the frosting before slicing and serving.

Tips

  • Room temperature ingredients: Make sure your eggs, milk, and butter are at room temperature before starting. This helps the batter emulsify properly, resulting in a tender, even crumb.
  • Gel food coloring: Use gel food coloring instead of liquid drops. Gels are more concentrated, so you get vibrant colors without thinning the frosting.
  • Even baking: For an even, flat cake, avoid overmixing the batter and make sure your oven is fully preheated. If your oven runs hot, check the cake a few minutes early.
  • Frosting consistency: If your frosting is too thick, add a little more cream; if it’s too thin, add more powdered sugar. The frosting should hold its shape when piped.

Serving Suggestions

Serve this unicorn sheet cake as the centerpiece at a birthday party, baby shower, or any festive gathering. Cut into squares and pair with a scoop of vanilla ice cream or a glass of cold milk. For a magical touch, add a few extra sprinkles on top of each slice before serving.

Variations

  • Chocolate unicorn cake: Replace 1/2 cup (60 g) of the all-purpose flour with unsweetened cocoa powder for a chocolate base.
  • Lemon unicorn cake: Add the zest of one lemon to the batter and substitute buttermilk for the whole milk for a tangy twist.
  • Vegan unicorn cake: Use plant-based butter, milk, and eggs (such as flax eggs) to make this cake vegan-friendly.
  • Different frostings: Swap the vanilla buttercream for a cream cheese frosting or a whipped coconut cream for a lighter option.

Storage and Reheating

Store the frosted cake in an airtight container in the refrigerator for up to 4 days. Bring it to room temperature before serving for the best flavor and texture. You can also freeze the unfrosted cake for up to 3 months: wrap it tightly in plastic wrap and then foil. Thaw overnight in the refrigerator before frosting. To reheat individual slices, microwave for 10-15 seconds, but be aware that the frosting may melt slightly.

Frequently Asked Questions

Can I make this cake ahead of time? Yes, you can bake the cake a day in advance and keep it wrapped at room temperature. Frost it the day you plan to serve it for the freshest look.

Can I use a different pan size? If you use a 9×9-inch pan, the cake will be thicker and may need an extra 5-10 minutes of baking time. If you use a larger pan, like a 12×18-inch, reduce the baking time and check earlier.

How do I get the frosting to look like a unicorn? The plastic wrap piping method creates a beautiful rainbow swirl. If you prefer a more uniform look, you can spread the colored frostings directly onto the cake and then use a spatula to create waves.

Can I use a boxed cake mix? Absolutely. Use a white or vanilla cake mix and follow the package instructions for a 9×13-inch pan. The frosting and decorations are what make it a unicorn cake.

Why did my cake sink in the middle? A sinking center is often caused by underbaking or opening the oven door too early. Make sure your cake is fully baked by testing with a toothpick, and avoid opening the oven for the first 15 minutes.

Can I skip the edible glitter? Yes, the glitter is purely decorative. You can use extra rainbow sprinkles, or even crushed candy, to add sparkle instead.

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).