Rainbow Swirl Cake

This Rainbow Swirl Cake is made with three layers of homemade rainbow cake, then decorated with rainbow swirl frosting around the edges! It’s a moist, delicious cake that’s easy to make and perfect for a celebration, kids birthday party cake or even St. Patrick’s Day!

slice of rainbow swirl cake close up

This post is sponsored by Challenge Butter, but all opinions are my own.

Moist & Fluffy Rainbow Cake

I’ve had so much fun making and sharing some rainbow treats lately. Between this Rainbow Swirl Cake and these Mini Rainbow Cheesecakes, I’ve fallen in love with using all the colors in a cake. It can’t help but make you happy!

And this cake is fairly straight forward to make, though it takes a little time. The time is primarily from dividing the cake batter and frosting and then dying everything six different colors. Time consuming, but easy to put together, and so worth it in the end!

How to Make a Rainbow Layer Cake

To get started making this cake, you’ll make the vanilla cake batter. After combining your dry ingredients – all purpose flour, baking powder and salt – and setting those aside, you’ll cream your butter, oil and sugar together. This can be one of the most overlooked steps when making cakes. I know because back when I first started baking, I didn’t really get it myself. Then one day I saw the difference and it clicked!

Beat the butter, oil and sugar together until you notice a very clear difference in the texture and color of the mixture. It’ll lighten in color and become light and fluffy in texture. This step adds air to batter that helps it rise and makes it lighter.

frosted rainbow swirl cakerainbow swirl cake with slice cut out

Speaking of the importance of this step, you also want to use a great quality butter. As you may already know, I’m a big fan of Challenge Butter. It’s such a creamy butter made from the freshest milk and goes from farm to fridge in just two days. Plus, there aren’t any growth hormones, nor do they use any artificial preservatives, fillers or dyes. You know you’re getting a high quality butter when you get Challenge and it shows in it’s creamy texture.

Once things are creamed, add your eggs and vanilla extract. Finally, add your dry ingredients and buttermilk by alternating adding them to the batter. Be sure not to over mix the batter. It can over develop the gluten in the flour and you end up with a tough cake. No fun!

As for the milk in this cake, I use buttermilk. It really lends a more tender cake in this instance, so I 100% recommend it. I know it’s a pain to buy a whole container of buttermilk, so do what I do and buy powdered buttermilk. It’s brilliant! You add a little of the powder to your dry ingredients, then add water when it’s time to add the liquid. The powdered buttermilk stays good for months in the fridge, so you can use it in later recipes without having to waste anything.

Rainbow Swirl Technique

When it comes to the swirl, I spent a lot of time getting the batter for the swirl of this cake just right. You don’t want to use a batter that’s too thin or the colors will mix together, rather than staying separated. And even a batter that seems thick enough can sometimes end up with things not turning out quite right. This cake batter is great – the colors stay in place and bake up just right so that when you cut into your cake, you get a nice cross section of color.

slice of rainbow swirl cakeRainbow Swirl Cake batter

Once your batter is made, divide it evenly between 6 bowls. I used my scale to make sure everything was even, but if you don’t have a scale, it should be a little more than one cup per color.

As far as technique goes, there’s really no wrong way to do it. It’s all about the look you want. For the cake you see in the photos, I dropped spoonfuls of color at a time, shaking the pan from side-to-side between each color to help the batter spread out a bit and color more area. You end up layering the colors on top of each other a little more, giving more of a “swirled” appearance.

But you could also drop larger spoonfuls around, more like in the video below, and have them be a little more pronounced. Totally up to you. Given the nature of the cake, you could make it 10 times and it’d be a little different every time. Part of the fun!

Once the cakes bake, let them cool completely before frosting them.

Fully frosted rainbow swirl cakeRainbow Swirl Frosting - How to

Rainbow Cake Frosting

When it comes to frosting the cake, I really wanted to use white for the main color. It gives the colorful cake a bit of a “blank” background to stand out against. But of course you need to know what beauty is waiting for you inside so the rainbow piping is the perfect little hint.

To create the effect, you’ll need to add all the colors to your piping bag. To do this, grab some clear wrap and pipe a line of each color right next to each other. Roll it up and place it into a large piping bag. Pipe the frosting shells around the cake and after each shell, give the piping bag a slight turn. That little turn gives the little rotating look of the colors in the piping. One of my favorite parts of the cake!

