Go Back
+ servings
featured rainbow cake.

Rainbow Cake Recipe

Course: cake, Dessert
Cuisine: American
Prep Time: 20 minutes
Cook Time: 20 minutes
Cool/Chill Time: 1 hour 25 minutes
Total Time: 2 hours 5 minutes
Servings: 10 slices
Calories: 838kcal
Author: Becky Hardin
Make someone's day with this surprise Rainbow Cake! No one will know there are layers of colorful cake until you slice into it.
Print Recipe

Equipment

Ingredients

For the Cake

  • cups all-purpose flour 350 grams
  • cups granulated sugar 300 grams
  • 1 teaspoon baking soda 6 grams
  • 1 teaspoon baking powder 4 grams
  • ½ teaspoon kosher salt
  • cups buttermilk 341 grams, room temperature
  • ½ cup unsalted butter 115 grams, slightly melted
  • 3 large eggs 150 grams, room temperature
  • 2 teaspoons pure vanilla extract 8 grams
  • Gel food coloring red, orange, yellow, green, blue, purple

For the Frosting

  • 5 cups powdered sugar 600 grams
  • cups unsalted butter 340 grams, slightly melted (3 sticks)
  • 1 tablespoon pure vanilla extract 12 grams

Instructions

For the Cakes

  • Preheat oven to 350°F. Spray six 6-inch round cake pans with nonstick spray and line the inside bottoms with parchment paper to prevent the cake from sticking. Set aside.
    overhead view of ingredients for rainbow cake.
  • In a large bowl, stir the flour, granulated sugar, baking soda, baking powder, and salt together. Stir well to mix. Set aside.
    2½ cups all-purpose flour, 1½ cups granulated sugar, 1 teaspoon baking soda, 1 teaspoon baking powder, ½ teaspoon kosher salt
    overhead view of wet and dry ingredients for rainbow cake in glass bowls.
  • In the bowl of a stand mixer fitted with the paddle attachment, beat the buttermilk, slightly melted butter, eggs, and vanilla extract together on low until mixed. This mixture will look a bit chunky (small butter chunks) but that’s okay.
    1½ cups buttermilk, ½ cup unsalted butter, 3 large eggs, 2 teaspoons pure vanilla extract
  • Pour the wet ingredients into the dry ingredients and beat on low just until combined. Do not overmix. Mix just until you no longer see dry ingredients. Be sure to use a spatula to mix dry ingredients from side and bottom of bowl into the rest of the mixture. This mixture will still look chunky and that’s perfect because we still have to mix in the different colors. It’s important not to overmix this or you’ll end up with lots of crater holes in your cakes.
    overhead view of rainbow cake batter in a glass bowl.
  • Separate cake batter equally into 6 bowls. This works out to be around 210 grams of batter per bowl.
    overhead view of cake batter in 6 glass bowls.
  • Color one bowl of cake batter red, one orange, one yellow, one green, one blue and one purple. Again, be careful not to overmix. Stir just until the color is mixed in well.
    Gel food coloring
    overhead view of cake batter in 6 glass bowls, colored red, orange, yellow, green, blue, and purple.
  • Pour cake batter into prepared pans. One color cake batter per cake pan.
  • Bake in the preheated oven for 20-22 minutes, or until a toothpick inserted in the middle of the cakes comes out clean.
    overhead view of baked rainbow cake layers in round cake pans, colored red, orange, yellow, green, blue, and purple.
  • Let cakes cool in pans for 15 minutes before removing cakes from pans.
  • Wrap cakes in food-safe plastic wrap (each cake wrapped separately so they don’t stick together) and place cakes in fridge for at least one hour (could also be left overnight if wrapped tightly in food-safe plastic wrap so they don’t dry out).

For the Frosting

  • In the bowl of a stand mixer fitted with the whisk attachment, beat the powdered sugar, slightly melted butter, and vanilla extract together on high until light and fluffy, about 5 minutes.
    5 cups powdered sugar, 1½ cups unsalted butter, 1 tablespoon pure vanilla extract
    overhead view of white frosting in a glass bowl.

For Assembly

  • Unwrap the chlled cakes and use a large serrated knife cut the top domes off of the cakes so each cake top is flat. You don’t need these cake domes for anything else so you can set these aside to snack on later.
  • Place a thin layer of frosting (about 2 tablespoons) in the middle of a cake board or cake plate then place the purple cake (cut side facing up) on top of that frosting. This small bit of frosting helps to secure the cake to the cake board so the cake doesn’t slide around during decorating.
    overhead view of a purple cake layer on a white cake stand.
  • Add a generous layer of frosting on top of that purple layer of cake and use an angled icing spatula to smooth the icing out evenly. Then place the second layer of cake (blue, cut side facing up again) on top of the first layer of frosted purple cake.
    overhead view of a frosted purple cake layer on a white cake stand.
  • Add a generous layer of frosting on top of that blue layer of cake then place the next layer of cake (green, cut side facing up again) on top of the blue layer of frosted cake. Repeat these steps with cake layers in this order starting at the bottom of the cake: purple, blue, green, yellow, orange and finishing with red layer on top but the red cake layer should be placed bottom up (cut side facing down).
    side view of stacked rainbow layers of cake on a white cake stand.
  • Frost a thin layer of frosting around the top and sides of cake. This thin layer (called a crumb coat) is meant to secure all the crumbs to the cake. This is just a thin layer of frosting so it doesn’t have to be perfectly smooth and it’s okay if you can still see the cake through this first layer of frosting. Use a tool like a cake scraper to smooth the icing out.
    side view of a crumb coated rainbow cake on a white cake stand.
  • Place the lightly frosted cake in the freezer for 10 minutes so the first layer of frosting firms up a bit.
  • Remove cake from freezer and apply the second layer of frosting. Spread this layer as smoothly as you can using the cake scraper tool.
  • Decorate the top of the cake as desired. I used a Wilton 21 icing tip on an icing bag to pipe swirls around the top then added sprinkles to those swirls. I also pressed sprinkles onto the bottom edge of the cake.
    side view of rainbow cake on a white cake stand.

Notes

  • Use room temperature ingredients for the best results.
  • Weigh the dry ingredients using a scale or the spoon-and-level method to prevent dense, dry layers.
  • You can change up the flavor of this cake by swapping out the vanilla extract. Try almond, lemon, coconut, or cherry!
  • For these vibrant colors, I used the brand Chefmaster Liqua-gel in the colors: super red, neon brite orange, lemon yellow, leaf green, neon brite blue and neon brite purple.
  • Chill the cakes before frosting them, but make sure the frosting is at room temperature.
Storage: Store rainbow cake in an airtight container at room temperature for up to 2 days, in the refrigerator for up to 4 days, or in the freezer for up to 1 month.

Nutrition

Serving: 1slice | Calories: 838kcal | Carbohydrates: 116g | Protein: 7g | Fat: 40g | Saturated Fat: 25g | Polyunsaturated Fat: 2g | Monounsaturated Fat: 10g | Trans Fat: 1g | Cholesterol: 157mg | Sodium: 335mg | Potassium: 119mg | Fiber: 1g | Sugar: 91g | Vitamin A: 1275IU | Calcium: 90mg | Iron: 2mg