No Thanks
Keep In Touch With

Sign up and we'll send inspiration straight to you.

Martha Stewart takes your privacy seriously. To learn more, please read our Privacy Policy.


Rainbow Cake

This colorful layer cake from "Whisk Kid" blogger Kaitlin Flannery is ideal for a child's birthday party, or any time you want to make a big impression.

  • Yield: Makes one 9-inch-round six-layer cake
Rainbow Cake

Source: The Martha Stewart Show, Episode 5128


  • Vegetable shortening
  • 3 cups all-purpose flour
  • 4 teaspoons baking powder
  • 1/2 teaspoon salt
  • 2 sticks (1 cup) unsalted butter, room temperature
  • 2 1/3 cups sugar
  • 5 large egg whites, room temperature
  • 2 teaspoons pure vanilla extract
  • 1 1/2 cups milk, room temperature
  • Red, orange, yellow, green, blue, and purple gel food coloring
  • Lemony Swiss Meringue Buttercream


  1. Preheat oven to 350 degrees. Brush six 9-inch-round cake pans (or as many 9-inch cake pans as you have, reusing them as necessary) with shortening. Line bottom of each cake pan with parchment paper; brush again and set aside.

  2. In a large bowl, whisk together flour, baking powder and salt; set aside. In the bowl of an electric mixer fitted with the paddle attachment, cream together butter and sugar. Slowly add egg whites and mix until well combined. Add vanilla and mix until fully incorporated. Add flour mixture and milk in two alternating additions, beginning with the flour and ending with the milk. Mix until well combined.

  3. Divide batter evenly between six medium bowls. Add enough of each color of food coloring to each bowl, whisking, until desired shade is reached. Transfer each color to an individual cake pan. Transfer to oven and bake until a cake tester inserted into the center of each cake comes out clean, about 15 minutes (working in batches if necessary).

  4. Remove cakes from oven and transfer to a wire rack; let cool for 10 minutes. Invert cakes onto a wire rack; re-invert and let cool completely.

  5. Using a serrated knife, trim tops of cakes to make level. Place four strips of parchment paper around perimeter of a serving plate or lazy Susan. Place the purple layer on the cake plate. Spread a scant 1 cup buttercream filling over the first layer with a small offset spatula so it extends just beyond edges. Repeat process with blue, green, yellow, and orange layers.

  6. Place the remaining red layer on top, bottom-side up. Gently sweep away any loose crumbs with a pastry brush. Using an offset spatula, cover the top and sides with a thin layer of frosting (also use any of the excess frosting visible between the layers). Refrigerate until set, about 30 minutes.

  7. Using an offset spatula, cover cake again with remaining frosting.

