Beyond Frosting » Recipes » Desserts » Cakes » Vanilla Cakes » Rainbow Cake

Rainbow Cake

Bright and colorful, this Rainbow Cake is moist and fluffy, and topped with an easy vanilla buttercream frosting. Easy and fun to make, this cake is perfect for birthdays, picnics and more.

Side view of a slice of rainbowcake

Moist & Fluffy Rainbow Cake

This rainbow cake is by and far the brightest, most colorful thing I’ve ever made in my kitchen! As you may have guessed by the name, this cake truly encompasses every color of the rainbow and since we’re using gel dye in both the cake and frosting, those colors shine through brightly. No muted colors in this cake!

This cake portion of this recipe is adapted from my yellow cake recipe, so it’s super moist and fluffy, exactly how a cake should be. Then it’s topped with my favorite vanilla frosting, a homemade buttercream made with just a few ingredients.

To create the rainbow look, the cake and frosting are divided and dyed with six different colors of the rainbow…and then the fun begins. My favorite part of making this cake is adding the colors into the cake pan and, of course, decorating the top. Every time I make this cake it looks a little different – but always delicious!

A cake frosted with rainbow frosting

What You’ll Need

There are two parts to making this recipe – the yellow cake and the buttercream frosting. Both are simple recipes made with baking basics and pantry staples.

For the Cake

  • Granulated sugar
  • Vegetable oil – Helps keep the cake moist and tender.
  • Unsalted butter – Combined the melted butter with the oil for added flavor
  • Eggs – Two eggs plus two additional yolks. The extra yolks help provide the yellow color.
  • Vanilla extract
  • Sour cream – Makes this cake extra moist and soft. Non-fat Greek or plain yogurt is a great substitute.
  • All-purpose flour
  • Baking powder & baking soda – The combination of the two help the cake rise during baking
  • Salt
  • Milk – You can also use buttermilk if you have it on hand.
  • Gel colors for dying cake batter

For the Frosting

  • Butter – The butter used in the frosting should be unsalted and cold.
  • Powdered sugar
  • Vanilla extract
  • Heavy whipping cream – You can also use milk.
  • Salt
  • Gel colors for dying frosting

How to Make Rainbow Cake

This rainbow cake starts with making a homemade yellow cake. Remember to leave plenty of time for the cake to cool completely before adding the frosting!

Make the Cake:

  1. Preheat the oven. Preheat the oven to 350°F and spray the pan with cooking spray.
  2. Beat wet ingredients and sugar. Beat the sugar, vegetable oil, butter, eggs, egg yolks and vanilla extracts under the batter is lighter in color. Mix in the sour cream and beat to combine.
  3. Add the dry ingredients. Combine the remaining dry ingredients in a bowl. Alternate adding half the dry ingredients and half the milk at a time and beat until well combined.
  4. Divide and dye. Divide the cake batter into 6 bowls and dye each bowl a different color.
  5. Adding the cake batter: Spoon the batter into the pan alternating between colors. I choose not to swirl them together because I think it gives the cake a more muddy appearance.
  6. Bake for 25-30 minutes and allow to cool completely before decorating.

Make the Rainbow Buttercream:

The recipe card provided specific measurements of frosting per color as well as which gel colors to use to create the colored frosting.

  1. Whip the butter. Cut the cold butter into pieces then whip for several minutes until light in color.
  2. Whip with the other ingredients. Alternate adding powdered sugar with the liquid ingredients, whipping 1-2 minutes each time. After everything has been added, beat for several more minutes to whip in additional air.
  3. Dye the frosting. Set aside a cup of undyed frosting then divide the remaining frosting in 6 bowls. Dye each bowl a different color then place each one in its own piping bag.

How to Decorate Rainbow Cake

  1. Fill multicolored bags. Place a piping bag in a pint glass, folding the bag over the edge. Pipe each color into the bag and shake to allow the colors to settle. Cut off the end of the bag then drop it into a second piping bag fitted with the piping tip.
  2. Pipe white rosettes. Pipe large rosettes on the cake, being sure to reserve some of the white.
  3. Add the rainbow icing. Pipe large rainbow rosettes and then smaller rosettes and, finally, fill in the remaining areas with a ribbon.
  4. Fill in holes. Use the remaining white and rainbow frosting with any of the tips to fill in any unfrosted spots.

