Homemade rainbow layer cake with colorful frosting, sprinkles, and a slice served on a plate.

Homemade Rainbow Layer Cake From Scratch: Big Color, Bigger Smiles!

A homemade rainbow cake consists of six thin vanilla cake layers colored red, orange, yellow, green, blue, and purple. Gel food coloring produces clear colors without thinning the batter, while a pale vanilla cake base keeps the shades from turning dull. Accurate batter division, short baking times, complete cooling, and a firm crumb coat make the tall cake easier to assemble.

This recipe makes one 8-inch (20-cm) six-layer cake with vanilla buttercream frosting. It yields about 20 standard servings or up to 24 narrow party servings.

Essential Concepts

  • Weigh the batter and divide it equally among six bowls.
  • Use gel food coloring, not liquid coloring.
  • Bake thin layers only until the centers spring back.
  • Chill the layers before leveling and stacking.
  • Apply a crumb coat before the final frosting.
  • Keep unused batter covered while baking in batches.

Homemade Rainbow Cake Recipe

Yield and Timing

  • Yield: One 8-inch (20-cm) six-layer cake
  • Servings: About 20
  • Preparation time: 60 to 75 minutes
  • Baking time: 14 to 18 minutes per batch
  • Cooling time: About 2 hours
  • Assembly time: 45 to 60 minutes
  • Total elapsed time: About 4 1/2 to 6 hours, depending on the number of pans

Equipment

  • Two or three 8-inch (20-cm) round cake pans
  • Parchment paper
  • Stand mixer or electric hand mixer
  • Large mixing bowl
  • Six medium bowls
  • Digital kitchen scale
  • Silicone spatulas
  • Gel food coloring in red, yellow, green, blue, and purple
  • Orange gel coloring, or extra red and yellow for mixing orange
  • Wire cooling racks
  • Serrated knife or cake leveler
  • 8-inch cake board or flat serving plate
  • Offset spatula
  • Bench scraper, optional
  • Piping bag, optional

Identical pans give the most consistent layers. Dark pans absorb more heat and may produce darker edges, so begin checking those cakes a few minutes early.

Ingredients for the Six Vanilla Cake Layers

Homemade rainbow layer cake with colorful sprinkles and a slice served on a plate.

All ingredients should be near room temperature unless stated otherwise.

  • 4 1/2 cups cake flour, spooned and leveled (540 g)
  • 1 1/2 tablespoons baking powder (18 g)
  • 1 teaspoon fine salt (6 g)
  • 1 1/2 cups unsalted butter, softened to about 65°F to 68°F (340 g)
  • 3 cups granulated sugar (600 g)
  • 1/2 cup neutral oil, such as canola or refined sunflower oil (120 ml)
  • 8 large egg whites (about 240 g)
  • 2 tablespoons pure vanilla extract (30 ml)
  • 2 cups whole milk (480 ml)
  • 1 cup full-fat sour cream (240 g)
  • Gel food coloring in six rainbow colors

Cake flour gives the layers a fine, tender crumb. If cake flour is unavailable, measure 4 1/2 cups all-purpose flour, remove 9 tablespoons, and replace the removed flour with 9 tablespoons cornstarch. Whisk thoroughly, then weigh or sift the mixture. The substitution works, though commercial cake flour generally produces a softer crumb.

Egg whites keep the batter pale, which makes the rainbow colors clearer. Carton egg whites may be used if the package states that they are suitable for baking.

Ingredients for Vanilla Buttercream Frosting

  • 4 cups unsalted butter, softened (908 g)
  • 10 cups confectioners’ sugar, sifted if lumpy (1.2 kg)
  • 1/2 cup heavy cream or whole milk, plus more as needed (120 ml)
  • 1 tablespoon pure vanilla extract (15 ml)
  • 1/2 teaspoon fine salt (3 g)

This quantity provides enough frosting for five filling layers, a crumb coat, and a moderate exterior coat. Elaborate piping may require an additional half batch.