The final Rainbow Swirl Cake is moist, delicious and so happy! It would make the perfect birthday cake, celebration cake or St. Patrick’s Day Cake! Make it your own and have fun!

 


Read transcript

Print
clock clock icon cutlery cutlery icon flag flag icon folder folder icon instagram instagram icon pinterest pinterest icon facebook facebook icon print print icon squares squares icon
slice of rainbow swirl cake
Recipe

Rainbow Swirl Cake

  • Author: Lindsay
  • Prep Time: 2 hours 30 minutes
  • Cook Time: 30 minutes
  • Total Time: 3 hours
  • Yield: 12-14 slices 1x
  • Category: Dessert
  • Method: Oven
  • Cuisine: American

Description

This Rainbow Swirl Cake is made with three layers of homemade cake with rainbow swirl frosting decorating the cake around the edges!


Scale

Ingredients

Vanilla Rainbow Cake

  • 3 cups (390g) all purpose flour
  • 3 tsp baking powder
  • 1 tsp salt
  • 3/4 cup (168g) unsalted Challenge butter, room temperature
  • 1/4 cup (60ml) vegetable oil
  • 2 cups (414g) sugar
  • 4 eggs
  • 1 tbsp vanilla extract
  • 1 1/3 cups (400ml) buttermilk*
  • Violet gel icing color
  • Royal Blue gel icing color
  • Leaf Green gel icing color
  • Lemon Yellow gel icing color
  • Orange gel icing color
  • Red gel icing color

Vanilla Rainbow Buttercream

  • 2 cups (448g) salted Challenge butter, room temperature
  • 1 cup (189g) shortening
  • 1112 cups (1265g-1380g) powdered sugar
  • 1 tbsp vanilla extract
  • 45 tbsp (60-75ml) water or milk
  • Violet gel icing color
  • Royal Blue gel icing color
  • Leaf Green gel icing color
  • Lemon Yellow gel icing color
  • Orange gel icing color
  • Red gel icing color

Instructions

Make the Cake Layers

  1. Prepare three 8 inch cake pans with parchment paper circles in the bottom and grease the sides. Preheat oven to 350°F (176°C).
  2. Combine the flour, baking powder and salt in a medium sized bowl and set aside.
  3. Add the butter, vegetable oil and sugar to a large mixer bowl and beat together until light in color and fluffy, about 3-4 minutes. Do not skimp on the creaming time. You should be able to see the change in the color and texture of the mixture.
  4. Add the eggs two at a time, mixing until well combined after each. Add the vanilla extract with the second round of eggs. Scrape down the sides and bottom of the bowl as needed to be sure all ingredients are well incorporated.
  5. Add half of the dry ingredients to the batter and mix until combined.
  6. Add the buttermilk and mix until well combined.
  7. Add the remaining dry ingredients and mix until well combined and smooth. Scrape down the sides of the bowl as needed to be sure all ingredients are well incorporated. Do not over mix the batter.
  8. Divide the batter evenly between 6 bowls. It should be a little more than a cup per bowl.
  9. Add gel icing color to the bowls (one color per bowl) and gently fold until the color is mixed throughout. You should have one bowl each of purple, blue, green, yellow, orange and red.
  10. Add the colored cake batter to the cake pans. Starting with the purple batter, add spoonfuls of batter around the bottom of the pan. Divide each color evenly between the three pans. Give the pan a little side-to-side shake to distribute the batter around a bit between each color. After the purple, add the blue, then green, then yellow, then orange and finally red.
  11. Bake for 28-33 minutes, or until a toothpick inserted comes out clean.
  12. Remove the cakes from the oven and allow to cool for about 2-3 minutes, then remove to cooling racks to cool completely.

Make the Frosting

  1. To make the frosting, add the butter and shortening to a large mixer bowl and beat until smooth.
  2. Add about half of the powdered sugar and mix until well combined and smooth.
  3. Add the vanilla extract and 2 tablespoons of water or milk and mix until well combined.
  4. Add the remaining powdered sugar and mix until well combined and smooth.
  5. Add additional water or milk as needed to get the right consistency.

