Rainbow Cupcakes with Buttercream Frosting

from 10 votes

Vibrant, colorful cupcakes are topped with the most delicious whipped buttercream and showers of sprinkles. With a flavor reminiscent of sugar cookies, this recipe for Rainbow Cupcakes makes a treat worthy of any celebration that could use a little more brightness.

Rainbow Cupcakes with Buttercream Frosting and sprinkles on white plate.

Two words: rainbow cupcakes.

While the festive colors may have been what caught your eye, I guarantee it’s the sugar cookie-esque taste that will grab your taste buds’ attention. Cupcakes that taste like sugar cookies? Yes indeed!

These light, buttery, impossibly moist cupcakes star six layers of rainbow colors that bake up into a centerpiece-worthy treat perfect for birthdays, St. Patrick’s Day, and any other ordinary or extraordinary occasion in need of a little color and a whole lot of flavor.

Top off the treats with pillowy buttercream frosting or opt for tangy cream cheese frosting then complete your cupcake creations with a shower of rainbow sprinkles. And if you love these rainbow cupcakes and are looking for even more of a wow factor in a fraction of the time, don’t miss my quick-fix Rainbow Cake!

Key Ingredients

Here’s what you’ll need to make this classic yellow cake and the creamy frosting.

For the cupcakes you’ll need:

  • Flour: All-purpose flour is the foundation of the recipe, providing structure and texture. Learn my method for measuring flour accurately for perfect, consistent results.
  • Baking powder: Opened packages of baking powder will only keep their leavening powder for up to 6 months. If you’re worried your baking powder is too old, check to ensure it’s still active by stirring two teaspoons into a cup of boiling water. It should fizz and dissipate immediately. 
  • Butter: Two sticks of unsalted butter give this cake richness and flavor. Make sure that they’re softened so they mix smoothly into the rest of the batter ingredients.
  • Sugar: Granulated sugar is the main sweetener and gives the cake its signature sugar-cookie flavor.
  • Eggs: Eggs help bind the ingredients together and help with structure. Let them warm up to room temperature; they’ll incorporate into the batter better.
  • Vanilla extract: Use pure vanilla extract or even homemade vanilla extract, not the artificial kind, for the richest flavor and aroma.
  • Milk: Whole milk works better in this recipe than low-fat or skim versions; the fat is needed to keep the cake tender and moist.
  • Food coloring: You’ll need a rainbow’s worth of food colorings to make these colorful cupcakes. I prefer gel food coloring because just a little makes the most vibrant colors.
  • Rainbow sprinkles: All rainbow desserts can benefit from a generous shower of rainbow-colored sprinkles! 

For the buttercream frosting you’ll need:

  • Butter: Use two sticks of unsalted butter, which adds flavor, richness and creaminess to the frosting.
  • Vanilla extract: As with the cupcake batter, pure vanilla extract is the best way to go to flavor the frosting. 
  • Heavy cream: Use a couple of tablespoons to achieve the perfect fluffy, spreadable consistency for the frosting.
  • Powdered sugar: As with my recipe for sugar cookie icing, sifting the powdered sugar is a step that shouldn’t be skipped. Sifting aerates the powdered sugar and breaks up big clumps that will make your frosting look lumpy.

See the recipe card for full information on ingredients and quantities.

A rainbow cupcake cut in half to show its vibrant center of red, yellow, blue green and purple. More rainbow cupcakes topped with buttercream frosting and rainbow sprinkles are on another plate.

How to Make Rainbow Cupcakes

Rainbow-colored cupcakes may look like you’ve spent all day in the kitchen, but they’re actually not difficult to make.

  1. Preheat the oven. With the oven rack in the center position, preheat the oven to 350˚F. Line muffin tins with paper cupcake wrappers.
  2. Sift the dry ingredients. In a medium bowl, sift together the flour, baking powder and salt.
  3. Cream the butter and sugar. Using a stand mixer fitted with the paddle attachment, cream together the butter and sugar until it’s light and fluffy. Add the eggs one at a time, mixing well between each addition and scraping down the sides as needed. Add the vanilla and mix until combined.
  4. Add the flour and milk. With the stand mixer on low speed, alternate adding the flour in thirds and milk in halves, beginning and ending with the flour. Beat between each addition just until mixed.