Prepare the Cake Pans and Oven

Heat a conventional oven to 350°F (175°C). For a convection oven, use 325°F (165°C) unless the manufacturer recommends another adjustment.

Grease the pans lightly. Line each base with a parchment circle, then grease the parchment. A light coating is sufficient. Heavy greasing can cause the edges to fry and darken.

Cake strips placed around the pans can reduce doming, but they are optional. If using them, soak and fasten the strips according to the manufacturer’s directions.

Mix the Pale Vanilla Cake Batter

Homemade rainbow layer cake with colorful frosting and sprinkles, sliced beside eggs, milk, flour, and butter.

Whisk the cake flour, baking powder, and salt in a medium bowl. Break apart any visible lumps.

In a large mixing bowl, beat the softened butter and granulated sugar at medium speed for about 4 minutes. The mixture should look pale and slightly increased in volume. Scrape the bowl and beaters at least once.

Pour in the oil gradually and beat until incorporated. Add the egg whites in several additions, mixing well after each addition. Stir in the vanilla.

Combine the milk and sour cream in a separate container. Add about one-third of the dry ingredients to the butter mixture and mix at low speed. Add half of the milk mixture. Continue alternating, ending with the remaining dry ingredients.

Stop mixing as soon as the last streaks of flour disappear. Finish folding by hand with a spatula, scraping the base of the bowl. Prolonged mixing after the flour enters the batter can make the cake layers firm or rubbery.

The batter may look slightly curdled during the egg-white stage. Room-temperature ingredients and gradual additions reduce that problem. A minor curdled appearance usually smooths out after the flour and milk are added.

Divide and Color the Batter Evenly

Equal portions produce a six-layer cake that stands straight and cuts cleanly.

Place an empty bowl on a digital scale and record its weight. Transfer all the batter to that bowl, weigh it, and subtract the bowl’s weight. Divide the batter weight by six. The exact amount will vary slightly, but each portion will usually weigh roughly 425 to 450 grams.

Set six bowls on the scale one at a time and add the calculated amount of batter to each.

Color the portions as follows:

  1. Red
  2. Orange
  3. Yellow
  4. Green
  5. Blue
  6. Purple

Add gel food coloring in small amounts. Concentrated brands may need only a small dab on the end of a toothpick, while less concentrated gels may need several drops. Stir gently and assess the color before adding more.

For orange, mix yellow with a small amount of red if orange gel is unavailable. For purple, begin with purple gel or combine blue with a smaller amount of red. Too much red can produce brownish purple.

Use a clean toothpick or spoon for each color. Cross-contamination can muddy yellow, orange, and purple in particular. Gel coloring also stains porous surfaces, fabrics, and unfinished wood, so protect the work area.

The baked layers will usually look slightly deeper than the raw batter. Excess coloring can leave a bitter taste or stain the mouth, so stop once the batter reaches a clear medium shade.

Bake the Rainbow Layers in Batches

Spread one colored portion into each prepared pan. Smooth the surface with a small offset spatula, pushing batter fully against the edges.

Bake for 14 to 18 minutes. Pan material, actual oven temperature, and batter depth affect the timing. The layers are done when:

  • The center springs back after a light touch.
  • A toothpick comes out clean or with a few moist crumbs.
  • The cake begins to pull slightly from the pan’s edge.

Do not wait for the top to turn golden. Browning can dull the outer surface and often indicates that a thin layer has baked too long.

Cool the cakes in their pans for about 10 minutes. Run a thin knife around the edges, invert the layers onto wire racks, remove the parchment, and turn them upright. Let the pans cool before greasing, lining, and refilling them.

Keep unbaked portions covered at cool room temperature while earlier batches bake. Stirring the batter again can reduce its air and blur the texture, so give each bowl no more than one gentle fold before transferring it to a pan. Two or three pans are preferable because they limit how long the remaining batter must wait.

Prevent Dry Cake Layers