Assemble the Cake

  1. To put the cake together, first remove the domes from the top of the cakes so they are level.
  2. Place the first layer of cake on a cake plate or cardboard cake circle, then top it with about 1 cup of frosting and spread into an even layer.
  3. Add the second layer of cake another layer of frosting.
  4. Add the final layer of cake on top, the frost the outside of the cake. Feel free to use my tutorial for frosting a smooth cake, if you like.
  5. Divide the remaining frosting between 6 bowls. I had about 1/3 cup of frosting per bowl, but you may have a little more or less, depending on how much you use to frost the cake.
  6. Use the gel icing colors to color each bowl of frosting, using one color per bowl.
  7. To make the rainbow swirl frosting border, add each color of frosting to a ziplock bag. Lay a piece of clear wrap out on the table. Trim the corner off of each ziplock bag. Pipe a thick row of each color of frosting in this order – purple, blue, green, yellow, orange, red – side-by-side onto the clear wrap.
  8. Fold the clear wrap over into a long log (see photos above for guidance). Twist one end closed and trim the other end, if needed, so that the frosting is right at the end.
  9. Put the log into a piping bag with the open end of the log going into the piping tip. I used piping tip Ateco 849.
  10. Begin piping shells of frosting around the top edge of the cake. After each shell is piped, turn the piping bag just a little bit before piping the next shell. As you continue piping and turning the piping bag, you’ll get a rainbow that rotates around so you see all the colors.
  11. To pipe shells around the bottom of the cake, create another log of rainbow frosting, add it to the piping bag and pipe shells around the bottom in the cake manner – turning the bag slightly after each shell.
  12. Store cake in an airtight container until ready to serve. Cake is best for 2-3 days.

Notes

* I recommend powdered buttermilk, so you don’t have to waste any leftovers.

Keywords: rainbow swirl cake, rainbow cake, rainbow birthday cake

Enjoy!



Rainbow swirl cake collage

This post may contain affiliate sales links. Please read my disclosure policy.

Share a Comment

Have a question? Use the form below to submit your question or comment. I love hearing from you and seeing what you made!

Recipe rating

