Skip to main content
Zimt

Home baking recipes and cinnamon favourites

Colorful Rainbow Layer Cake Recipe for Celebrations

A rainbow layer cake dazzles any celebration with its vivid stripes and tender crumb. By separating a single vanilla batter and tinting each portion, you get consistent texture while the colors pop. This guide walks you through every step—from mixing to stacking—so the cake looks as good as it tastes.

Ingredients

All of the ingredients below are for a seven‑layer, 8‑inch round cake that stands about 2½ inches tall. The batter is divided and colored, then layered with a smooth buttercream frosting.

  • 4 cups (480 g) all‑purpose flour
  • \n
  • 2 ½ teaspoons baking powder
  • ½ teaspoon fine sea salt
  • 1 cup (226 g) unsalted butter, softened
  • 2 cups (400 g) granulated sugar
  • 4 large eggs, room temperature
  • 2 teaspoons pure vanilla extract
  • 1 cup (240 ml) whole milk, room temperature
  • Gel food coloring: red, orange, yellow, green, blue, indigo, violet (about 1 cm tube each)
  • For the frosting:
    • 1 ½ cups (340 g) unsalted butter, softened
    • 4 cups (480 g) confectioners’ sugar, sifted
    • 2 tablespoons heavy cream or milk
    • 1 teaspoon vanilla extract
    • Pinch of salt

Make sure the butter, eggs, and milk are at room temperature; this helps the batter emulsify and rise evenly. If you prefer a dairy‑free version, substitute the butter with a plant‑based spread and use oat or almond milk, but keep the total fat content similar.

Instructions

Begin by preparing the cake pans and the batter. You will need seven 8‑inch round cake pans (or you can reuse three pans, rotating them after each bake).

  1. Preheat the oven to 350°F (175°C). Grease each pan with butter, line the bottom with parchment, and lightly dust with flour. Set aside.
  2. In a large bowl whisk together flour, baking powder, and salt. Set this dry mixture aside.
  3. Using a stand mixer on medium speed, cream the softened butter and sugar until pale and fluffy, about 3–4 minutes. Scrape the sides.
  4. Add the eggs one at a time, beating well after each addition, then stir in the vanilla extract.
  5. With the mixer on low, alternately add the dry ingredients and milk, beginning and ending with the dry mix. Mix just until incorporated; over‑mixing can make the cake dense.
  6. Divide the batter evenly into seven medium bowls. Add a few drops of gel food coloring to each bowl, stirring until the color is uniform. For deeper hues, add color gradually—gel concentrates pigment without adding extra liquid.
  7. Pour each colored batter into its prepared pan, spreading gently to the edges. Bake for 12–15 minutes, or until a toothpick inserted in the center comes out clean. Rotate the pans halfway through for even browning.
  8. Allow the cakes to cool in the pans for 10 minutes, then turn them out onto a wire rack to cool completely. If any layers dome, level them with a serrated knife.
  9. While the cakes cool, prepare the buttercream: beat the butter until creamy, gradually add confectioners’ sugar, then the cream, vanilla, and salt. Beat on high for 2 minutes until light and fluffy.
  10. Place the violet layer on a serving plate, spread a thin “crumb coat” of buttercream, then repeat with indigo, blue, green, yellow, orange, and finally red on top. Chill the assembled cake for 20 minutes to set the crumb coat.
  11. Apply a final generous layer of buttercream, smoothing with an offset spatula. For a professional finish, dip a clean bench scraper in hot water, wipe dry, and run it around the sides for a smooth edge.
  12. Finish with decorative piping, sprinkles, or edible glitter if desired. Store the cake in the refrigerator until serving.

When cutting, use a long, serrated knife warmed in hot water and wiped dry; this yields clean slices without pulling the frosting. Serve the cake at room temperature for the best flavor and texture.

Tips

Use gel food coloring rather than liquid; gels provide vibrant hues without thinning the batter, which can affect the cake’s rise. If you only have a few cake pans, bake the layers in batches, allowing each baked layer to cool completely before stacking to avoid soggy seams.

Common mistakes include over‑mixing the batter and letting the frosting become too soft. To keep buttercream stable, chill it briefly if it looks runny, and always use a kitchen scale for flour to avoid packing errors. Finally, remember that raw egg batter should never be tasted; the heat of the oven eliminates any salmonella risk when the internal temperature reaches 160°F (71°C).

Serving Suggestions

Pair the rainbow cake with a lightly sweetened whipped cream infused with citrus zest for a refreshing contrast. Fresh berries—strawberries, blueberries, or raspberries—add color harmony and a burst of acidity that balances the rich buttercream.

For formal occasions, slice the cake into elegant wedges and arrange them on a platter with edible flowers. If you’re serving a large crowd, cut the cake into bite‑size squares and secure each with a decorative toothpick topped with a small candy.

Variations

Swap the vanilla batter for chocolate by adding ¾ cup cocoa powder to the dry ingredients and reducing the milk by ¼ cup. Color the chocolate layers with the same rainbow palette for a striking contrast.

For a lighter version, replace half the butter with Greek yogurt and use a Swiss meringue buttercream, which is less sweet and more stable at room temperature. You can also experiment with flavored fillings—lemon curd, raspberry jam, or salted caramel—between specific layers for hidden surprises.

Storage and Reheating

Store the assembled cake, tightly wrapped in plastic wrap, in the refrigerator for up to 4 days. The buttercream will stay soft, but for longer storage, freeze the cake (unwrapped) for up to 2 months; thaw overnight in the fridge before serving.

To serve a refrigerated cake, let it sit at room temperature for 30–45 minutes. If you need to warm individual slices, microwave on low (about 10 seconds) just until the frosting softens; avoid overheating, which can melt the buttercream completely.

Frequently Asked Questions

Can I use a different pan size?

Yes. If you only have 9‑inch pans, the batter will spread thinner, resulting in more layers or a taller cake. Adjust baking time by 2–3 minutes and keep an eye on the color.

Do I have to bake each layer separately?

Ideally, bake each layer individually to ensure even color and texture. Baking multiple layers at once can cause uneven rising, especially if the oven has hot spots.

What is the safest internal temperature for the cake?

The cake is safe to eat once the center reaches 160°F (71°C), which you can verify with an instant‑read thermometer inserted into the thickest part of a layer.

How do I prevent the frosting from cracking?

Apply a crumb coat and chill the cake before the final frosting layer. This creates a stable base and reduces the risk of cracks caused by temperature fluctuations.

Can I make the cake gluten‑free?

Replace the all‑purpose flour with a 1‑to‑1 gluten‑free blend that contains xanthan gum. The texture will be similar, but you may need to add an extra tablespoon of milk to achieve the right batter consistency.

Is it okay to use liquid food coloring?

Liquid coloring can be used, but you’ll need to increase the amount of dry ingredients slightly to compensate for the added moisture, which may affect the cake’s rise.

Read next