Rainbow Layer Cake
Rainbow layer cake brings six vividly colored vanilla layers together with smooth buttercream between them and all around the outside. Cake flour and egg whites give the layers a fine, tender crumb, while a thin, even filling keeps the tall stack neat when sliced.
The recipe makes a cake for 20 and takes about 75 minutes to prepare and 40 minutes to bake, with extra cooling time before assembly. Its bright layers make it a natural centerpiece for birthdays, graduations, and other parties where a generous cake is welcome.
Why you’ll love it
Why This Rainbow Layer Cake Recipe Works
This cake takes a little planning, but the method keeps the layers consistent and gives you a stable stack with plenty of color.
- Egg whites keep the crumb light. They add structure without the richness of yolks, letting the cake stay pale enough for the food colors to show clearly.
- Cake flour makes tender layers. Its lower protein content helps limit gluten development. Mixing only until the ingredients come together also keeps the crumb from turning tough.
- Butter is blended into the dry ingredients. Working softened butter in until it is pea-sized coats some of the flour and helps create a fine, even texture.
- A measured filling helps the stack hold. Spreading about 1/4 inch of frosting between the layers gives each one a cushion without adding so much filling that the cake slides.
What you need
Ingredients You’ll Need
Set out the ingredients before you begin, and bring the milk and egg whites to room temperature as directed. The cake and frosting quantities are divided between two batches.
- Milk: Two cups, divided between the cake batches. Room-temperature milk blends more smoothly into the batter.
- Egg whites: Twelve, split between batches and brought to room temperature. They give the layers structure and a light color.
- Vanilla extract: Two teaspoons for the cake and two tablespoons for the frosting. Use pure vanilla if available for a rounded flavor.
- Cake flour: Four and one-half cups. Measure lightly and level it for tender, evenly textured layers.
- Granulated sugar: Three and one-half cups, divided between the batches. It sweetens the cake and helps keep the crumb moist.
- Baking powder: Two tablespoons plus two teaspoons. Measure carefully so the layers rise evenly without a chemical aftertaste.
- Salt: Two teaspoons for the cake and one-half teaspoon for the frosting. It balances sweetness and brings out the vanilla.
- Butter: One and one-half cups softened for the cake, plus two cups softened and unsalted for the frosting. Soft butter blends without lumps.
- Gel food coloring: Six tubes in red, orange, yellow, green, blue, and purple. Gel color gives vivid shades without thinning the batter.
- For the frosting: One-half cup heavy cream and eight cups powdered sugar make a smooth, spreadable buttercream; add the sugar gradually.
- Rainbow sprinkles: Use them to decorate the finished cake. Add them while the outer frosting is still soft so they adhere.
Tools
Equipment You’ll Need
- Wire cooling rack: It lets air circulate around the cakes after they leave the pans, helping them cool evenly.
- Sharp knife: A long, sharp knife makes it easier to trim the cooled cake tops level before stacking.
The method
How to Make Rainbow Layer Cake
1. Prepare the pans
Heat the oven to 350°F. Grease three 8-inch pans and fit parchment rounds into their bottoms.
Set the pans within reach before mixing so the colored batter can be portioned promptly.
2. Mix the wet ingredients
In a medium bowl, whisk 1 cup milk with 6 egg whites and 1 teaspoon vanilla. Leave the mixture aside while you prepare the dry ingredients.
Whisk just until the whites are loosened and the mixture looks uniform.
3. Start the first batter
In the stand mixer bowl, combine 2 1/4 cups flour, 1 3/4 cups sugar, 1 tablespoon plus 1 teaspoon baking powder, and 1 teaspoon salt. With the paddle on low, add 3/4 cup softened butter about 1 tablespoon at a time, mixing until the pieces look pea-sized.
Stop once the butter is in small pieces throughout; the mixture will not look like a smooth batter yet.
4. Finish the batter
Add half of the egg white mixture and beat on medium for about 2 minutes, until fluffy. Pour in the rest and mix on medium only until combined.
Scrape the bowl if needed, but avoid extended mixing after adding the remaining liquid.
5. Color three portions
Divide the batter into thirds. Stir 1/2 teaspoon purple gel coloring into one portion, 1/2 teaspoon blue into another, and 1/2 teaspoon green into the last.
Add color a few drops at a time if you prefer softer shades; gel coloring is concentrated.
6. Bake the first layers
Transfer each color to its own prepared pan. Bake for 18 to 22 minutes, rotating the pans so the layers bake evenly.
A toothpick inserted in the center should come out clean, and the cake should spring back when lightly pressed.
7. Cool and bake again
Leave the cakes in their pans for 5 minutes, then turn them onto a rack and cool completely. Wash the mixer bowl, then repeat the batter method with the remaining ingredients, coloring the portions red, yellow, and orange.
Make sure the first layers are cool before frosting; warm cake can soften the buttercream.
8. Make the frosting
With the whisk attachment, beat 1 cup butter until smooth, about 1 minute. Add 1 tablespoon vanilla, 1/4 teaspoon salt, and 2 cups powdered sugar, beginning on low speed and gradually increasing it. Beat in 2 more cups powdered sugar and 1/4 cup heavy cream until smooth. Move this batch to another bowl, then repeat with the remaining frosting ingredients, making about 10 cups total.
Start slowly when adding powdered sugar to keep it from puffing out of the bowl. The finished frosting should spread easily and hold its shape.
9. Level and stack the layers
Use a sharp knife to trim the tops level. Put a dollop of frosting on the serving plate and set the purple layer on it. Spread about 1/4 inch of frosting across the top, then place the blue layer above it and frost that surface. Continue upward with green, yellow, orange, and red, adding frosting between each pair.
Keep the layers centered as you stack. If they feel delicate, stack and frost them while still frozen, as noted in the recipe.
10. Frost and decorate
Cover the sides and top of the cake with frosting. Pipe any frosting left over onto the top, then finish with rainbow sprinkles.
If the tall cake wobbles, insert straws to help keep it upright. Chill it briefly if you need the frosting to firm before moving it.
Doneness
How to Tell When It’s Done
If a toothpick comes out with wet batter, return the pans to the oven and check again shortly. If it has a few moist crumbs, the layers are done; baking until completely dry can make them crumbly and harder to stack.
Cool each layer fully before frosting unless you are stacking them frozen. Warm layers can melt the buttercream, while very delicate thawed layers may tear during handling.
Tips & common mistakes
Tips and Common Mistakes
A little organization makes the coloring, cooling, and stacking much easier.
- Measure the colors before mixing. Set out the six shades and bowls ahead of time so the batter does not sit while you search for supplies.
- Add gel color gradually. A few drops at a time give you more control over the final shade and avoid over-coloring the batter.
- Keep the pans rotating. Turning them during baking helps account for hot spots and gives the layers a more even rise.
- Trim only after cooling. Warm cake is more fragile and may tear under the knife; level, cool layers give the finished stack a steadier base.
- Stabilize a wobbly stack. Straws can help keep the tall cake upright. Insert them carefully and trim them to the cake height if needed.
Make it your way
Substitutions and Variations
The colors and decoration are flexible, but keep the cake and frosting proportions as written for the most reliable stack.
- Different color set: Choose six shades that suit the occasion. Keep the same number of portions and use gel coloring so the batter stays thick.
- Softer colors: Use less gel coloring for pastel layers. The shades will be subtler, but the cake will still have distinct bands.
- Different sprinkles: Swap rainbow sprinkles for another small decorating sprinkle. Larger decorations may slide off the frosting or make slicing awkward.
- Cake flour alternative: A cake-flour substitute can work, but the crumb may be less delicate. Measure it carefully and avoid adding extra flour.
- Flavor variation: A small amount of a different extract can change the frosting flavor, though vanilla is the clearest match for the colorful layers.
Serving
What to Serve with Rainbow Layer Cake
Cut the cake with a long, sharp knife and wipe the blade between slices to keep the colored bands tidy. It is rich enough to serve on its own, or pair it with fresh berries and coffee for a birthday dessert table.
For a party spread, offer small slices alongside fruit or a simple, lightly sweetened dessert. The recipe serves 20, making it suitable for a crowd.
Storage
Make-Ahead, Storage and Reheating
Make ahead: Bake the layers ahead and cool them completely before wrapping. The notes recommend freezing layers for storage; assemble and decorate after thawing overnight in the refrigerator, or stack and frost the layers while still frozen.
Storage: Cover leftover cake and refrigerate it, then eat it within 4 days. Keep it protected from other refrigerator odors so the buttercream stays fresh.
Freezing: Freeze layers before or after assembly by wrapping them in plastic wrap and then foil; use within 2 months. Frosting can also be frozen, then thawed on the counter, and the cake should thaw overnight in the refrigerator.
Reheating: This cake is best served chilled or brought out briefly before slicing; it does not need reheating. Let refrigerated slices sit until the buttercream softens slightly for easier eating.
Questions
Rainbow Layer Cake FAQs
Can I make the cake layers a day ahead?
Yes. Cool them completely, wrap them well, and refrigerate or freeze them; wait to assemble until the layers are ready to handle.
Can I bake all six layers at once?
No, not with the specified three pans. The method bakes three layers in each of two batches, which also keeps the coloring process manageable.
Why is my rainbow cake leaning?
Uneven layers or too much filling can make the stack shift. Level the cake tops, keep the frosting layer even, and use straws to help steady a wobbly cake.
How do I get clean slices?
Use a long, sharp knife and clean it between cuts. A chilled cake is firmer and easier to portion neatly than one sitting at room temperature.
Can I use liquid food coloring?
Gel coloring is preferable because it adds vivid color without thinning the batter. Liquid coloring may require more product for bright shades and can loosen the mixture.
How much frosting does this cake need?
The full frosting method makes about 10 cups, enough to fill the layers, cover the outside, and leave some for piping on top.
Recipe Card

