Rainbow Cake Recipe

You would think I’ve made enough rainbow cakes, but I simply couldn’t resist sharing one more epic rainbow cake recipe with you.

I am a big fan of color, but hate all the dishes rainbow cakes make! Making six different colors of cake batter is such a pain.

To mix things up, this rainbow layer cake creates the rainbow using both the cake layers AND the frosting!!

Rainbow layer cake recipe made with 4 cake layers

The Colors Of The Rainbow (and more)

While I’m fully aware of ROYGBV, I went a little wild and threw a pink cake layer on top of this rainbow cake.

My vanilla layer cake recipe makes four, seven-inch layers, and I didnt want to waste any batter.

However, you could make three, eight-inch cake layers, and not have a fourth cake layer if you really want to stick to colors of the visual spectrum.

image of rainbow layer cake slice

It’s funny, because whenever I make a cake, I feel like I’m already bracing myself for negative comments from people. Not so much on here (all of you are wonderful!), but more so on the videos of this cake that I’ll share on Instagram and YouTube.

“There’s no pink in the rainbow!!” “UGH haven’t you heard of ROYGBV??” “How did you mess up the rainbow?!?”

It’s just a part of my thought process now, especially when I’m blogging or editing videos. But you know what? I like the pink layer in this cake!!! And the world is just going to have to deal with that.

image of rainbow buttercream cake recipe

How Do You Make Such Vibrant Cake Layers and Frosting?

I used gel food coloring to color both my cake layers and my frosting in this rainbow cake recipe.

Liquid food coloring can work too, but you won’t be able to get the same vibrant colors.

You also can throw off the consistency of the vanilla cake batter if you add too much liquid food coloring.

I highly recommend using gel food coloring. Gel food coloring is incredibly concentrated, so it allows you to use less. A couple drops will create beautiful, bright colors.

image of easy rainbow buttercream cake

Gel food coloring is also thicker, and won’t change the consistency of the cake batter. Americolor gel food coloring is my favorite brand, and I order bottles of it on amazon. I’m super particular, but most brand work pretty well.

In addition to recommending gel food coloring, I recommend getting gel food coloring that comes in a squirt bottle, rather than a small tub. It’s much easier to use, and a lot less messy.

I use large squirt bottles of gel food coloring, which are much better deal per oz. These bottles seem to last forever (even for me!), and I love not having to constantly order more tiny bottles.

However, I think I use gel food coloring more than the average home baker.

If you aren’t as into it or use it on a more one off basis but you can also purchase smaller squirt bottles online, which come in both 0.75 oz. and 4.5 oz bottles.

Collaboration With Jars By Dani

This rainbow cake was made as part of an amazing collaboration with my friend Dani! Her business is called Jars By Dani, and she creates amazing and delicious jars of cake.

We teamed up this April to make a special flavor together. After lots of brainstorming, we settled on this stunning rainbow cake design.

She ships nationwide, and if you feel like ordering one of our jars, you can check them out here.

rainbow layer cake with jar of cake

Share Your Creations With Me!

If you try this rainbow cake recipe, please tag me @chelsweets, and use the #chelsweets so that I can see your amazing creations!

Nothing makes me happier than when I get emails or DMs with photos of your amazing cakes, so please don’t hesitate to reach out to me with your triumphs, or questions <3

Yield: 24

Rainbow Cake Recipe

Rainbow layer cake recipe made with 4 cake layers

This vanilla cake recipe is made in one bowl, and is super moist! One batch makes 3, 8-inch cake layers, and is frosted with vanilla buttercream frosting.

Prep Time 15 minutes
Cook Time 35 minutes
Additional Time 1 hour
Total Time 1 hour 50 minutes


Rainbow Cake Layers

  • 3 cups all-purpose flour (390 grams)
  • 3 cups granulated sugar (600 grams)
  • 2 1/2 tsp baking powder (10 grams)
  • 1 tsp salt (6 grams)
  • 1 cup unsalted butter, room temperature (226 grams) - 2 sticks
  • 2 tsp. vanilla extract (8 grams)
  • 1 cup pasteurized egg whites from a carton (or about 7 egg whites) (235 grams)
  • 1 1/2 cups buttermilk, room temperature (345 grams)
  • 1/8 cup vegetable oil (28 grams)
  • Red, yellow, blue, and pink gel food coloring