Piping tips used

Tips for Success

Making and decorating this rainbow cake may feel intimidating but it’s actually quite easy. Here are a few tips for making the best rainbow cake.

  • Use the double piping bag method. To decorate this cake, I recommend using the double piping bag method. This means one piping bag is filled with frosting and the other just has a coupler and piping tips. This is the easiest way to decorate when using multiple piping tips. The coupler makes it so easy to switch between them. For more tips on working with piping bags, check out this post.
  • Use gel colors. Gel colors are the best to color the frosting and the cake batter. They are super concentrated and produce beautiful colors without thinning out the batter. For this recipe, I used the Wilton Color Right system. You can also find similar products from Americolor.
  • Make the perfect dyed buttercream. If this is your first time adding color to buttercream, check out my guide on how to color buttercream frosting.
A slice of rainbow cake with one piece on a fork

Serving Suggestions

This bright and colorful cake is ready to serve as soon as it’s frosted! Just cut into squares and serve! You can easily get 15 nice-sized pieces of cake from this but if you’re serving a big group or adding this to a dessert buffet or serving at a potluck, you can easily cut smaller pieces to serve more.

This cake is perfect for birthdays, picnics, showers, and any casual occasion. Be prepared for lots of ooohs, so prettys! and “how did you make this?!” comments from everyone!

A slice of rainbow cake with a glass of milk in the background

How to Store & Make Ahead

This cake can be stored at room temperature in an airtight container unless you live in a warm climate, then I would recommend refrigerating. It is best served at room temperature. Given the nature of the cake, I recommend eating within two days.

The frosting can be prepared ahead of time and stored in an airtight container., but I recommend coloring it when you’re ready to decorate. If preparing the frosting ahead of time, I recommend rewhipping it for a few minutes prior to coloring it.

Can I Freeze This Cake?

You can freeze both the rainbow cake and the buttercream frosting but should do so separately before the cake as been frosted.

To freeze the cake, wrap it tightly in plastic wrap and aluminum foil, being sure the edges overlap. The vanilla buttercream should be frozen in a Ziploc bag, with all of the air pushed out, and tightly sealed. The cake will last for up to 2 months while the frosting will last for up to a month.

Allow the cake and frosting to thaw on the counter. The frosting should be whipped one more time before using it.

Print
clock clock iconcutlery cutlery iconflag flag iconfolder folder iconinstagram instagram iconpinterest pinterest iconfacebook facebook iconprint print iconsquares squares iconheart heart iconheart solid heart solid icon
A slice of rainbow cake with one piece on a fork

Rainbow Cake

5 Stars 4 Stars 3 Stars 2 Stars 1 Star 5 from 2 reviews
  • Author: Julianne Dell
  • Prep Time: 60 minutes
  • Cook Time: 28 minutes
  • Total Time: 1 hour 28 minutes
  • Yield: 15 slices
  • Category: Cake
  • Method: Baking
  • Cuisine: American

Description

Bright and colorful, this Rainbow Cake is moist and fluffy, and topped with an easy vanilla buttercream frosting. Easy and fun to make, this cake is perfect for birthdays, picnics and more.


Ingredients

For the cake

  • 1 1/2 cups (285g) granulated sugar
  • ½ cup (118 ml) vegetable oil
  •  2 tablespoons (28g) unsalted butter, melted
  • 2 large eggs
  • 2 egg yolks
  • 1 tablespoon (15ml) vanilla extract
  • 1/2 cup (118ml) sour cream
  • 2 ½ cups (350g) all-purpose flour
  • 2 teaspoons (7.5g) baking powder
  • 1 teaspoon (4g) baking soda
  • 1 teaspoon (5g) salt
  • 1 1/3 cup (315ml) milk
  • Gel colors for dying cake batter

For the frosting

  •  2 cups (452 g) unsalted butter, cold.
  • 7 cups (911 g) powdered sugar
  • 1 tablespoon (15 ml) pure vanilla extract
  •  2-3 tablespoons (30ml) heavy whipping cream (or milk)
  • Pinch of salt (optional)
  • Gel colors for dying frosting

Instructions

