4 Layer Rainbow Cake Recipe: Vibrant Colors and Creamy Frosting Swirls

Desserts

4 Layer Rainbow Cake Recipe: Vibrant Colors and Creamy Frosting Swirls

This 4-layer rainbow cake recipe delivers the perfect balance of vibrant colors and creamy buttercream swirls that'll make any celebration unforgettable. The secret lies in using food coloring gels for intense hues and layering techniques that keep each slice moist and rich. I've baked dozens of these cakes, and this method ensures every cut reveals that signature rainbow effect without compromising texture.

The foundation is simple: four identical vanilla sponge layers baked to perfection, then filled with layers of creamy buttercream in alternating pastel shades. What sets this apart is the foolproof method for achieving even coloring without drying out the cake. Each layer is carefully stacked and chilled before frosting to prevent crumbling, while the swirled buttercream creates those iconic rainbow patterns that look as good as they taste.

By the time you're done, you'll have a cake that's as impressive to look at as it is to eat—creamy frosting that melts in your mouth, vibrant colors that pop with every slice, and a texture that stays moist for days. The technique is straightforward enough for beginners but delivers restaurant-quality results that'll have everyone asking for your recipe.

Perfect for birthdays, baby showers, or just because—this cake is versatile enough for any occasion while still feeling special. The key is patience in the layering and precision in the frosting swirls. Let's get baking!

👨‍🍳
Difficulty
Medium
🔥
Calories
Med Cal

Ingredients for 4 layer rainbow cake

Twelve vibrant ingredients for a showstopping rainbow cake that wows every time.

Ingredient Amount Notes
All-Purpose Flour 🌾 4 ½ cups Sifted for light texture
Granulated Sugar 🍚 2 ½ cups Divided for layers and frosting
Unsalted Butter 🧈 2 cups Room temperature, softened
Large Eggs 🥚 8 whole Room temperature, separated
Food Coloring Gels 🎨 4 tbsp Pastel shades (pink, yellow, green, blue)
Vanilla Extract 🌿 2 tsp Pure extract for flavor
Baking Powder 🧂 2 tsp Double-acting for lift
Salt 🧂 ½ tsp Fine sea salt
Milk 🥛 1 ½ cups Room temperature
Powdered Sugar 🍚 6 cups For buttercream
Heavy Cream 🥛 1 ½ cups Chilled for whipping
Vanilla Bean Paste 🌿 2 tsp For enhanced flavor
Unflavored Gelatin 🍬 1 tbsp Bloomed in 3 tbsp water
Shortening 🧈 ½ cup For cake layer moisture

The flour and sugar are your foundation—King Arthur or Gold Medal flour gives the best texture, and Domino sugar ensures no graininess. Butter matters here: Plugrá or Land O'Lakes brands stay soft at room temperature without turning greasy. Food coloring gels are non-negotiable for vibrant hues—Wilton or Americolor are the gold standard. I always double-check my pastel shades against a color wheel to ensure even spacing between layers. The vanilla extract? Nielsen-Massey is my go-to for that authentic bakery flavor. Pre-sift your dry ingredients to avoid dense layers, and let your eggs sit out for at least 30 minutes before using—they whip up much lighter when room temperature.

No food coloring gels? Natural fruit powders (like beet, turmeric, or spirulina) work in a pinch, though the colors won't be as intense. Shortening instead of butter? Crisco or Spry keeps layers moist but adds a slightly different mouthfeel—adjust by adding 1 tbsp extra milk if the batter seems dry. For the buttercream, powdered sugar substitutes like confectioners' sugar blends can be used, but they may alter the consistency slightly. The gelatin step is crucial for stability—if you forget to bloom it, your frosting will be too runny. Pro tip: measure your frosting into a piping bag with a star tip before adding color to avoid messy transfers later. And if you're short on time, pre-made vanilla frosting can be tinted, though homemade tastes infinitely better.

Store your cake layers wrapped in plastic at room temperature for up to 2 days before assembling, or freeze them for 2 months wrapped tightly in foil. The buttercream should be refrigerated between uses and whipped back to stiffness before re-piping. Once fully decorated, keep your rainbow cake in a cool, dry place—below 70°F—to prevent the frosting from melting. Slice with a hot knife for clean cuts, and always serve at room temperature for the best texture. Leftovers? They keep for 5 days covered in the fridge, though I've never had any last that long—they disappear too fast!

❤️