Yellow cupcake batter is in the clear glass bowl of a stand mixer fitted with a paddle attachment.
  1. Tint the batter. Divide the batter evenly into six bowls and use food coloring to dye each with the red, orange, yellow, green, blue and purple food coloring. Keep in mind that the color will lighten a bit when baked.
Small bowls are filled with cupcake batter tinted every color of the rainbow. A spoon is in each bowl.
  1. Assemble the cupcakes. Using a different spoon for each batter, spoon a portion of the purple batter into each cupcake cake and top it with the remaining colors in rainbow order: blue, green, yellow, orange and red. Be careful not to mix any of the layers. You can also spoon each batter into resealable plastic bags and pipe the batter into the cups. 
Cupcake wrappers in a muffin tin are filled with red, orange and yellow batter. Nearby, plastic bags are filled with red, orange, yellow, green, blue and purple cupcakes batter, ready to pipe into the tin.
  1. Bake the cupcakes. Bake for 15 to 18 minutes until a toothpick inserted comes out clean. Remove the cupcakes from the oven and transfer them to a cooling rack to cool completely.
  2. Make the frosting. In the bowl of a stand mixer fitted with the paddle attachment, cream the butter until it’s light and fluffy. Add the vanilla extract and beat until combined. Add half the powdered sugar and beat, starting with the mixer on the lowest speed, until combined. Add the heavy cream and continue beating, then add the remaining powdered sugar and continue to beat until the frosting is thick and creamy. Add more powdered sugar or heavy cream to adjust the texture as needed. 

Kelly’s Note: Beating the frosting in between each addition of the powdered sugar lightens the color of the frosting and will make it more white in color (rather than yellow).

  1. Frost the cupcakes. When the cupcakes have cooled completely, pipe or spread the frosting onto them, top with rainbow sprinkles and serve.
Rainbow cupcakes sit on a baking rack. One is frosted with a dollop of buttercream frosting. In the background is a piping bag filled with frosting and fitted with a pastry tip.

Baking Tips

  • Use a standard-sized muffin tin. Muffin pans vary wildly in size so this recipe might make more or fewer cupcakes than the yield indicates, depending on the size of your pan. Larger cupcakes will also take longer to cook.
  • Don’t skip the sift! Sifting the dry ingredients helps combine the baking powder and salt into the flour and aerates the whole thing so it mixes smoothly into the creamed butter and sugar mixture. If you don’t have a sifter, use a fine mesh sieve and use a spatula to push the ingredients through the mesh.
  • Use a cookie scoop. A small cookie scoop can help portion the different colors of batter into the muffin tin. Fill it only part way so you’ll have enough of each color and use a damp paper towel to wipe it clean between colors. 

Here is some of the cooking equipment you’ll need to make these cupcakes:

  • Stand mixer: A stand mixer with a paddle attachment will do a great job at creaming the butter and sugar and mixing up the batter thoroughly and quickly. It also whips up the fluffiest frosting.
  • Sifter or fine mesh sieve: The flour, baking powder and salt need to be sifted together so they’re combined thoroughly and aerated. You can buy a flour sifter that has a fine mesh base and a crank or trigger that helps move the powdery ingredients through. But if you don’t have one, a fine mesh sieve set over a bowl works well.
  • Cookie scoop: The smallest size of cookie scoop is handy to portion batter into the individual cupcake wrappers. If you don’t have one, use two spoons.
  • Cupcake wrappers: Paper cupcake wrappers make it easy to remove the cupcakes from the pan without sticking, and also are convenient for serving. I use white cupcake wrappers, which turn mostly transparent as they bake to let the color of the vibrant cupcakes show through.
  • Muffin tins: I used a standard-sized cupcake baking tin to make these cupcakes. There isn’t an industry standard when it comes to cupcake tins, so keep in mind that your cupcakes might come out larger and smaller than mine and that larger cupcakes take longer to bake. Obviously, the number of cupcakes you end up with also depends on how big they are!
  • Baking rack: As with my carrot cupcake recipe, I recommend transferring the cupcakes to a wire baking rack when they come out of the oven. This stops the cooking and helps them cool quickly without getting gummy. 
  • Plastic bags: Resealable plastic bags (quart-sized or gallon-sized) are a handy substitute for piping bags (and they’re even better because they’re self-sealing!). Use them to pipe the layers of batter into the pan or to pipe pretty swirls of frosting onto the cupcakes. 