Reviews (90)

  • MsSugaree 20 Jan, 2014

    I made this for my friends birthday. It was a big hit, and everyone loved it. A bit time consuming, because I used two rounds pans. It was fairly easy to make.

  • Sarah_Malta 23 Apr, 2013

    was watching the rainbow cake vid and i just want to share something with you. All you need to do to know the sequence of the rainbow colours is remember this sentence: Richard Of York Gave Battle In Vain. You take the first letter of each word R stands for red, O stands for orange and so on :) and voila you have the colours of the rainbow in sequence!! :) hope my suggestion proves futile when someone tries out the cake

  • satsiri 13 Mar, 2013

    Awesome recipe. Works perfecty. Has become a new tradtion for celebrating St. Patrick's Day in my family!

  • Nur Hadhira Halim 17 Feb, 2013

    Ouhh my god! I love it!!! My No.#1 Cake :) #fingerlicking #loveit #loveumartha!!

  • Sarah Price 10 Feb, 2013

    I have made this twice now, my family loved it,the 1st I made the rainbow. The 2nd in honor of Valentine's day I made it just 2 layers in 2 shades of pink.. I bought salted butter oops,the buttercream came out very salty but I have had comments this is even better. Love this recipe!

  • Apallas 23 Sep, 2012

    Just wanted to say I made this same cake using gluten free boxed cake mix for my daughter's 4th birthday after having seen it on Pinterest. Came out perfect (as did the buttercream - I posted some buttercream tips on that page). The one thing I might do next time (which the Whisk Kid suggests on her video) is to actually weigh out the batter to ensure each layer is the same. Looked fine without doing that, but could have been even more 'perfect'. Cake was a MAJOR hit with kids and adults!

  • oldmadenew 9 Jul, 2012

    PART 2 OF 2: I also used natural food colors from Whole Foods, which give pretty pastel hues. I frosted it with Martha's Basic Buttercream, which I tripled since I was frosting cupcakes as well, and I am proud to say that I finally mastered the crumb coat thanks to the tip in the recipe about chilling it before finishing the frosting. The layers were thin, but keeping the parchment on until the last second made the handling SO MUCH EASIER! Everyone thought it was delicious!

  • oldmadenew 9 Jul, 2012

    PART 1 OF 2: I have been eyeing this cake on Pinterest for quite a while for my daughter's Rainbow Party for her 5th birthday. I was a bit nervous about it, but it was easier and quicker than I expected and it turned out perfectly! I changed a couple of things. I buttered the pan because I never have shortening around. To save space, I let my layers cool in the pans by an open window. I left the parchment on the layers and inverted them directly onto the cake as I built it.

  • LeslieGTrejo 22 Jun, 2012

    Hii, I'm making this cake for my friends birthday, and i have a question before I start...

    Does it matter what kind of milk I use?

    I was going to use skim/fat free ,
    but I don't know if that will affect the consistency?

  • Ina Hany 11 Jun, 2012

    love it

  • Peter Fitzgerald 2 Jun, 2012

    I was surprised that the exact measurement for each layer wasn't included in this recipe. I ended up using a little less than 1 1/2 cups per layer for a 5 (not 6) layer cake and the layers were thick enough to work with and frost evenly. 6 would have stretched this recipe too far. From top to bottom, it was red, orange, yellow, green and blue. White frosting between the layers and hot pink all over. My niece loves pink. This was a fun exercise in food colors!

  • SheHe 1 Jun, 2012

    I tried this recipe for Mother Day's and I have to ask if anyone thought the batter was not enough to make 6-layer cake? I used 8-inch pans because that was what I had. I did not have enough to make good thick layers for each one so I had uneven layers. I will double the batter next time. Any suggestions?
    Also my cake had a weird after taste around the edges so I'm thinking it's from the shortening. It kinda ruined it for me. I will use butter and flour next time.

  • Bricks 4 24 May, 2012

    May 21 year old heard about this on a trip to Europe that she just got back from. Made it for her sister's 16th birthday. OMG how excellent the colors came out. Tasted like a sugar cookie. Used Martha's Cream Cheese Frosting. Will definitely make again The girls are already trying to figure out all the fillings we could use.. It was a surprise to her and came out beautiful and delicious. Thanks Martha!!!

  • Mangowran 16 May, 2012

    I made this cake for a second birthday, it was a BIG hit, especially with the adults! To give this recipe a lemon zing, I added lemon butter as well between each layer!

  • Mangowran 16 May, 2012

    I made this cake for a second birthday, it was a BIG hit! To give it more of a lemon hit, I also added Lemon Butter between the layers. Fantastic!

  • mimiywan 22 Feb, 2012

    This cake does take time and a bit of patience but it is straightforward and easier than I expected. It turned out great for a play date we were attending. My almost 7 year old mixed the batter with different colors. I was so nervous about the Swiss Buttercream that I googled another site for tips. The recipe for the crumb coat made enough for the entire cake--we used a 7 inch cake. Our biggest challenge was mixing red and blue gel color to make purple. It is a winner!

  • cinnamonbear 12 Feb, 2012

    I made a post earlier on this recipe for all you people who are calling this icing recipe soupy. It takes patience to make this cake and you have to run the mixer quite a while, but it does thicken up and will be perfect with patience. Mine turned out exactly like it was supposed to. If you don't use real butter it probably won't as margarine is not always a good substitute. Mine was beautiful and everyone loved it.

  • hmarie88 14 Jan, 2012

    I had been wanting to make this cake for a while. So when I got a kitchenaid from my husband for Christmas I was very excited to make it. Well it did cost quite a lot to get all of the ingredients but I thought it would be worth it. I was going back an forth from reading the recipe to watching the video. Then I got to the icing and i didn't even make it far because the consistency was runny. I ended up finding icing in a jar and added some lemon extract ro it. It doesnt look too pretty.

  • cdrva 16 Dec, 2011

    I would not suggest making this cake. It takes an excessive amount of time and does not even taste edible. It actually resembles playdough... The icing is very soupy, thank god for betty crocker who came to the rescue where martha stewart failed. It does look very pretty though. It would be a good prop at a party for people who do not actually like to eat.

  • cdrva 16 Dec, 2011

    I would not suggest making this cake. It takes an excessive amount of time and does not even taste edible. It actually resembles playdough... The icing is soupy, betty crocker had to come to the rescue where martha stewart failed. It seems to be a waste of time and ingredients. It does look pretty, it would be a lovely prop at a party for people who don't like to eat.

  • KDrausin 8 Sep, 2011

    Here's what happened - pictures and all when I tried to make this beautiful cake.
    If I just would have cooked it a little longer, I'm sure it would have been delicious.

  • jescey 13 Aug, 2011

    Just made this cake and it was a hit! All my nieces and nephews loved it. I thought the taste of it was good- pretty classic white cake and a yummy frosting (not my favorite type of butter cream. But still good and easy to change for the next round) I bought a bunch of cheap pans from the dollar store so I had enough for each color.

    It wouldn't taste nearly as good, but if you're looking for an easy kids' bday cake the rainbow idea would work with a white cake mix and purchased frosting.

  • missjamie166 9 Aug, 2011

    AVOID THIS RECIPE!! I followed the instructions EXACTLY. The cake was horrible tasting when I tried the crumbs, it tasted very egg-y and unpleasant. I tried making the frosting, it never hardened. It was a soupy texture, even taking into account the last comment, about having to whip the eggwhites til they formed peaks, I did, it was still soup. I wasted $70 on ingredients, (19 eggwhites if you make the buttercream frosting too!!) and 4 hours because I had to bake the layers in shifts. NOT COOL.

  • JenOH 19 Jul, 2011

    I am so pleased to find this recipe! My daughter asked for a rainbow cake for her birthday and I was clueless. I'm going to give this a shot, but does anyone know exactly how many it might serve? Anyone ever tried a larger sheetcake version?

  • seaworthm 25 Apr, 2011

    Boy did this make a hit for Easter dinner!! I used Wilton gel colors and Gartner electric colors with a little mixing, the colors were perfect, the cake burned a little on the sides (have gas oven)so I just cut off the burned part. I followed the recipe for the crumb frosting and because I burned the first batch, make a powdered sugar frosting for the outside frosting, comments were they liked that frosting better. It is very rich, would like filing with less butter.

  • tcpokim 14 Mar, 2011

    BirthdayBaker - I've heard that the regular drops work well too, if they have an acid paired with them. Without the acid they aren't very vibrant. But they become vibrant if you use acid. Substitute some liquid for yogurt. Or add a tablespoon of vinegar to the milk (its ok if it curdles a little). That should help your colors still pop even if you use food coloring drops.

  • BubblyCakes 12 Mar, 2011

    Hi BirthdayBaker. You can use powder colour too. It works just as well

  • BirthdayBaker 7 Mar, 2011

    Hey guys, I'm really wanting to make this for my best friends 16ths but I'm struggling to find affordable food colouring gel. With me being in england the Gels aren't as popular but I'm looking online. But no packs seem to have all the colours I need or at a good price. Any website tips or advice?

  • kyrablack 19 Oct, 2010

    I made this for my daughter's 6th birthday. The kids loved seeing all the colors once I cut into the cake. It tasted amazing too! The cake was definitely labor intensive but easy to do. LOVE IT!

  • sandyakk 15 Sep, 2010

    I made this recipe for my 17th wedding anniversary, it was beautiful, but the cake tasted a little off. I didn't add the lemon flavoring to the frosting, and just made it vanilla. Is this why the cake tasted funny? Does anyone have any ideas? Thanks!

  • ErinChicago 8 Sep, 2010

    I made this cake as a surprise for the 1st day of school for my nieces Mia (4) and Madison (3). They thought it was just a white cake, but add magic sprinkles to the top of the cake (use the same color spinkles that are in the cake) and a few magic words and wow a priceless moment! Also it is a lot of work but so worth it! The cake turned out perfect.

  • Annalovestim 9 Aug, 2010

    I enjoyed making the rainbow cake and frosting. I only wish there was more flavor in white cake. If I make it again I will try adding a white filling instead of frosting in the middle of each layer. However, the beautiful colors and Swiss frosting made my daughters birthday special. Thank you for sharing Martha, I enjoy you show.

  • cinnamonbear 29 Jul, 2010

    To socialdgirl: The frosting takes a long time to incorporate. It was stressing me out too, but I just left it alone and just like magic it thickened. I was so surprised and pleased. You have to have patience, but it does come together.

  • Nanasseven 28 Jul, 2010

    I froze the cake layers singly on sheet pans. When frozen I stacked them with a sheet of wax paper inbetween layers and popped them back in the freezer after covering in plastic. I frosted them with the crumb and layer frosting while still frozen and thawed in the refridgerator. The next day I frosted with the final 'coat'. Turned out perfect and you could probably keep in freezer for weeks.

  • Nanasseven 28 Jul, 2010

    Very impressive when cut. I made it for a dinner party of 16 people and had enough left for two. The cake is moist and flavorful and the buttercream is divine. Maybe socialdgirl needed to beat the egg whites and sugar longer to make sure it was cooled to room temp before adding the butter. Also be sure to beat for at least five minutes on high, after incorporating the butter (add butter very slowly). Takes time, but well worth it!

  • margaretjackson 26 Jul, 2010

    This cake was delicious and great surprise for my brother's bday. The cake part was moist and buttery, however I was alittle grossed out by the amount of butter in the frosting, so I made 7 min. frosting. It was a fine recipe but too sweet for this cake. overall a keeper!

  • socialdgirl 19 Jul, 2010


  • amyk1971 2 Jul, 2010

    midios, you can find gel coloring @ walmart or michaels.
    I made this cake for the teachers @ my son's school

  • amyk1971 2 Jul, 2010

    midios, you can find gel coloring @ walmart or michaels.
    I made this cake for the teachers @ my son's school

  • midios 29 Jun, 2010

    Where can I find gel food coloring?

  • Yiannis 27 Jun, 2010

    What a GREAT cake for LGBT PRIDE month!!!

  • cinnamonbear 18 Jun, 2010

    Eupatron, I know this may sound crazy, but have you ever had Kool Aid icing? My family loves it and has for many years. Add a little of the little powder packet to the icing. It colors it as well as adds a llttle tart (not sour) to the sweet and it is so good. I haven't tried it with this recipe, but I've made my own with cream, margarine and powdered sugar. Not sure how it would do with butter, but my hubby put in his order for it the next time I try this cake. I'm gonna experiment with it.

  • eupatron 18 Jun, 2010

    The "Lemony Swiss Meringue Buttercream" is sweet in extreme... any suggestion, please

  • TiffanyMichaelia 17 Jun, 2010

    Does anyone see any issue with maybe just a plain white cake batter and the gel food colorings? I just think that using a *gasp* box cake mix would make this easier since it's mainly for aesthetics.

  • lostberrypicker 17 Jun, 2010


    4 sticks of butter equals 454 grams. I hope this helps

  • KsMartha 17 Jun, 2010

    19 egg whites - are you kidding? What do you do with all those yolks. I'll make this because it's cute, but use a different recipe.

  • Biancagabay 17 Jun, 2010

    how far in advance can this cake be made? assuming that it is kept in the refrigerator.

  • misc530 17 Jun, 2010

    Do you have to use GEL food coloring or will regular food coloring work ok? I may not have time to go to another store before I make it.

  • pajdes 17 Jun, 2010

    Saw this show on Foxtel yesterday then told my daughter about it. It is so bright and cheerful she is going to make this cake for her 8 year old son's birthday next month. I am pleased you have put the cup measurement in for the butter as we don't have what you call "sticks' of butter here in Australia, ours are all sold by the gram ie 250g, 500g etc.

  • CarlyCanadian 15 Jun, 2010

    I can't wait to try making this cake! Watched the show too...Although it looks time consuming I bet its worth it...thanks for the suggestions as I don't have a scale but will try 1 1/3cups as suggested. :)

  • JTeachtheWorldQ 14 Jun, 2010

    I am actually surprised that Martha didnt know about ROYGBIV either, but it does show that she is human after all lol :) Also, FYI on the show, each layer was 9.2oz

  • Ndls18 14 Jun, 2010

    lyddiebea: You have to divide the batter into equal portions. So if you want to have 6 layers, weigh the total amount of batter and then divide that by 6 to get the weight of each layer. I don't think everyone will get the exact same amount, so the weight per batch will vary.

  • lyddiebea 14 Jun, 2010

    Has anyone figured out what the weight of each layer is in ounces?

  • cinnamonbear 12 Jun, 2010

    The colors of the rainbow are easy to remember. ROY G. BIV red, orange, yellow, green, blue, indigo, violet. I'm a little surprised Martha did not know this. LOL

  • cinnamonbear 12 Jun, 2010

    I made this cake and my sister decorated it with a rainbow theme for a home school kindergarten graduation. It was real hit! The cake not difficult, but was somewhat time-consuming. I multiplied the recipe to 2 1/2 times to make a 1/2 sheet cake. It turned out beautiful and was so tasty. Well worth the effort. I would love to make this cake again sometime. Definately!

  • TGRAHAM31 11 Jun, 2010

    If I were going to transport this cake I would freeze it first.
    and then put it in the cake acrrier and transport it in a cooler.
    Cake doesn't take long to thaw and if kept cool for the ride I bet it should travel well.
    If you want extra assurance how about putting dowels in the cake like decorators do.

  • harrylr127 10 Jun, 2010

    The rainbow cake would be a great cake to a gay event with the rainbow colors. harrylr127

  • sherrishort 9 Jun, 2010

    I am planning to make this cake for an upcoming Birthday but I will have to transport it 4 hours in the car. I'm thinking I'll put it in a covered cake carrier in a cooler with ice packs to keep it cool. Any suggestions for transporting cake would be appreciated.

  • heirloomz 16 May, 2010

    I can't wait to make this cake. I am going to make it with 2 layers each of red, white and blue for the 4th of July!

  • wjkamm492 11 May, 2010

    I made this cake over the weekend. In answer to some of the questions, i used 1/8 tsp of the gel food coloring and it worked great. I didn't have a scale to weigh the batter, so I guessed at approx. 1 cup per pan, which came pretty close. The frosting takes patience, don't stop beating, it will come together. My three year old grandson was wowed with the colors. The Wilton gel colors are available in any store that has cake decorating supplies. i got mine at Hobby Lobby.

  • furnbelly 8 May, 2010

    I used white boxed cake and it worked great. Also I didn't have a way to weigh it so here is what I did. 2 boxes of cake mix. I made one box at a time in a large bowl. I had 3 bowls waiting. Divide the mix into 3 bowls about 1 1/3 cup each bowl. Add colorings to each. My oven can only fit 3 pans so then bake the first three. Repeat with second box. This makes a perfect 6 layers

  • pinoylover 4 May, 2010

    You would not believe it but this cake took my friend and I 6 1\2 hours to make. We had to run to the store at 10:30pm to get Lemon extract because we didn't relize we didn't have it and then the mess we made in the kitchen with batter on the walls and celing. (but it was all worth it when the WOW factor came in to play with the slice of the cake). Would do it again.

  • visuallythinking 4 May, 2010

    I can't wait to try this. I like tara's idea of making it pastel!

  • tarajbuckner 1 May, 2010

    I made the pastel version yesterday to include nine layers. Using a boxed white cake mix and adding to it gel food colorings to my liking. Very easy, fun and delicious!

  • svetav 30 Apr, 2010

    i hope they realize you can make orange by mixing yellow and red, purple by mixing red and blue, and green by mixing yellow and blue....

  • jefflouie 26 Apr, 2010

    I like this too.

  • anniequinn 26 Apr, 2010

    Marciajames: did you use liquid food coloring instead of the gel? StarCollector: I always put parchment paper at the bottom of my cake pans. the cakes always come out very cleanly and easily

  • IloveBeebees 25 Apr, 2010

    This cake is so fun and cute. It took a lot of work, but it was well worth it. It was very yummy and such a great idea. :)

  • Marciajames 25 Apr, 2010

    The cake was okay, but the filling and frosting turned out runny. I followed the recipe step by step. Does anyone have suggestions on making the frosting/filling stiff.

  • clene 23 Apr, 2010

    thank you martha for putting this great looking recipie online. I plan to turn it into my wedding cake. I am getting married in august so I will get back to let you know how it turned out Thanx Charlene

  • StarCollector 23 Apr, 2010

    This cake is not as easy as it looks to make. I had various problems getting the right hue in the cake batter, plus making 6 cakes takes time, it took me 2 days The cakes didn't want to come out of the pans, even though they were greased

  • iamme100 22 Apr, 2010

    What a great cake! Kaitlin seems like a nice girl, you should snap her up, Martha!

  • crakker_jakk 21 Apr, 2010

    The old "Roy G. Biv" acronym is helpful for school age children to remember the colors of the rainbow, but it's technically inaccurate as indigo is an intermediate color and NOT one of the 6 primary or secondary colors.. Essentially - Martha's guest yesterday was CORRECT with the 6 colors in her rainbow cake. Maybe Martha should take another look at the color wheel..

  • crakker_jakk 21 Apr, 2010

    The standard color wheel is based on three primary colors (red, yellow. and blue), three secondary colors (orange, green, and violet [sometimes described as purple]), and the six intermediates formed by mixing a primary with a secondary, known as tertiary colors. The line-up of the standard 6 color spectrum is always the same > red, orange, yellow, green, blue, and violet. The old "Roy G. Biv" acronym is helpful for school age children to remember the colors of the rainbow, but it's technicall

  • Karithina 21 Apr, 2010

    Absolutely fantastic recipe! I love rainbow food and this one looks both fun and delicious. I'll certainly be trying this next time I'm baking a cake~!

  • desktop 20 Apr, 2010

    Revise my previous comment. An easy way to remember rainbow colors is to remember the name - ROY G BiV . Each letter stands for a color.
    (FYI- most often a six color rainbow is depicted , leaving Indigo out of the lineup) Hope this helps, Martha! After all, rainbow color accuracy is of utmost importance, especially when even a cake can be a learning tool, too!

  • TBDZ 20 Apr, 2010

    We made Rainbow Cupcakes for St. Patty's Day - My daughter's graduation for the next grade is coming up and this is a cute Idea - A SURPRISE! cutting into the cake - and the Wilton food color is so vivid! Cute Cake~

  • desktop 20 Apr, 2010

    Very clever cake!! Love the idea of it.
    Martha asked 'what is the color order of a rainbow?'
    The order for a true rainbow is:
    Top - Bottom: Red;orange;yellow;green;blue;violet.
    The order for a "reverse rainbow" is:
    Top - Bottom: Violet;blue;green;yellow;orange;red.

  • gml1963 20 Apr, 2010

    according to the show today the food coloring is natural vegetable based I think

  • White_Dove 20 Apr, 2010

    hey beebs295 - most moms know to serve cake on special occasions

  • beebs295 20 Apr, 2010

    YuK! Many parents would not want their kids eating something with all those artificial colors!

  • bloombaby 20 Apr, 2010

    you can get the wilton's gel icing colors at Walmart or Michael's.

  • bloombaby 20 Apr, 2010

    you can get the wilton's gel icing colors at Walmart or Michael's.

  • bloombaby 20 Apr, 2010

    you can get the wilton's gel icing colors at Walmart or Michael's.

  • LoloMarie 20 Apr, 2010

    Can you use coconut oil instead of vegetable? Looks like a really fun cake for any event!

  • emma_019 20 Apr, 2010

    where do you buy the food coloring gel at

  • blakwdow3 20 Apr, 2010

    Don't use regular food coloring. The color will be lighter, but more than that, the fact that it is liquid will throw off the recipe. The thicker stuff is best. Order it online, or get it at a baking store. The NY Cake and Bake shop ships worldwide. They will have it. The batter was weighed at 9.2 oz in each bowl.

  • marinemom2020 20 Apr, 2010

    can you use regular food coloring

  • Kalona23 20 Apr, 2010

    On the show the batter was separated into six bowls. Each bowl was weighed to make sure the layers were equal.

  • DMBR 19 Apr, 2010

    Approximately how much batter in each pan?

Related Topics