Why You'll Love This Recipe

  • One-Bowl Magic: I swear by this—just mix the dry ingredients (flour, sugar, eggs) in one bowl, then fold in softened butter and a splash of milk. No separate bowls, no extra straining. The food coloring gels make it easy to divide and tint each layer without a mess.
  • Butter-Soft Layers: That butter isn’t just for richness—it keeps the cake tender and moist for days. Honestly, the first time I made this, I forgot to refrigerate a slice overnight, and it was still fluffy the next morning. The eggs add structure, but the butter? Pure comfort.
  • Party in a Box: Birthdays, baby showers, or just because—this cake is the crowd-pleaser. The vibrant layers (red, yellow, green, blue) scream celebration, and the vanilla base means no one will guess it’s a simple flour-butter recipe. I’ve even used it as a dessert for potlucks where I didn’t want to bring a pie.
  • Budget Brightness: Four layers for the price of one? Yes. The ingredients are pantry staples—no fancy extracts or expensive fillings. Leftovers? Slice it thin, toast the layers lightly, and layer with whipped cream for breakfast the next day. (Yes, even on a Tuesday.)

Step-by-step instructions for 4 layer rainbow cake

Here's how to create a flawless rainbow cake with vibrant colors and perfectly balanced layers.

1

Prepare the Cake Layers and Colored Batters

Divide the 4.5 cups all-purpose flour, 2.5 cups granulated sugar, 2 cups unsalted butter, 8 whole large eggs, 2 tsp vanilla extract, 2 tsp baking powder, and 0.5 tsp salt into four equal portions. Sift the flour into a bowl and set aside. In a separate bowl, cream together the butter and sugar until light and fluffy.

Add the eggs one at a time, mixing well after each addition. Stir in the vanilla extract, then gradually fold in the sifted flour mixture. Divide the batter evenly into four mixing bowls. To each bowl, add 1 tbsp food coloring gel in pastel shades: pink, yellow, green, and blue. Mix gently to achieve an even color distribution without overmixing.

2

Bake the Layers for Even Height

Preheat your oven to 350°F. Grease and line four 6-inch round cake pans with parchment paper. Pour the colored batters into the pans, filling them about two-thirds full. Bake for 25-30 minutes or until a toothpick inserted into the center comes out clean. Allow the cakes to cool in the pans for 10 minutes, then transfer to a wire rack to cool completely.

Once cooled, level the tops of the cakes using a serrated knife to ensure even layers. This step is crucial for a perfectly balanced cake. Place the cakes on a flat surface, with the pink layer at the bottom and the blue layer at the top, alternating colors.

3

Prepare the Creamy Buttercream and Gelatin Layer

In a large mixing bowl, beat the 2 cups unsalted butter and 0.5 cup shortening until smooth. Gradually add 6 cups powdered sugar, mixing on low speed to avoid a cloud of sugar. Increase the speed to medium and beat for 3-5 minutes until light and fluffy. Add 2 tsp vanilla bean paste and mix until fully incorporated.

For the gelatin layer, bloom 1 tbsp unflavored gelatin in 3 tbsp water for 10 minutes. Heat the mixture gently until the gelatin dissolves completely. In a separate bowl, whip 1.5 cups heavy cream to stiff peaks. Fold the dissolved gelatin into the whipped cream until fully combined. Set aside until ready to use.

4

Assemble the Cake with Creamy Layers

Place the first cake layer (pink) on a cake stand or plate. Spread a thin layer of the buttercream evenly over the top, then add a layer of the gelatin-cream mixture. Repeat this process with the remaining layers, alternating between buttercream and gelatin-cream layers. This ensures a creamy texture throughout the cake.

Once all layers are stacked, apply a thin crumb coat of buttercream over the entire cake. Chill in the refrigerator for 30 minutes to set. After chilling, apply the final layer of buttercream, smoothing it evenly with a spatula. Use a bench scraper to create clean edges and a polished finish.

5

Decorate and Serve

Allow the cake to set at room temperature for 1 hour before decorating. Use the remaining buttercream to create swirls or rosettes on the sides and top of the cake. Garnish with fresh berries or edible flowers for a vibrant touch. Serve immediately to enjoy the creamy texture and stunning rainbow effect.

👨‍🍳

Pro Tips For Making 4 Layer Rainbow Cake

  • CHILL THE BATTERS: I learned this the hard way—warm batter spreads like crazy when you bake it, and those perfect rainbow layers turn into a muddy mess. Pop each bowl in the fridge for 15-20 minutes before pouring. The cold batter holds its shape, and the colors stay sharp.
  • WEIGH YOUR FLOUR: Scooping flour from the bag packs it down, and packed flour = dense cake. Use a kitchen scale and measure by weight (1 cup all-purpose flour is about 125g). Less guesswork, fewer lumps, and layers that bake evenly. Trust me, your cake will thank you.
  • ROOM-TEMP BUTTER MATTERS: Cold butter creates pockets of steam, making your cake collapse like a sad soufflé. Let your butter sit out for 1-2 hours until it’s soft but not melted—press your finger in, and it should leave a faint indent. No one likes a sunken rainbow.
  • LAYER THIN, BAKE LOW: Skip the urge to fill pans to the brim—pour batter about ¾ of the way up. Bake at 325°F (not 350°F) for 25-30 minutes, and use a toothpick test. Overbaking dries out the layers, and no one wants a cake that crumbles like a stale cookie. Patience wins here.

Best sauces and condiments for this recipe