Vanilla Buttercream Frosting

  • 3 cups unsalted butter, room temperature (678 grams)
  • 11 cups powdered sugar (1375 grams)
  • 1 tsp salt (6 grams)
  • 1/3 cup heavy cream (or whipping cream) (75 grams)
  • 1 1/2 Tbsp vanilla extract (18 grams)
  • Red, orange, yellow, green, blue, purple, and pink gel food coloring


Rainbow Cake Layers:

  1. Preheat oven to 350°F. Line four 7 inch pans pans with parchment rounds, and grease with a light spray of non-stick cooking spray.
  2. Mix together all dry ingredients (flour, baking powder, sugar, and salt) in a stand mixer with a paddle with a few gentle pulses.
  3. Mix chunks of room-temperature butter slowly into the dry mix, on a low speed. Continue to mix until no large chunks of butter remain, and the mixture becomes crumbly.
  4. Pour in egg whites, and mix on low until just incorporated. Mix in the buttermilk in two installments, on a low speed.
  5. Add in vanilla and oil, and mix at a low speed until fully incorporated. Scrape down the sides of the bowl with a spatula, then beat on low speed for about 15 seconds. 
  6. Divide the batter evenly between four bowls (about 450 grams of batter per bowl). Create red, yellow, blue and pink batter using a couple drops of gel food coloring. Mix by hand with a spatula until the batter is evenly colored.
  7. Pour each color into one of the prepared cake pans.
  8. Bake for 34-37 minutes, or until a toothpick comes out clean. Allow the pans to cool for 10 minutes, then run an offset spatula around perimeter of the pan to separate the cake from the pan.
  9. Place cake layers into the freezer for 45 minutes, to accelerate the cooling process. Once the layers are fully cooled, carefully flip the pans and remove the layers from the pans.
  10. Use a serrated knife to level the tops of the layers, and then frost as desired.

Vanilla Buttercream Frosting:

  1. While the cake layers bake and cool, make the vanilla buttercream frosting.
  2. Beat the butter on a medium speed for 30 seconds with a paddle attachment, until smooth. Slowly add in the powdered sugar, 1 cup at a time. Alternate with small splashes of cream.
  3. Once fully mixed, add in the vanilla and salt, and beat on low until the ingredients are fully incorporated, and the desired consistency is reached. 
  4. If the frosting is too thick, add in additional cream (1 teaspoon at a time). If the frosting is too thin, add in more powdered sugar (quarter of a cup at a time).
  5. To create the colorful the buttercream used to fill the cake, place 1 cup of frosting into three separate bowls. Color them orange, green, and purple with a couple drops of gel food coloring.
  6. Leave the rest of the buttercream white until the cake has been assembled.

To Assemble The Rainbow Cake:

  1. Stack and frost cake layers on a greaseproof cake board, using a dab of frosting to help stick the first cake layer to the board.
  2. Start with the red cake layer on the bottom. Top with a thick layer of orange buttercream. Leave about 1/4 of a cup of frosting in the bowl, to decorate the sides of the cake with later.
  3. Top with the yellow cake layer, then frost with the green buttercream, reserving a tiny bit of green buttercream.
  4. Next add the blue cake layer and top with some purple buttercream (leaving a bit for the decoration later).
  5. Top the cake with the pink cake layer, placing it upside down to make it easier to frost (with the caramelization from the bottom of the pan facing upward).
  6. Apply a thin coat of frosting around the the cake, to fully cover the cake layers. Smooth using a bench scraper, then chill the cake in the fridge (10 minutes) or freezer (5 minutes) until the frosting is firm to the touch.
  7. Add a second, thicker layer of frosting to the cake, and smooth using a bench scraper. Place the cake in the freezer to chill for 10-15 minutes, or in the fridge for 30 minutes.
  8. Place about 1 1/2 cups of white buttercream into a piping bag fit with an Ateco 869 frosting tip (a very large french tip)
  9. In four other small bowls, color about 1/2 cup of frosting to make red, yellow, blue, and pink buttercream.
  10. Using a small offset spatula, spread dabs of each color of frosting around the chilled cake. Feel free to overlap and have with the step!
  11. Top the cake with a boarder of white buttercream frosting, and then cut in and enjoy 🙂


One batch of cake batter makes about 1800 grams, so when I'm making a cake with four layer, I add 450 grams of batter into each pan.

Once the layers have fully cooled, I sometimes like to trim the caramelized bits from the sides of the layers using a serrated knife.

