Rainbow Cake Recipe
This rainbow cake stacks four tender, distinctly colored layers with vanilla buttercream between them. Buttermilk and egg whites keep the crumb soft, while orange, green and purple filling and a multicolor dabbed finish make every slice bright inside and out.
The recipe makes about 24 servings, with 15 minutes of prep and 35 minutes of baking; the full process takes 110 minutes, including cooling and decorating. It suits birthdays, school celebrations and parties where a colorful centerpiece is welcome.
Why you’ll love it
Why This Rainbow Cake Recipe Works
A few deliberate choices help the layers bake evenly and keep the finished cake neat enough to slice.
- Egg whites keep the crumb light. They add structure without the extra fat in yolks, giving the layers a tender texture and a pale base for clean food-coloring shades.
- Buttermilk adds tenderness. Its acidity helps soften the cake’s structure, while its liquid brings the batter together without making it heavy.
- Butter is mixed into the dry ingredients. Coating the flour with butter before adding the liquids limits gluten development. That mixing method helps keep the finished layers soft rather than chewy.
- Separate pans preserve the colors. Dividing the batter before coloring means each shade bakes on its own, with no swirling or blending between layers.
What you need
Ingredients You’ll Need
Measure the layer and frosting ingredients before you begin. Room-temperature dairy and egg whites blend more evenly into the batter and buttercream.
- For the rainbow cake layers: 3 cups flour, 3 cups sugar, 2 1/2 teaspoons baking powder, 1 teaspoon salt, 1 cup butter, 1 tablespoon vanilla, 1 cup egg whites, 1 1/2 cups buttermilk, 1/8 cup oil and red, yellow, blue and pink gel coloring. Use gel for vivid color without adding much liquid.
- For the vanilla buttercream frosting: 3 cups butter, 11 cups powdered sugar, 1 teaspoon salt, 1/3 cup cream, 1 1/2 tablespoons vanilla and red, orange, yellow, green, blue, purple and pink gel coloring. Add cream gradually to control frosting consistency.
Tools
Equipment You’ll Need
- Four 7-inch round cake pans: Four pans let the colored batter bake as separate layers at the same time.
- Kitchen scale: Weighing the batter into four equal portions helps the layers bake to a similar thickness.
The method
How to Make Rainbow Cake
1. Prepare the pans
Heat the oven to 350°F. Line four 7-inch round pans with parchment and lightly coat them with nonstick spray.
Check that the parchment lies flat across each pan base so the cakes release cleanly.
2. Mix the cake batter
In a stand mixer fitted with the paddle, pulse together the flour, baking powder, sugar and salt. On low, add the butter in chunks and mix until no large pieces remain and the mixture looks crumbly. Add the egg whites just until combined, then mix in the buttermilk in two parts. Add the vanilla and oil; scrape the bowl and beat on low about 15 seconds.
Stop once the batter is smooth and combined. Mixing longer can make the layers less tender.
3. Color and divide
Divide the batter evenly among four bowls, about 450 g each. Tint one bowl red, one yellow, one blue and one pink with a couple of drops of gel coloring, stirring each by hand with a spatula. Spoon each color into its own prepared pan.
Scrape the bottom and sides of each bowl as you mix so the color is even and no streaks remain.
4. Bake and cool the layers
Bake for 34 to 37 minutes, until a toothpick inserted in a cake comes out clean. Cool the cakes for 10 minutes, then loosen their edges with an offset spatula. Freeze the layers for 45 minutes to speed cooling; when fully cool, turn out the cakes and level their tops with a serrated knife.
A clean toothpick is the key baking cue. Let the layers cool fully before stacking so the buttercream does not soften.
5. Make the buttercream
While the cakes bake and cool, beat the butter with the paddle on medium for 30 seconds, until smooth. Add the powdered sugar one cup at a time, alternating with small splashes of cream. Mix in the vanilla and salt on low. Loosen stiff frosting with cream, 1 teaspoon at a time, or firm up runny frosting with more powdered sugar, 1/4 cup at a time.
The frosting should spread smoothly and hold its shape. Make consistency adjustments gradually.
6. Tint the filling colors
Put 1 cup of frosting into each of three bowls and tint them orange, green and purple. Keep the rest white. Set aside about 1/4 cup of orange frosting, a little green frosting and some purple frosting for decorating.
Keep the reserved colors separate from the larger portions used between the layers.
7. Stack the cake
Secure a greaseproof cake board with a dab of frosting. Set the red layer on it and spread a thick layer of orange frosting over the top. Add the yellow layer and spread green frosting over it; add the blue layer and spread purple frosting over it. Set the pink layer on top upside down, with its caramelized bottom facing up.
Line up the edges as you stack. The flat, caramelized surface of the final layer gives the top a stable base.
8. Crumb coat and chill
Spread a thin coat of frosting over the top and sides, then smooth it with a bench scraper. Chill for 10 minutes in the fridge or 5 minutes in the freezer, until firm. Add a second, thicker coat and smooth it. Chill for 10 to 15 minutes in the freezer or 30 minutes in the fridge.
The first coat should be firm to the touch before you add the outer coat, so crumbs stay sealed in.
9. Add the colorful finish
Fill a piping bag fitted with an Ateco 869 tip with about 1 1/2 cups of white frosting. Tint about 1/2 cup each of frosting red, yellow, blue and pink. Use a small offset spatula to dab the colors around the chilled cake, overlapping them as desired. Pipe a white border around the top, then slice and serve.
Keep the colored dabs loose and varied for a multicolor finish; overlapping them softens the transitions.
Doneness
How to Tell When It’s Done
The cake layers are ready when a toothpick inserted in the center comes out clean after 34 to 37 minutes at 350°F. If batter clings to the toothpick, return the pan to the oven and check again shortly.
Fully cooled layers should feel set rather than warm or fragile before you frost them. If the centers still feel warm, give them more cooling time; warm cake can melt the buttercream and make the stack slide.
Tips & common mistakes
Tips and Common Mistakes
Careful portioning, cooling and chilling make the biggest difference in how this tall cake looks when sliced.
- Bring ingredients to room temperature. Room-temperature butter, egg whites and buttermilk combine more smoothly. Cold ingredients can leave the batter uneven or make the buttercream difficult to beat.
- Use gel coloring. Gel gives the layers strong color with only a couple of drops. Liquid coloring can add enough moisture to change the batter’s consistency.
- Mix the shades separately. Use a clean spatula for each bowl if you want distinct colors. A little stray batter can muddy a bright shade.
- Level only cool layers. A warm cake is more likely to crumble under a serrated knife. Let the layers cool fully before trimming their tops.
- Chill between frosting coats. The first coat needs time to firm before the final coat goes on. Skipping that pause can leave crumbs streaked through the outside.
Make it your way
Substitutions and Variations
You can adapt the batter or pan format, though different shapes and ingredients may change the texture or baking time.
- Whole eggs: Use four whole room-temperature large eggs in place of the egg whites. The crumb will be richer and more yellow, so the layer colors may look less pastel.
- Three 8-inch layers: The batter can be divided among three 8-inch pans instead of four 7-inch pans. You will have fewer, wider layers, so check their centers for doneness.
- Cupcakes: Fill cupcake liners 3/4 full and bake at 350°F for 19 to 21 minutes. For a rainbow effect, divide and tint the batter before filling the liners.
- Vanilla bean paste: Use vanilla bean paste instead of vanilla extract in either the batter or frosting. It adds visible vanilla flecks without changing the method.
- Color palette: Choose different gel colors for the layers or buttercream decorations. Keep the number of batter portions the same if you want four separate cake layers.
Serving
What to Serve with Rainbow Cake
Serve thin slices on their own; the cake is rich, and its colorful layers make a festive dessert without extra garnish. Fresh berries or a bowl of sliced fruit offer a refreshing contrast to the sweet buttercream.
For a party table, pair the cake with coffee, tea or cold milk. Cut the cake with a clean knife, wiping it between slices to keep the colored layers crisp.
Storage
Make-Ahead, Storage and Reheating
Make ahead: Bake the layers ahead and freeze them, wrapped well, until you are ready to assemble the cake. You can also prepare the frosting in advance; bring it to a spreadable consistency before decorating.
Storage: Keep the frosted cake covered in the refrigerator for up to a week. Cover cut surfaces with leftover frosting before storing to help keep the exposed cake from drying out.
Freezing: The frosted cake can be frozen for up to a month, wrapped carefully once firm. Frosting alone keeps refrigerated up to a month or frozen up to 3 months; stir it well after thawing.
Reheating: This cake is best served at room temperature rather than reheated. Let a refrigerated slice sit out briefly before serving so the buttercream softens and the cake is easier to enjoy.
Questions
Rainbow Cake FAQs
Can I make rainbow cake without four 7-inch pans?
Yes. Use three 8-inch pans for three wider layers, or bake the batter in a 9×13-inch pan as a sheet cake. The pan shape changes the baking time and the appearance of the finished cake.
Why did my cake layers come out uneven?
The most common cause is unevenly divided batter. Weigh the portions so each pan gets about 450 g, and make sure the pans are arranged evenly in the oven.
Can I make the cake layers ahead?
Yes. The layers can be made ahead and frozen. Wrap them well once cool, then let them thaw before leveling and assembling.
How do I keep the cake from sliding while I decorate it?
Make sure the layers are fully cool and the filling is spread evenly. Chill the crumb-coated cake until firm before adding the thicker outer coat.
Can I use liquid food coloring?
Gel coloring is preferable because it gives strong color with only a small amount. Liquid coloring can thin the batter or frosting if you need to use much of it.
Can I make this as cupcakes?
Yes. Fill liners 3/4 full and bake at 350°F for 19 to 21 minutes. Tint the batter before filling the liners if you want colorful cupcakes.
Recipe Card

