clock clock iconcutlery cutlery iconflag flag iconfolder folder iconinstagram instagram iconpinterest pinterest iconfacebook facebook iconprint print iconsquares squares iconheart heart iconheart solid heart solid icon
Overhead view of rainbow frosted cupcakes

Rainbow Cupcakes

5 Stars 4 Stars 3 Stars 2 Stars 1 Star 5 from 1 review
  • Author: Julianne Dell
  • Prep Time: 60 minutes
  • Cook Time: 15 minutes
  • Total Time: 1 hour 15 minutes
  • Yield: 24 cupcakes
  • Category: Dessert
  • Method: Baking
  • Cuisine: American


These Rainbow Cupcakes are bright, colorful, and certain to brighten anyone’s day! With a yellow cupcake base and rainbow buttercream frosting, these cupcakes are made entirely from scratch!


For the cake:

  •  1 ½ cups (285g) granulated sugar
  •  ½ cup (118 ml) vegetable oil
  • 2 tablespoons (28g) unsalted butter, melted
  • 2 large eggs
  • 2 egg yolks
  • 1 tablespoon (15ml) pure vanilla extract
  •  1/2 cup (118ml) sour cream
  •  2 ½ cups (350g) all-purpose flour
  •  2 teaspoons (7.5g) baking powder
  • 1 teaspoon (4g) baking soda
  • 1 teaspoon (5g) salt
  •  1 1/3 cup (315ml) buttermilk or milk
  •  Gel color for dying batter (see recipe notes)

For the Frosting

  • 2 cups (452 g) unsalted butter, cold.
  •  7 cups (911 g) powdered sugar
  •  1 tablespoon (15 ml) pure vanilla extract
  •  2-3 tablespoons (30ml) heavy whipping cream (or milk)
  •  Pinch of salt (optional)
  •  Gel colors for dying frosting (see recipe notes)
  •  Gold glitter stars


For the cupcakes:

  1.  Preheat the oven to 350°F. Line a cupcake pan with cupcake liners.
  2.  In a large mixing bowl, combine the sugar, vegetable oil, butter, eggs and egg yolks and vanilla extract. Beat on medium speed until the eggs and oil are well incorporated and the batter is lighter in color, about 2 minutes. Scrape down the bowl as needed. Next mix in the sour cream and beat until well combined.
  3.  In a separate bowl, combine the remaining dry ingredients. Alternate adding half the dry ingredients and half the buttermilk at a time and mix just until the flour starts to incorporate. Then add remaining dry ingredients and buttermilk and beat until well combined. Use a spatula to scrape down the sides of the bowl and stir the batter from the bottom to the top to ensure it’s well mixed.
  4. Divide the batter into 6 bowls, about ¾ cups of batter per bowl. Dye each one with just a drop of gel color and mix to combine.
  5. Drop about 2 teaspoons of batter per color in each liner. It should be filled about 2/3 full. Bake at 350°F for 14-16 minutes. Test the cupcakes for doneness by inserting a toothpick into the center of the cupcake. If the toothpick comes out clean, the cupcakes are done. Cool Completely.

For the frosting

  1. Cut butter into pieces. Using the paddle attachment, whip the butter for 5-7 minutes, scraping down the bowl occasionally. Beat until the butter looks light in color.
  2. Alternate adding 2 cups of powdered sugar at a time with the liquid ingredients: vanilla extract & heavy cream. Ensure the powdered sugar is well combined, then and whip for 1-2 minutes before adding more powdered sugar. Repeat until all ingredients are added.
  3. Once all the powdered sugar has been added, increase speed to medium-high and beat for another 3-5 minutes to whip additional air into the frosting.
  4. Set aside 1 cup of undyed frosting. Then divide the remaining frosting into 6 bowls, about ½ cup each. Dye each of the 6 colors and then place each color into its own piping bag.
  5. Lay out a piece of plastic wrap, pipe a thick row of each color of frosting side-by-side onto the clear wrap. Fold the plastic wrap up and tightly roll, twist one end and cut the tip off. Drop the plastic wrap into a piping bag fitted with an Ateco 6B (or any French Star Tip).
  6. Fill a smaller piping bag fitted with a size 12 or another large open round tip and fill with the white frosting.

To Decorate

  1.  With the rainbow frosting, pipe a circle starting from the outside edge and work your way into the middle. Dot the top of the frosting with 4-5 dots of white frosting. Garnish with gold stars.


Colors used: You can use Chefmaster, Americolor or Wilton gel colors. Wilton has less color options and it’s more difficult to achieve the purple or teal color. But it’s a great option if you don’t want to buy individual colors. The same colors are used for the batter and the frosting. You only need a small drop of each for the pastel color effect. For this, I used Chef Master. Lemon Yellow, Neon Pink, Teal Green, Neon Brite Green, Sunset Orange, Purple.

Ingredients substitutions:

  • Buttermilk: I prefer buttermilk for the flavor it adds. Plus it helps keep the crumb tender. However, you can also use regular milk if desired or make this homemade substitute
  • Sour Cream: use plain or Greek yogurt instead


  • Serving Size: 1 Cupcake
  • Calories: 451
  • Sugar: 47.6 g
  • Sodium: 178.1 mg
  • Fat: 23.3 g
  • Carbohydrates: 59 g
  • Fiber: 0.4 g
  • Protein: 3.1 g
  • Cholesterol: 78.7 mg