Thin cake layers lose moisture faster than standard two-layer cakes. Several practices reduce dryness:

  • Measure flour by weight. Scooping flour directly from the bag often packs too much into the cup.
  • Use full-fat sour cream and whole milk.
  • Remove each layer as soon as it passes the spring-back or toothpick test.
  • Cool the layers on racks rather than leaving them in hot pans.
  • Wrap cooled layers promptly if assembly will take place later.
  • Keep the final cake covered after cutting.

A simple syrup is optional rather than necessary. If a layer appears dry, brush it lightly with syrup made from equal volumes of sugar and water, heated until the sugar dissolves and then cooled. Use only a thin coating. Too much syrup can make a tall rainbow layer cake slippery and difficult to stack.

Cool, Chill, and Level the Layers

Allow the cakes to cool completely. Warm cake traps steam under plastic wrap and softens buttercream.

Once cool, wrap each layer separately in plastic wrap. Refrigerate for at least 45 minutes or freeze for 20 to 30 minutes. The goal is a cool, firm cake, not a frozen solid layer.

Place each chilled layer on a flat surface. If the center has a dome, remove only the raised portion with a serrated knife. Hold the knife parallel to the counter and rotate the cake rather than sawing deeply through one side.

Thin layers may need little or no trimming. Unnecessary leveling removes cake, releases crumbs, and can make the final dessert dry.

Make the Vanilla Buttercream Frosting

Beat the softened butter at medium speed for 3 to 4 minutes, scraping the bowl as needed. The butter should become smooth and lighter in color.

Add the confectioners’ sugar in several portions at low speed. Pour in the vanilla, salt, and about half of the cream. Continue beating at medium speed until smooth.

Add the remaining cream gradually. Filling buttercream should hold its shape but spread without tearing the cake. If it feels stiff, add cream 1 tablespoon (15 ml) at a time. If it feels loose, add confectioners’ sugar 1/4 cup (30 g) at a time.

Beat at low speed for another 2 minutes to remove large air pockets. High-speed mixing can leave small bubbles that become visible during the final coat.

In a warm kitchen, refrigerate soft buttercream for 10 to 15 minutes before stacking. Buttercream that appears greasy or begins sliding is too warm.

Assemble a Straight and Stable Six-Layer Cake

Place a small dab of buttercream in the center of a cake board or serving plate. Set the purple layer on top. The frosting anchors the cake.

Spread about 1/2 cup (roughly 100 g) of buttercream over the purple layer. Keep the filling level and extend it almost to the edge. Add the blue layer and press lightly with a flat hand.

Continue stacking in this order:

  1. Purple
  2. Blue
  3. Green
  4. Yellow
  5. Orange
  6. Red

Check the cake at eye level after adding each layer. Correct leaning immediately by shifting the newest layer or redistributing the filling below it. Thick filling on one side creates a tilt that becomes more pronounced near the top.

If the buttercream is soft, pipe a firm ring around the edge before filling the center. Avoid using more than about 1/2 cup between layers unless the frosting is quite stiff. Excess filling can squeeze out under the cake’s weight.

Spread a thin crumb coat over the top and sides. The crumb coat traps loose crumbs and fills small gaps. Refrigerate the cake for 20 to 30 minutes, until the coating feels firm.

Apply the remaining vanilla buttercream frosting. Smooth the sides with a bench scraper while slowly rotating the cake plate or turntable. A perfectly smooth finish is optional; an even coat and straight stack matter more for structural stability.

A six-layer cake of this size does not usually need internal supports when served at home. Add a central food-safe dowel if the cake must travel far, especially in warm weather or over uneven roads.

Make-Ahead Schedule

The work can be divided across several days.

Up to Two Months Before Serving

Bake, cool, and wrap each layer in plastic wrap, followed by aluminum foil or a freezer-safe bag. Freeze the layers flat for up to two months. Th


Discover more from Life Happens!

Subscribe to get the latest posts sent to your email.