Frosting Techniques

Follow these tips for the prettiest frosted cupcakes.

  • Use a piping bag. To make professional-looking swirls of frosting, use a piping bag or learn how to transform parchment paper into a homemade piping bag! Refrigerate the frosting for 20 minutes to firm it up before scooping it into the piping bag. Cut the tip off a corner of the bag (the bigger the opening, the thicker the frosting will come out).
  • To make pretty swirls, start on the outside of the cupcake and move the piping bag inward in a spiral pattern until you reach the center. Then pull the bag away from the cupcake as you’re squeezing it to make a peak.
  • Experiment with patterns. Try using an open star-shaped piping tip to make swirls textured with a ridge pattern, or pipe the frosting in a zigzag pattern or in rosettes.
  • To frost without a piping bag, use an offset spatula. Pile a big dollop of frosting in the center of the cupcake and spread it in a circular motion, creating peaks and swirls. Try to always keep a layer of frosting between the spatula and the cake so you don’t pick up crumbs. 
  • If you want to really get carried away, try making some easy edible cupcake toppers. How cute would these look topped with a little shamrock for St. Patrick’s Day?

Storage Tips

Cupcakes will keep in an airtight container at room temperature, for three to four days.

Cupcakes can also be stored in the refrigerator, especially in the summer or if the kitchen is hot. 

The cupcakes can be frozen, unfrosted, for up to 3 months. Cool them completely before transferring to a gallon-sized resealable bag and freezing. Thaw the cupcakes completely before frosting. The frosting can also be made ahead and frozen in a resealable bag. Thaw it in the refrigerator overnight and mix it in the stand mixer fitted with the paddle attachment to make it creamy and spreadable. 

Frequently Asked Questions

Can I use liquid food coloring instead of gel?

You can definitely use liquid food coloring to make these cupcakes. Keep in mind you’ll probably need more of it than you would need gel food coloring to get the most vibrant color.

How do I prevent the colors from bleeding into each other while baking?

While filling the cupcake wrappers, work quickly and try to drop the dollops of different colored batter cleanly onto the previous layer. Don’t try to spread out the layers; they won’t make a perfectly layered rainbow. When you’re done filling the cupcake tins, put them immediately in the oven so the colors don’t have a chance to bleed into each other.

Can I use a different frosting?

Sure! When it comes to frosting for cupcakes, they’re pretty interchangeable and what works for one cupcake recipe may well work for another. This recipe is great with a cream cheese frosting like the frosting used on my banana cupcakes recipe. For a totally different look, try chocolate buttercream frosting, which looks so dramatic with the rainbow sprinkles and brightly colored cake. 

What do I do if my frosting is too thick or too thin?

You can adjust the consistency of frosting so it’s easy to work with when you’re decorating your cupcakes but will still hold its shape. If the frosting is too thick, beat in more whipping cream, a tablespoon at a time. If it’s too thin, beat in more powdered sugar, about ¼ cup at a time. If the frosting is too soft, put it in the refrigerator for 30 minutes or more. This will firm it up and make it easier to pipe. 

Rainbow cupcakes with white buttercream frosting and rainbow sprinkles are on white plates.

More Cupcake Recipes You’ll Love

Craving more? Subscribe to Just a Taste to get new recipes, meal plans and a newsletter delivered straight to your inbox! And stay in touch on Facebook, TikTok, Pinterest and Instagram for all of the latest updates.

Dessert

Rainbow Cupcakes with Buttercream Frosting