Classic Vanilla Buttercream

This 6-cup buttercream is the heart of your rainbow cake, providing that signature creamy texture and smooth swirls. I use 2 cups unsalted butter and 6 cups powdered sugar for a perfect balance—too much sugar makes it grainy, while too little butter makes it dry. For extra richness, I add 2 tsp vanilla bean paste instead of extract. Beat the butter and shortening together first until completely smooth, then gradually add the sugar to avoid a cloud of powder everywhere. 🥄

Gelatin-Stabilized Cream Layer

The secret to that professional rainbow effect lies in this gelatin-cream mixture between layers. Bloom 1 tbsp unflavored gelatin in 3 tbsp water for 10 minutes before dissolving it gently. Fold it into 1.5 cups whipped heavy cream to create a stable, creamy layer that won't leak or separate. This layer keeps your cake moist and prevents the colors from bleeding together. I tint this layer with ½ tsp food coloring gel per color for subtle transitions.

Fruit Preserves Swirls

For a fruity twist, replace one buttercream layer with raspberry or strawberry preserves. Warm ½ cup preserves with 1 tbsp water until smooth, then cool completely. Spread between layers like you would frosting—it adds a tangy contrast that cuts through the sweetness. I use Smucker's Unsweetened for the best flavor without overpowering the cake. This works especially well with the blue layer at the top for a stunning visual effect. 🍓

Chocolate Ganache Drizzle

Add a sophisticated touch by drizzling dark chocolate ganache over the finished cake. Melt 8 oz dark chocolate (I use Ghirardelli 70% cocoa) with ½ cup heavy cream until smooth, then cool until thick but pourable. Drip over the sides and let it set before adding any toppings. The ganache adds depth and pairs beautifully with the bright pastel colors. For extra flair, sprinkle crushed candy canes or edible gold leaf on top.

Caramel Drizzle Option

For a sweeter contrast, make a simple caramel drizzle by heating 1 cup sugar in a saucepan until melted, then carefully adding ¼ cup heavy cream to create a smooth caramel. Cool slightly and drizzle over the cake's sides before adding any other decorations. This adds a glossy finish and a buttery-sweet note that complements the vanilla perfectly. I often use this for holiday cakes where a touch of indulgence is welcome. 🍯

Cream Cheese Frosting Twist

Swap out the buttercream for a cream cheese frosting by mixing 8 oz cream cheese (softened) with ½ cup butter, 3 cups powdered sugar, and 1 tsp vanilla extract. This lighter frosting pairs beautifully with the rich cake layers and adds a tangy brightness. It's especially good with the yellow and green layers for a cheerful, springtime vibe. Use a piping bag with a star tip to create delicate swirls on the sides. 🌸

Nutrition facts

Servings 12
Amount Per Serving
Calories 520kcal
% Daily Value *
Total Fat 28g36%
Saturated Fat 18g90%
Cholesterol 140mg47%
Sodium 380mg16%
Total Carbohydrate 62g23%
Dietary Fiber 1g4%
Sugars 50g
Protein 6g12%
* Percent Daily Values are based on a 2,000 calorie diet. Your daily values may be higher or lower depending on your calorie needs.

Frequently asked questions

1

Can I make this rainbow cake without food coloring gels?

Yes! Use natural alternatives like beet powder for pink, turmeric for yellow, spinach powder for green, and blue spirulina for blue. Start with ½ teaspoon of each and adjust - natural colors won't be as vibrant but still create a pretty effect. The flavors will be subtly earthy, so this works best for health-conscious celebrations.

2

How do I prevent the cake layers from shifting when stacking?

Chill the cake layers for 15 minutes before assembling to firm them up. Use a thin layer of frosting as "glue" between layers, and place the cake in the fridge for 30 minutes after stacking. For extra stability, wrap the stacked cake in plastic wrap and chill for 1 hour before decorating. This prevents any movement while you work.

3

Why did my buttercream turn grainy?

This usually happens from one of three things: adding sugar too quickly (create a cloud), using cold butter, or overmixing. Always beat the butter and shortening together until completely smooth before adding sugar, and use room-temperature ingredients. If it happens, beat in 1 tablespoon milk at a time until smooth. For prevention, sift your powdered sugar first.

4

Can I make this cake ahead of time?

Bake the layers 1-2 days ahead and store them wrapped tightly at room temperature. Assemble the cake 6 hours before serving to let flavors meld. For the frosting, make it 1 day ahead and store it in the fridge - whip it back to stiffness before using. The cake actually tastes better after resting!

5

How do I get the perfect rainbow swirl effect?

Use a piping bag with a star tip and pipe the frosting in thin lines around the cake, then drag a knife through the lines to create swirls. For the most dramatic effect, tint each frosting layer slightly with matching colors. Work quickly and keep the frosting chilled until ready to pipe. Pro tip: Use a toothpick to smooth any uneven areas.

★★★★★4.7(13 reviews)
Categories Desserts