Zimt

Rainbow Cake Recipe for Any Occasion

· 5 min read · Cakes

In this article
  1. Ingredients
  2. Instructions
  3. Tips
  4. Serving Suggestions
  5. Variations
  6. Storage and Reheating
  7. Frequently Asked Questions

This rainbow cake is a show-stopping layer cake with moist, tender vanilla sponge dyed in six bright colors, stacked with a silky vanilla buttercream. It works for birthdays, baby showers, Pride celebrations, or any party where you want a slice of joy. The recipe uses a single batter divided into six bowls, so it’s simpler than it looks, and the crumb is sturdy enough to hold the layers without being dry.

Ingredients

  • 3 cups (360 g) all-purpose flour
  • 1 tablespoon baking powder
  • 1/2 teaspoon salt
  • 1 cup (226 g) unsalted butter, softened
  • 1 3/4 cups (350 g) granulated sugar
  • 4 large eggs, room temperature
  • 1 tablespoon vanilla extract
  • 1 cup (240 ml) whole milk, room temperature
  • Gel food coloring: red, orange, yellow, green, blue, purple (or your choice of colors)
  • For the buttercream: 1 1/2 cups (340 g) unsalted butter, softened
  • For the buttercream: 4 cups (480 g) powdered sugar, sifted
  • For the buttercream: 2 tablespoons heavy cream (or milk)
  • For the buttercream: 2 teaspoons vanilla extract
  • For the buttercream: pinch of salt

Instructions

  1. Preheat your oven to 350°F (175°C). Grease and flour three 8-inch round cake pans, or line the bottoms with parchment paper.
  2. In a medium bowl, whisk together the flour, baking powder, and salt. Set aside.
  3. In a large bowl, beat the butter and sugar on medium speed until light and fluffy, about 3 minutes. Add the eggs one at a time, beating well after each addition. Mix in the vanilla extract.
  4. Add the dry ingredients in three additions, alternating with the milk, starting and ending with the dry ingredients. Mix until just combined; do not overmix.
  5. Divide the batter evenly into six small bowls (about 1 cup each). Add gel food coloring to each bowl to achieve your desired colors: red, orange, yellow, green, blue, and purple. Stir each until the color is uniform.
  6. If using three pans, pour two colors into each pan, spooning them side by side. For a more even bake, you can bake each color separately (see Tips). If baking all six at once, use six 8-inch pans if you have them, or bake in batches.
  7. Bake for 20–25 minutes, or until a toothpick inserted into the center comes out clean. If baking multiple pans at once, rotate them halfway through. Let cool in pans for 10 minutes, then turn out onto wire racks to cool completely.
  8. While the cakes cool, make the buttercream: Beat the butter on medium speed until smooth. Gradually add the powdered sugar, then the cream, vanilla, and salt. Beat on high for 2–3 minutes until light and fluffy.
  9. Once the cakes are completely cool, level the tops with a serrated knife if needed. Place one layer on a serving plate, spread a thin layer of buttercream, and repeat with the remaining layers, stacking them in rainbow order (red, orange, yellow, green, blue, purple).
  10. Frost the outside of the cake with a thin crumb coat, then chill for 20 minutes. Apply a final layer of buttercream, smoothing with a spatula. Decorate as desired.

Tips

  • Use gel food coloring – liquid colors will thin the batter and produce less vibrant shades. Gel colors are concentrated and won’t alter the texture.
  • Bake in batches if you have only three pans – after baking the first batch, cool the pans, wash, and repeat. This ensures even baking and prevents over-browning.
  • Chill the cake before frosting – a chilled cake is less likely to crumb and makes the crumb coat easier to apply.
  • Substitute buttermilk – if you don’t have whole milk, mix 1 cup milk with 1 tablespoon lemon juice and let sit for 5 minutes. This adds a slight tang that complements the sweetness.

Serving Suggestions

Serve this rainbow cake at room temperature so the buttercream softens slightly. Pair it with a scoop of vanilla bean ice cream or a dollop of whipped cream. For a festive touch, sprinkle rainbow confetti or edible glitter on top. It’s perfect for birthday parties, baby showers, or any celebration where you want a colorful centerpiece.

Variations

  • Pastel rainbow – use pastel gel colors for a softer, more elegant look.
  • Chocolate rainbow – replace 1/4 cup of the flour with unsweetened cocoa powder for a chocolate base.
  • Lemon or almond – add 1 tablespoon of lemon zest or 1/2 teaspoon almond extract to the batter for extra flavor.
  • Cupcakes – divide the colored batter into cupcake liners and bake for 15–18 minutes. Frost each with matching colored buttercream.

Storage and Reheating

Store the frosted cake in an airtight container at room temperature for up to 2 days, or in the refrigerator for up to 5 days. Bring to room temperature before serving. Unfrosted cake layers can be wrapped tightly in plastic wrap and frozen for up to 3 months. To reheat, thaw overnight in the refrigerator and bring to room temperature. Do not microwave the whole cake, as the buttercream will melt; individual slices can be microwaved for 10 seconds if desired.

Frequently Asked Questions

Can I use a boxed cake mix?

Yes, you can use a white or vanilla boxed mix. Prepare the batter as directed, then divide and color it the same way. The baking time may vary slightly, so check for doneness with a toothpick.

Why did my cake layers come out uneven?

Uneven layers are usually caused by overfilling the pans or not leveling the batter. Use a kitchen scale to divide the batter evenly (about 1 cup per color) and smooth the tops with a spatula before baking.

Can I make this cake dairy-free?

Yes, substitute the butter with a plant-based butter alternative, use almond or oat milk, and use a dairy-free cream cheese or shortening-based frosting. The texture may be slightly different but still delicious.

How do I get vibrant colors without making the cake taste bitter?

Use gel food coloring, as it’s concentrated and doesn’t require large amounts. Start with a small amount (like a toothpick tip) and add more until you reach the desired shade. Overusing liquid colors can affect the taste and texture.

Can I make this cake ahead of time?

Absolutely. Bake the layers up to 2 days ahead, wrap them tightly, and store at room temperature or freeze. Frost the cake the day you plan to serve it for the best appearance.

Why is my cake dry?

Overbaking is the most common cause. Check the cake at 20 minutes and remove it as soon as a toothpick comes out clean. Also, ensure you’re measuring flour correctly – spoon it into the cup and level it off, rather than scooping directly.