Two words: rainbow cupcakes. While the festive colors may have been what caught your eye, I guarantee it’s the sugar cookie-esque taste that will grab your taste buds’ attention. Cupcakes that taste like sugar cookies? Yes indeed!
Author: Kelly Senyei
4.80 from 10 votes
Rainbow Cupcakes with Buttercream Frosting and sprinkles on white plate
Prep Time 30 minutes
Cook Time 18 minutes
Total Time 48 minutes
Servings 18 cupcakes

Ingredients 

For the cupcakes:

  • 3 cups all-purpose flour
  • 2 1/2 teaspoons baking powder
  • 1/2 teaspoon salt
  • 1 cup (2 sticks) unsalted butter, softened
  • 1 3/4 cups sugar
  • 2 large eggs
  • 1 1/2 teaspoons vanilla extract
  • 1 1/2 cups whole milk
  • Food coloring (red, orange, yellow, green, blue and purple)
  • Rainbow sprinkles

For the frosting:

  • 1 cup (2 sticks) unsalted butter, softened
  • 2 teaspoons vanilla extract
  • 2 Tablespoons heavy cream
  • 3 cups powdered sugar, sifted
  • Equipment: Cupcake wrappers

Instructions 

Make the cupcakes:

  • Preheat the oven to 350°F. Line cupcake tins with wrappers.
  • In a medium bowl, sift together the flour, baking powder and salt.
  • In the bowl of a stand mixer fitted with the paddle attachment, cream together the butter and sugar until light and fluffy. Add the eggs, one at a time, mixing between each addition then add the vanilla and mix until combined.
  • Alternately add the flour mixture and milk to the stand mixer in three increments each, beginning and ending with the flour mixture and beating between each addition. Divide the batter into six bowls then dye each with the red, orange, yellow, green, blue and purple food coloring.
  • Spoon a portion of the purple batter into each cupcake cup, top it with the blue, then green, yellow, orange and red, careful not to mix any of the layers. (Alternately, transfer each color into sealable plastic bags and pipe the batter into the cups.) Bake the cupcakes for 15 to 18 minutes until a toothpick inserted comes out clean. Remove the cupcakes from the oven and transfer them to a rack to cool completely while you make the frosting.

Make the frosting:

  • In the bowl of a stand mixer fitted with the paddle attachment, cream the butter until it is light and fluffy. Add the vanilla extract and beat until combined then add half of the powdered sugar and continue beating until well combined.
  • Add the heavy cream and continue beating and then add the remaining powdered sugar and beat until the frosting is thick and creamy.
  • Once the cupcakes have cooled completely, pipe or spread the frosting onto them then top with rainbow sprinkles and serve.

Kelly’s Notes

  • Use a standard-sized muffin tin. If using a smaller sized muffin tin, bake the cupcakes for less time. If using a larger size, the cupcakes will likely take longer to bake.
  • Be sure to sift the dry ingredients, which helps combine the baking powder and salt into the flour and prevents lumps. If you don’t have a sifter, use a fine mesh sieve and use a spatula to push the ingredients through the mesh.
  • A small cookie scoop can help portion the different colors of batter into the muffin tin. Fill it only part way so you’ll have enough of each color and use a damp  paper towel to wipe it clean between colors. 
  • If the frosting is too thin, add additional sifted powdered sugar ¼ cup at a time, or if it’s too thick, add additional heavy cream 1 teaspoon at a time until the frosting reaches your desired consistency.
  • ★ Did you make this recipe? Don’t forget to give it a star rating below!

Nutrition

Calories: 562kcal, Carbohydrates: 72g, Protein: 4g, Fat: 28g, Saturated Fat: 17g, Cholesterol: 98mg, Sodium: 109mg, Potassium: 151mg, Sugar: 51g, Vitamin A: 920IU, Calcium: 77mg, Iron: 1.4mg

Shoutout

Did you try this recipe?

Share it with the world! Mention @justataste or tag #justatasterecipes!

This post may contain affiliate links.

Recipe by Kelly Senyei of Just a Taste. Please do not reprint this recipe without my permission. If you'd like to feature this recipe on your site, please rewrite the method of preparation and link to this post as the original source.


Feeling social?

Share this recipe!

Categories

Related Recipes

Check out more crave-worthy favorites

Kelly Senyei holding a copy of The Secret Ingredient Cookbook