Rainbow Layer Cake
Ingredients
Method
- Preheat the oven to 350°F. Grease three 8-inch pans and line the bottoms with parchment.
- Whisk 1 cup milk, 6 egg whites and 1 teaspoon vanilla in a medium bowl and set aside.
- In a stand mixer bowl with the paddle, mix 2 1/4 cups flour, 1 3/4 cups sugar, 1 tablespoon plus 1 teaspoon baking powder and 1 teaspoon salt.
- On low speed, add 3/4 cup softened butter about 1 tablespoon at a time, mixing until the butter is pea-sized.
- Add half the egg white mixture and beat on medium about 2 minutes until fluffy; add the rest and beat on medium until just combined.
- Divide the batter into thirds. Mix 1/2 teaspoon purple gel coloring into one, 1/2 teaspoon blue into another and 1/2 teaspoon green into the last.
- Pour each batter into its own prepared pan and bake 18 to 22 minutes, rotating the pans so they bake evenly.
- Check that a toothpick comes out clean and the cake springs back when pressed. Cool in the pan 5 minutes, then turn out onto a rack to cool completely.
- Wash the bowl and repeat the batter steps with the remaining ingredients, using red, yellow and orange coloring.
- Once the cakes are cool, beat 1 cup butter with the whisk attachment until smooth, about 1 minute.
- Add 1 tablespoon vanilla, 1/4 teaspoon salt and 2 cups powdered sugar, starting on low and gradually increasing speed.
- Add 2 more cups powdered sugar and 1/4 cup heavy cream and beat until smooth.
- Move the frosting to a separate bowl and repeat the frosting steps with the remaining ingredients, for about 10 cups of frosting total.
- Trim the cake tops with a sharp knife so they are level.
- Put a dollop of frosting on the serving plate, set the purple layer on it and spread about 1/4 inch of frosting over the top.
- Add the blue layer and frost its top; continue with green, yellow, orange and red in that order.
- Frost the entire outside and top, then pipe any leftover frosting on top for decoration.