For the cake

  1. Preheat the oven to 350°F. Spray a 9-inch by 13-inch pan with cooking spray.
  2. In a large mixing bowl, combine the sugar, vegetable oil, butter, eggs, egg yolks and vanilla extract. Beat on medium speed until the eggs and oil are well incorporated and the batter is lighter in color, about 2 minutes. Scrape down the bowl as needed. Next mix in the sour cream and beat until well combined.
  3. In a separate bowl, combine the remaining dry ingredients. Alternate adding half the dry ingredients and half the milk at a time and mix just until the flour starts to incorporate. Then add remaining dry ingredients and milk and beat until well combined. Use a spatula to scrape down the sides of the bowl and stir the batter from the bottom to the top to ensure it’s well mixed.
  4. To dye the cake batter, divide it into 6 bowls about 3/4 cups + 2 tablespoons per bowl. Dye each of the 6 colors. See the notes section on the recipe card for specific recommendations.
  5. Spoon the batter in the pan, alternating between colors. Once finished, tap the pan on the counter a couple times to settle the batter. Bake at 350°F for 25-30 minutes. Test the cake for doneness by inserting a toothpick into the center of the cake. If the toothpick comes out clean, the cake is done. Remove from the oven and allow to cool completely.

For the frosting

  1. Cut butter into pieces. Using the paddle attachment, whip the butter for 5-7 minutes, scraping down the bowl occasionally. Beat until the butter looks light in color.
  2. Alternate adding 2 cups of powdered sugar at a time with the liquid ingredients: vanilla extract & heavy cream. Ensure the powdered sugar is well combined, then and whip for 1-2 minutes before adding more powdered sugar. Repeat until all ingredients are added.
  3. Once all the powdered sugar has been added, increase speed to medium-high and beat for another 3-5 minutes to whip additional air into the frosting.
  4. Set aside 1 cup of undyed frosting. Then divide the remaining frosting into 6 bowls, about ½ cup each. Dye each of the 6 colors and then place each color into its own piping bag. See the notes section on the recipe card for specific recommendations.

To decorate

  1. To fill a multicolored bag, place a piping bag in a pint glass, folding the bag over the top edge. Pipe a line of each color (except white) into the bag. Fill 2/3 full and shake the bag to allow the colors to settle. Make 2-3 bags until you run out of frosting. Cut off the end of the bag, and then drop it into a second piping bag fitted with the piping tip.
  2. Start with the white, piping large rosettes with a 1M and/or Ateco 866 piping tip. Reserve some of the white to fill in later.
  3. Next pipe rainbow rosettes with a 1M and/or Ateco 866 piping tip. Then start adding in smaller rosettes using Tip 21 and Tip 199. Fill in remaining large areas with a ribbon using petal tip 104, with the skinny end facing up.
  4. Continue to fill in the holes with remaining white and rainbow frosting using any variety of these tips until the cake is frosted.


Notes

  • I used the Wilton Color Right system to dye the cake and frosting.

Dying the cake batter

  • To make the red, orange, and yellow colors, add 3 drops of gel color
  • To make the green, use 3 drops blue 2 drops yellow
  • To make the blue, use 5 drops of gel color
  • To make the purple use 4 drops pink 1 drop blue.

Dying the frosting

  • To make the red, orange and yellow colors, use 3 drops of gel coloring
  • To make the green, use 2 drops blue 2 drops yellow
  • To make the blue, use 5 drops of gel color
  • To make the purple, 2 drops pink 1 drop blue

 Piping tips used


Nutrition

  • Serving Size: 1 slice
  • Calories: 709
  • Sugar: 76g
  • Sodium: 270mg
  • Fat: 36g
  • Carbohydrates: 94g
  • Fiber: .6g
  • Protein: 4.9g
  • Cholesterol: 122mg

Filed Under:

More Cake Recipes:

Review and rate this post!

I love hearing from you! Submit your question or review here. Your email address will not be published. Required fields are marked*.

Recipe rating 5 Stars 4 Stars 3 Stars 2 Stars 1 Star

4 comments on “Rainbow Cake”

  1. The rainbow cake recipe is my favorite as my kids love it. I often bake this cake in my kitchen but with ghee instead of using veg oil and unsalted butter.