Rainbow Cake Recipe
Ingredients
Method
- Heat the oven to 350°F. Line four 7-inch round pans with parchment and lightly grease with non-stick spray.
- In a stand mixer with the paddle, gently pulse the flour, baking powder, sugar and salt together.
- On low speed, add the 1 cup room-temperature butter in chunks and mix until no large pieces remain and the mixture is crumbly.
- On low, mix in the egg whites until just combined, then add the buttermilk in two parts, still on low.
- Mix in the vanilla and oil on low until fully incorporated. Scrape the bowl, then beat on low about 15 seconds.
- Divide the batter evenly among four bowls (about 450 g each). Add a couple of drops of gel coloring to make red, yellow, blue and pink, and mix each by hand with a spatula until even.
- Spoon each color into its own prepared pan.
- Bake 34 to 37 minutes, until a toothpick comes out clean. Cool 10 minutes, then loosen the edges with an offset spatula.
- Freeze the layers 45 minutes to speed cooling. When fully cool, flip the pans and release the layers.
- Level the tops with a serrated knife.
- While the cakes bake and cool, beat the 3 cups butter on medium for 30 seconds with the paddle until smooth. Add the powdered sugar one cup at a time, alternating with small splashes of the cream.
- Add the vanilla and salt and beat on low until combined and at the desired consistency. If too thick, add cream 1 teaspoon at a time; if too thin, add powdered sugar 1/4 cup at a time.
- Put 1 cup of frosting into each of three bowls and tint orange, green and purple. Leave the rest white.
- Put a dab of frosting on a greaseproof cake board and set the first layer on it.
- Place the red layer first, spread a thick layer of orange frosting over it, and reserve about 1/4 cup orange.
- Add the yellow layer, spread green frosting on top and reserve a little green.
- Add the blue layer, spread purple frosting on top and reserve some purple.
- Place the pink layer upside down so its caramelized bottom faces up.
- Apply a thin coat of frosting over the whole cake and smooth with a bench scraper. Chill 10 minutes in the fridge or 5 minutes in the freezer until firm.
- Apply a second, thicker coat and smooth. Chill 10 to 15 minutes in the freezer or 30 minutes in the fridge.
- Fill a piping bag fitted with an Ateco 869 tip with about 1 1/2 cups white frosting.
- Tint about 1/2 cup each of frosting red, yellow, blue and pink.
- With a small offset spatula, dab each color around the chilled cake, overlapping as desired.
- Pipe a white border around the top, then slice and serve.