love the recipes on just a taste?

Check out my cookbook!

Order your copy of The Secret Ingredient Cookbook featuring 125 brand-new family-friendly recipes with surprisingly tasty twists!

This post may contain affiliate links.

Join the Conversation

Rate and Comment

Your email address will not be published. Required fields are marked *

Recipe Rating




Comments

  1. 5 stars
    I made this recipe for my son’s 18th birthday. We used to make rainbow cupcakes when he was little using a box cake mix and store bought frosting. I wanted to do something special and nostalgic – These were amazing! So easy to make and yummy. They got 2 thumbs up from the birthday boy when we taste tested one.

    1. 3 stars
      These are a lovely idea and taste good but there may be an error in the serving size and/or cooking time. If you want normal size cupcakes (without a muffin-sized dome on top), this quantity easily would make 24 cupcakes (not 14). Because I tried to follow the recipe, I tried to fit all the batter into 14 liners (the batter would not physically fit and I had to do 15). Because the liners were now too full, the cupcakes took over 25 minutes to bake and came out looking like muffins. Still pretty and edible but not quite what was expected… Thanks anyway, they were fun to make!

    1. Hi Smita – I wouldn’t recommend it because the leaveners will lose their potency so the batter will get flat.

  2. 5 stars
    My granddaughters favorite color is rainbow…she had a blast helping make these today!! Easy and tasty!!

  3. They look delish. But I could have made 18. I thought it was too much batter for 14 cupcakes when I was filling tins. I have cooked for 18 min and still runny. Now have to keep checking at 3min intervals. (My oven is accurate for most baking/cooking I do) fingers crossed they work out. Albeit once iced no child will turn one away I’m sure.

    1. Hi Denise! Our recipes are written in the Imperial format, so feel free to use an online conversion program for metric. :)

  4. Hi Kelly, I’m so glad I stumbled on this recipe :) Trying to make 24 cupcakes by Friday. What color of liner/wrapper did you use to make the color stand out so boldly? I’m assuming white. Thanks for your input!

  5. The plastic baggie is a fantastic idea. My MIL used to decorate cakes and her frosting was incredibly light and fluffy. She used the Wilton buttercream recipe, but after mixing the frosting she whipped it on high in her Kitchenaid for 5 minutes. The frosting was airy like a marshmallow based frosting, but it still piped beautifully. I tried the technique with all butter buttercream, and it worked perfectly. The frosting isn’t overly sweet, and it also freezes well, although it’s not quite a fluffy when thawed. I love flavoring my frosting with vanilla and real almond extract that has bitter almond oil in it. It gives the frosting a wonderful flavor, but it doesn’t taste like almond. I also use salted butter in add a pinch of salt because I like how the slightly salty taste balances out the sugar. I love buttercream frosting, but it can be too sweet. Whipping it then adding almond makes it taste even better.

    Your baggie trick is similar to what I do for decorating. I use a ziplock bag and put the coupler on the inside of one corner then cut a small hole. It works just like a piping bag, and I already have ziplock bags in the kitchen. I did this once when I had run out of plastic piping bags, and I’ve never gone back. For storage I just put the filled bag inside another ziplock bag and refrigerate or freeze. Even smaller ziplock bags work. I like the zip top kind because they don’t pop open as easily as the others.

  6. 5 stars
    Hi Kelly made these cupcakes yesterday ,your recipe is a sure deal …Thank you so much .I am not going to cruise around the net for such recipe# sticking with this one .I even shared it with my friends here in Zimbabwe .

    1. Hi Diane – US cup! I hesitate to provide the amounts in grams for this recipe because I don’t use grams when I bake, and I’m concerned if I tried to convert everything just using an online converter, it wouldn’t be accurate.

  7. Please could you say in grams or ounces HOW MUCH IS A CUP. ???? I have made many cakes from recepies using an official set of CUP MEASURES and they do not always work out correctly. I would love to bake your rainbow cupcakes but not sure
    if my CUP MEASURES are correct

  8. Tried this for my niece’s birthday and she loved it! May i know if the recipe can be used as a cake instead of cupcake?

See More Comments