77 Comments
  1. Sara

    My daughter requested a rainbow cake for her 12th birthday. I dreaded baking 6 layers in different colors so I showed her your picture, and she preferred your swirl cake. We call it rainbow camo cake. LOL! The cake is moist and delicious. American buttercream isn’t my favorite, but the very vanilla flavor is good. Your directions were well written, and my cake turned out just like the picture. Your trick of making the sausage roll for the rainbow frosting works great! Thank you for a great recipe and instructions!

  2. Areen

    Suggest me replacement for the buttermilk please???
    Do i need to add all the sugar amount to the frosting as I don’t need it to be very sweet

    1. Lindsay

      You can use regular milk, but the buttermilk does make the cake a little more tender. As for the sugar in the frosting, it’s there to add volume to the frosting as well. You can reduce it, but you won’t have as much frosting. That may be ok for you, but just want you to be aware.

  3. Emily

    Hi, I’m going to make these but some of your measurements in grams aren’t accurate. 1 cup of flour is 120 grams and you have 3 cups as 390 grams. Should I use your measurements or the accurate ones? 

    1. Lindsay

      The weight measurements used vary everywhere unfortunately. The ones I use are not wrong, but they may differ from another source. I’d suggest using mine for my recipes, since I use those.

  4. Rebecca

    Lindsay this recipe saved the day for my daughters 9th birthday! The bakery we ordered her cake from had to cancel our order last minute. Totally out of their control but left us in a bind the morning of her birthday. This rainbow marble look is what my daughter requested for her birthday and I was going to try my best. This recipe was so easy to follow and it turned out amazing! Every kid said it tasted like donuts! They loved it! It’s definitely the best homemade cake I’ve ever had. Wish I could post a picture for you to see. Thank you so much for posting this! 

  5. Sahar

    Hi, can I use 5 egg whites instead of 4 whole eggs,if yes should l add them after creaming butter,oil and sugar or should l wisk them to softpeak and them fold it at the end?(do the colors stay nice like yours in this case or they will mix if l use only egg whites?)and why don’t you use baking soda to activate the buttermilk?isn’t it necessary?thx alot

    1. Lindsay

      Egg whites and egg yolks do not act the same in cakes. I don’t believe you’d get good results with that substitution.

  6. Zahra Ansari

    Hi just did this recipe. I’m European so I thought sugar content was high for a cake that size. So I reduced by 50 g. Not much but the cake is sweet enough even with less sugar.
    I have not yet cut in the middle but removed the dome and color are lovely and tried the top dome and it is so yummy.
    Can’t wait to decorate it and see my daughters face for her birthday cake.
    I used pins colada flavour and passion fruit flavour as I did not have vanilla.
    And replaced the buttermilk by keffir.

  7. Maria

    I made this cake for my boys birthday yesterday it’s the first birthday cake I have ever made I usually just get some one to make one for me. I have to say it was so good easy to follow recipe and it came out perfect thank you so
    Much

  8. Kerry McMahon

    Can you use water instead of buttermilk for the cake batter? My mom is lactose intolerant but I would love to make your cake for my daughter’s 5th birthday – just trying to accommodate my mom! Thanks!

    1. Lindsay

      I’m really not sure how that would turn out without trying it. I’m sure it would bake, but it may affect the texture of the cake a bit since you will lose the fat from the milk.

  9. Emmy

    I made this for my son’s TMNT party, but with cream cheese frosting and got so many compliments. I used the Betty Crocker hel colors and a few drops of neon purple liquid food coloring for purple. The colors weren’t as saturated, but lighter and more neon, which I actually prefer. Because I have cheap dollar store pans, I actually ended up with thinner layers and a 4 layer cake. I love the technique because I’ve never gotten swirl cakes to actually swirl.

    1. Rebecca

      Emmy I used the Betty Crocker gels too and I was surprised how well they worked! Really is a great recipe. 

    1. Lindsay

      I haven’t made this cake in that size pan, so I’m not sure. I think you could probably just do one to get a fairly thin sheet cake layer. So I guess it depends also on how thick you want the cake or how many layers.

    1. Lindsay

      I haven’t tried this as cupcakes, but you should be able to follow the same procedure. Just drop spoonfuls of the colored batter into cupcake liners and reduce the baking time to between 15 and 17 minutes.

  10. Martha

    My daughter’s 2nd grade bucket list includes “learning to make a cake”, so we came across this recipe and decided to make it.  Ours isn’t quite as vibrant as yours, and parts of the swirled icing look like “unicorn poop” according to my daughter, but it was a blast to make and a great way to spend the afternoon together.  Thanks for the fun recipe!!

  11. Vanessa

    An amazing cake which I managed to copy today. Could you advise how to adjust the ingredients in order to make it with less sugar? It was delicious but too sweet for some of my taste testers! Many thanks.

    1. Lindsay

      I don’t have any specific advice on reducing the sugar. I didn’t try it with less sugar but you certainly can. Just keep in mind that sugar not only adds sweetness but also moisture so reducing it too much may affect the texture of the cake.

      1. Jean

        I made this cake and substituted gluten free Cup 4 Cup flour. Disappointing results. It looked good in the pans while baking but turned out gummy instead of yummy. 

  12. Natalie

    I made this for a birthday party last month and it was a huge hit. I have another birthday party that requested this cake minus the rainbow coloring. Have you ever adding chocolate chips to it or a filling? What do you recommend? 

    1. Lindsay

      If making this just as a vanilla cake, I’d probably use my Moist Vanilla Cake, which is what I altered to get this cake. That said, if you want to add chocolate chips to the batter, I’d try it with this cake, as I don’t think they’d stay in place in the other one. I haven’t tried it though to say for sure.

  13. Samuelle Eeckhoutte

    Hi,
    Made your cake for my daughter’s 17th birthday today. It was yummy. The cakes didn’t rise as much as yours, not sure why. I used my Kitchen Aid to mix, maybe overmixed the dough. Wish I could post a picture but thank you for the recipe. Will have to try again another time. What would you use instead of the shortening?

  14. Sarah Lathwell

    Hi Lindsay,
    Do you specifically need gel food colourings to make this cake? I have liquid colouring (I’m not much of a baker though my soon to be 3 year old really wants a rainbow cake for her birthday and we’ve done a rainbow layer cake before so wanted to do something different to surprise her and love the look of this cake)
    I’m in Australia so wouldn’t even know where to buy gel food colouring (I did do a quick google though can only find red and black gel colourings locally) so just seeing if liquid would work too.
    Big thanks, Sarah

    1. Lindsay

      The trouble with liquid is that you have to use quite a bit of it to get the same richness of color. It ends up affecting the cake because you’re adding so much more liquid, particularly with this number of colors.

  15. Cirila

    I made your cake and icing using pastel food coloring for my granddaughter’s 4th birthday. She wanted pink a unicorn themed cake. WOW! The cake was easy to make, as was the icing. Not only was it easy to make, but easy to work with as well. It turned out perfect , moist and not delicate to handle. The taste and texture were exceptional. The icing complemented the cake perfectly. It too was easy to work with. I have been looking for a great vanilla cake recipe and this is it. I look forward to making this again and again!! The cake was beautiful and delicious, everyone was surprised to discover the beautiful colors inside when we cut into the pink icing. I made an eight inch three layer cake and stacked it atop a 10 inch 2 layer cake. That way guests took some home and we had plenty to freeze and enjoy later! Thank so very much for this wonderful recipe.

  16. Amber

    I made this cake for my friend Emilys 30th birthday! Years ago when we were kids she made a cake for her birthday and she asked me to carry it. I ended up dropping it and only half of it was edible. Every year I apologize for dropping her cake so this year I decided to bake one for her. I settled on the rainbow cake, I always wanted to try making it. She was so shocked she said it tasted amazing. I will be making the cake again on July 5th for my sisters birthday! We usually get her an ice cream cake but this year I decided on baking one for her. This will be my go to recipe for fun cakes or cupcakes! Thank you for this amazing recipe!

  17. Rachel

    So beautiful and so delicious!  Made this for my daughter’s fifth birthday party and it was loved by kids and parents alike. My only complaint is there was ZERO leftover!!  Thanks so much. By the way don’t be intimidated it’s quite easy really and is like opening a present when you FINALLY cut inside to see how it turned out!

  18. Natasha

    Made it! Wish I could attach a picture. It came out wonderfully. The colors were so vibrant! Will definitely make again! Ty!

  19. Annie mussetter

    Hi Lindsay,
    This cake is gorgeous! I decided to make cupcakes and a small 6in cake for my nieces 1st birthday. Everyone loved them, the taste as well as the colors. My niece also enjoyed smooshing it all over!????
    Happy Birthday to your little guys. It’s amazing how quick they grow. I’m expecting twin grandbabies in May. I’m so excited, we get a boy and a girl, Selena and Sampson. They can’t get here quick enough!????
    Thanks again for another amazing recipe!????

  20. Char

    My granddaughter also saw this cake and wanted it for her fourth birthday celebration at her Preschool.  I made the recipe in cupcake form (a little more work to say the least).

    When I arrived to pick her from school in the afternoon, her teacher came over and excitedly told me that the children were thrilled with the colors.  She went on to say that the cupcakes were the best the class had ever eaten.

    This is quite a testament to your talents, Lindsay.  Thank you for sharing!

  21. Char

    Hello Lindsay,

    Your little boys are just too cute!  Enjoy every minute as they grow up too fast.

    When my four year old granddaughter saw this cake, we had to make it for her birthday.  I opted for cupcakes (yes – more work).  It made exactly 24 which was the amount needed for her Preschool class.  When I picked her up from school, her teacher ran over to me and said the cupcakes were “the best we’ve ever had in class.”  She said the children loved the colors and spent a great deal of time discussing the cake.  My granddaughter was so proud to tell her class that she was a helper.  

    Thank you for sharing your multitude of yummy talents.  They were a hit!

  22. Gemma

    Hi Lindsay!!! That cake looks AMAZING – how much food dye did you use for each colour?? I would love to replicate it…

    1. Lindsay

      Gosh, it’s so hard to measure. Especially with the Wilton gel. I’d guess it was a little more than 1/8 tsp for each. Maybe a little more for the red, since you tend to need more coloring with red.

    2. Kate

      Why it’s there an asterisk by the buttercream? And the video says milk, rather than buttercream. Thanks for the clarification!

      1. Lindsay

        The asterisk indicates that there’s a note about it at the bottom of the recipe card. Thanks!

  23. Suzy-q

    Oh, Lindsay, my granddaughter saw this cake and said we have to make it right away! We watched
    the video and ohh and ahh over the pretty cake. Well, I guess Sophia and I will be making this cake
    for her unicorn party. Thanks! By the way, I came across Bailey’s Strawberry Cream at the grocery
    store and thought it might inspire a new creation!!! Hint, Hint.

    1. Lindsay

      Awesome! 🙂 I hope she enjoys it!

      The Baileys Strawberry Cream sounds delicious! I’ve seen it and never tried it. Guess I might need to. 🙂

    1. Mickie

      Can’t wait to make this for my daughter’s birthday too.  Is the buttercream the crusting American buttercream you mention in your tutorial for frosting a smooth cake?  

      1. Bridget

        We made this cake for my daughter’s first birthday this weekend. It turned out amazing! Thank you so much for posting this. It was exactly what I wanted to do. Although we did it teared instead of one whole cake. I’d share a picture, but it won’t let me. It was beautiful though and everyone talked about it. 😊

      2. Ann

        My cooled cake layers cracked when I remove them from the pans. I’m wondering why because it’s never happened before. Also I was wondering why you use 2 cups butter to 1 cup shortening in this frosting recipe? In your “how to frost a smooth cake” recipe you use a one to one ratio. Is it just a matter of personal taste preference?

      3. Lindsay

        Hard to say why they cracked. I didn’t have that happen and haven’t heard of it being an issue. You could try letting the layers cool in the pans for a few more minutes so they are a little firmer before removing them. And yes, it’s really just a preference. I’ve gotten more and more so that I tend to like a little more butter. You could do it either way though.

    2. Paul

      Hello, sorry to respond and someone else is comment, but I couldn’t seem to respond to the recipe in general, probably because I’m not a member of the site.

      Anyway, this recipe looks absolutely amazing I found it by accident but I intend to use it anyway LOL. But I have a few questions, and I’m a fairly new at baking, so please bear with me. I prefer 9 inch pans to 8 inch, do I just need to increase the amount of batter I’m creating? Also another important question, is the height of the pans you use. The pans I have are a little on the shallow side compared to yours. Is that going to be a problem? I would honestly prefer not to go out and have to buy new pants that are higher if I can avoid that.

      As for cake/batter height, height, should I only go one spoon each section  in terms of the height? At least it looked like you only did one layer of colorful spoonfuls in the batter. I assume you’re going for less height per cake because you’re using three cake layers instead of two? 

      Finally, one more question. I have a really nice KitchenAid stand mixer. Is there a reason I shouldn’t use that, and should instead use one of those small portable mixer’s that you use in the video?

      This really does absolutely look amazing and I intend to make it!

      1. Lindsay

        You can use 9 inch pans but if you use the same amount of batter, your cake will be shorter overall. You could increase the amount of batter, but it’s hard to say exactly how much would yield enough batter without being too much. Also keep in mind that thicker cake layers end up a little more dense, which is part of the reason I use 3 instead of 2.

        As for how many spoonfuls, I just divided the batter between the three pans evenly. I actually weighed the batter and divided it.

        And your stand mixer should be perfect. That’s what I use.

        I hope you enjoy it!

    1. Blossom

      Hi Lindsay, thanks for the lovely recipe … I baked the cake and the taste was awesome.. however my cake was a bit crumbly …. would u have any idea why.
      I followed d recipe as mentioned only that I used 2 pans instead of 3 and baked the cakes at 175 degress for 45 mins each…
      Thanks Blossom

      1. Lindsay

        I’m not sure I know exactly what you mean by crumbly. I’m guessing you bake in Celsius? Were the cakes a little bit dry and that is why they were crumbly? It’s possible they were over baked a little bit.

    2. Martha

      Hi there, my cake didn’t rise ?? Did I mix it to much when folding in the food coloring? It looks so pretty, just wish each cake was taller.

Lindsay
About Lindsay

I'm a wife and mom to twin boys, a baby girl and a sweet black lab with a serious sweets addiction! Bring on the sugar!

Scripture I’m Loving

“Be joyful in hope, patient in affliction, faithful in prayer.” Romans 12:12