These cake layers can be made in advance!! Learn more about how far in advance they can be made, and how to properly wrap them in my post on how to make cake layers ahead of time.

Since this frosting will be used to decorated a cake, it is important to mix the buttercream on the lowest speed at the end of the process for a couple minutes, to get out any extra air that might have be incorporated during the mixing process.

You can also stir the frosting in a bowl with a rubber spatula, pushing it from side to side, to get rid of any air bubbles. This will make it easier to get super smooth sides on your cake!

Nutrition Information



Serving Size


Amount Per Serving Calories 660Total Fat 33gSaturated Fat 20gTrans Fat 0gUnsaturated Fat 11gCholesterol 86mgSodium 297mgCarbohydrates 89gFiber 1gSugar 76gProtein 4g

23 thoughts on “Rainbow Cake Recipe

  1. Hi,
    I made a cake similar to your rainbow cake for my nieces birthday Saturday.
    I was wondering if you put the cake in the fridg after you put frosting in between the layers and assemble it before you put the final coat of frosting on?
    I hope my cake comes out as nice as yours.

  2. I love your IG and that you are so brave and took the leap to follow your passion. I have noticed some cakes you use eggs, and some egg whites and buttermilk? What prompts that decision? Is it about moisture? the color consistency? I enjoy home baking, and I like to know the all the reasons! Thanks!!!!

    1. Thank you Angie!! For me, it comes down to the texture and color of the batter! In general I like egg whites with buttermilk best, but sometimes whole eggs make more sense, or I don’t want to use buttermilk because it can overpower more subtle flavors like matcha or rose water. It really comes down to preference though, and I try to make my recipes in a way that highlights the key flavor / star ingredient, and tastes best overall <3

  3. Hi what is the red colour actuslly called, I used it for my cake and it hasn’t turned out anywhere near as vibrant as yours appears. Thankyou

  4. What cake pans do you use? The lighter colored Fat Daddio’s or just any pan? I’m using dark heavy (i think they are cuisinart brand) pans and my cakes come out too dark on the sides and bottom. Help!!

    1. Hi Sara,

      I do use the lighter colored fat daddio’s pans (here’s the link to the exact ones I use: https://amzn.to/2U7QXzd). Dark pans can definitely impact the way your cake layers bake and caramelize!! I love the pans I use, and think they help my cake layers bake up evenly. You can also try using baking strips to help minimize the browning around the sides of you cake layers. I hope that helps, happy baking!

  5. Hi Chelsea,

    Thank you very much for your recipe. It’s very well written, and the metric equivalents are SO useful. I had tried another recipe for a rainbow cake and it was a disaster. After that I spent a lot of time looking for a recipe that inspired confidence, and I’m glad I found yours. Now we have a very happy little 8yo. Thank you again!

    1. Hi Trip,

      It depends on how thick you want the layers to be! It can be used to make four to six 6 inch layers. Hope that makes sense!! <3

  6. Hello! I intend to make this cake for my daughters birthday this weekend. Could I make it a day in advance? Would I need to keep it in the fridge overnight?
    All the best

    1. Hi Elena,

      You totally can! A frosted cake can stay good in the fridge for up to a week! As long as the frosting is completely covering the cake layers, it should lock in all the moisture, and the cake should stay nice and moist 🙂

      I let cakes sit in the fridge overnight, or for a few days all the time! I usually leave my cakes just open in the fridge without a covering! It should be fine as long as you don’t have anything fragrant in your fridge (like fish or onions).

  7. Hi Chelsea,

    I tried making your rainbow layer cake. Absolutely love this recipe and appreciate the detailed instructions My cake layers didn’t come out as fluffy as yours, do you think I just need to mix it for longer prior to baking?

    Also, I used the Americolor food coloring you recommended and my frosting doesn’t seem as vibrant as yours. Do you mix the colors at all to make it more vibrant?

    Thank you!!

    1. Hi Tania,

      Sometimes when people make colored batter like this, the batter gets overmixed as they mix in the food coloring, which can lead to dense cake layers. I’d actually suggest trying to mix the batter less! you can try adding a bit more food coloring next time to make the frosting brighter, or make the frosting a couple days in advance. As the frosting sits, the color intensifies. Hope that helps, happy baking!

  8. Would this work well with a whipped frosting? I am wanting to do 6″ smash cake size also. Don’t know how much I would need to cut down the recipe.

Let me know what you think!