Rainbow Cupcakes

Why You’ll Love This Recipe

I love these Rainbow Cupcakes because every cupcake has a surprise waiting inside. From the outside, they look like classic frosted cupcakes, but cutting or biting into one reveals colorful layers of cake.

I also like how customizable this recipe is. I can use all the colors of the rainbow, choose only a few favorite shades, or coordinate the colors with a party theme. The vanilla cake provides a simple base that works perfectly with colorful buttercream and sprinkles.

Another reason I enjoy this recipe is that the decorating doesn’t need to be complicated. A swirl of white frosting and a handful of rainbow sprinkles are enough to make the cupcakes look festive.

Ingredients

(Tip: You’ll find the full list of ingredients and measurements in the recipe card below.)

For the Rainbow Cupcakes

  • 1 1/2 cups all-purpose flour
  • 1 1/2 teaspoons baking powder
  • 1/4 teaspoon salt
  • 1/2 cup unsalted butter, softened
  • 1 cup granulated sugar
  • 2 large eggs
  • 2 teaspoons vanilla extract
  • 1/2 cup milk
  • Red gel food coloring
  • Orange gel food coloring
  • Yellow gel food coloring
  • Green gel food coloring
  • Blue gel food coloring
  • Purple gel food coloring

For the Vanilla Buttercream

  • 1 cup unsalted butter, softened
  • 3 cups powdered sugar
  • 2–3 tablespoons heavy cream or milk
  • 2 teaspoons vanilla extract
  • Pinch of salt

For Decorating

  • Rainbow sprinkles
  • Colorful sanding sugar, optional
  • Rainbow candies, optional

Directions

  1. I preheat my oven to 350°F (175°C) and line a standard 12-cup muffin pan with cupcake liners.
  2. In a medium bowl, I whisk together the flour, baking powder, and salt. I set the dry ingredients aside while I prepare the cupcake batter.
  3. In a large mixing bowl, I beat the softened butter and granulated sugar until the mixture becomes pale and fluffy.
  4. I add the eggs one at a time, mixing well after each addition. Then I mix in the vanilla extract.
  5. I gradually add the dry ingredients to the butter mixture, alternating with the milk. I mix just until the batter is smooth and combined.
  6. I divide the cupcake batter evenly among six small bowls.
  7. I tint each bowl with a different gel food coloring to create red, orange, yellow, green, blue, and purple batter. I add the coloring gradually until I reach the shades I want.
  8. I spoon small amounts of the colored batters into each cupcake liner, creating layers. I start with purple and continue with blue, green, yellow, orange, and red, taking care not to fill each liner more than about two-thirds full.
  9. I avoid stirring the colors together because I want the individual rainbow layers to remain visible after baking.
  10. I bake the cupcakes for approximately 18–22 minutes, or until a toothpick inserted into the center comes out clean or with a few moist crumbs.
  11. I let the cupcakes cool in the pan for about 5 minutes before transferring them to a wire rack to cool completely.
  12. To make the buttercream, I beat the softened butter until smooth and creamy. I gradually add the powdered sugar, followed by the vanilla, salt, and enough heavy cream or milk to reach a light and fluffy consistency.
  13. Once my cupcakes are completely cool, I pipe or spread the vanilla buttercream over each one.
  14. I finish the cupcakes with rainbow sprinkles, colorful sanding sugar, or rainbow candies before serving.

Servings and Timing

I get approximately 12 standard cupcakes from this recipe.

  • Prep time: 35 minutes
  • Bake time: 18–22 minutes
  • Cooling and decorating time: 30 minutes
  • Total time: About 1 hour 25 minutes
  • Servings: 12 cupcakes

Variations

Pastel Rainbow Cupcakes

When I want a softer appearance, I use small amounts of gel food coloring to create pastel pink, yellow, green, blue, and purple layers. I especially like this version for spring celebrations and birthday parties.

Tie-Dye Cupcakes

Instead of carefully layering the colors, I spoon different colored batters randomly into the cupcake liners. I gently swirl them once with a toothpick to create a colorful tie-dye effect without completely blending the shades.

Rainbow Frosting Cupcakes

I keep the cake itself vanilla and create the rainbow effect in the frosting instead. I divide my buttercream into several portions, tint each one a different color, and pipe the colors together for a rainbow swirl.

Funfetti Rainbow Cupcakes

I fold rainbow sprinkles into the vanilla batter before dividing and coloring it. This gives me even more color inside each cupcake.

Rainbow Cupcakes With a Surprise Center

I remove a small section from the center of each cooled cupcake and fill it with mini rainbow sprinkles or colorful candies. I replace a little cake on top before adding the buttercream, creating a hidden surprise inside.

Storage/Reheating

I store my Rainbow Cupcakes in an airtight container at room temperature for up to 2 days. I keep them somewhere cool and away from direct sunlight or heat so the buttercream stays firm.

For longer storage, I refrigerate the cupcakes in an airtight container for up to 4 days. I bring them to room temperature for about 20–30 minutes before serving because I find that both the cake and buttercream have a softer texture at room temperature.

I can freeze the unfrosted cupcakes for up to 2–3 months. Once they are completely cool, I wrap them individually and place them in a freezer-safe container. I thaw them at room temperature before frosting and decorating.

I don’t recommend reheating Rainbow Cupcakes after decorating because the buttercream can melt and the decorations may lose their appearance. I simply allow refrigerated cupcakes to come to room temperature before serving.

FAQs

What is the best food coloring for Rainbow Cupcakes?

I prefer gel food coloring because it produces vibrant colors without adding much liquid to the cupcake batter. I only need a small amount of each color, and I can gradually add more until I get the shade I want.

How do I keep the rainbow colors from mixing together?

I carefully spoon each colored batter into the cupcake liners without stirring the layers. I also avoid adding too much batter at once because thinner, controlled layers help me create a clearer rainbow effect.

Can I make Rainbow Cupcakes with a boxed cake mix?

Yes. When I need a shortcut, I prepare a white or vanilla boxed cake mix according to the package directions. I divide the batter into separate bowls, color each portion, and layer the batter in the cupcake liners before baking.

Can I make Rainbow Cupcakes ahead of time?

Yes. I can bake the cupcakes one or two days ahead and keep them in an airtight container. I usually frost and decorate them closer to serving time so the buttercream and sprinkles look fresh.

Why did my rainbow cupcake colors turn brown?

This can happen when I mix the colored batters together too much or use too much food coloring. I get better results by using concentrated gel colors and carefully layering the batter without swirling it. I also avoid overbaking because excessive browning can make the colors less vibrant.

Conclusion

Rainbow Cupcakes are one of my favorite ways to add plenty of color to a dessert table. I love revealing the colorful layers beneath the simple vanilla frosting, and I can easily adjust the shades to suit almost any celebration.

Print

Rainbow Cupcakes

Rainbow Cupcakes

5 Stars 4 Stars 3 Stars 2 Stars 1 Star

No reviews

These Rainbow Cupcakes feature soft vanilla cake layered with six vibrant colors and topped with fluffy vanilla buttercream. Rainbow sprinkles make them a festive dessert for birthdays, Pride celebrations, spring parties, and other colorful occasions.

  • Author: Laura
  • Prep Time: 35 minutes
  • Cook Time: 18–22 minutes
  • Total Time: 1 hour 25 minutes
  • Yield: 12 cupcakes
  • Category: Dessert
  • Method: Baking
  • Cuisine: American
  • Diet: Vegetarian

Ingredients

  • 1 1/2 cups all-purpose flour
  • 1 1/2 teaspoons baking powder
  • 1/4 teaspoon salt
  • 1/2 cup unsalted butter, softened
  • 1 cup granulated sugar
  • 2 large eggs
  • 2 teaspoons vanilla extract
  • 1/2 cup milk
  • Red gel food coloring
  • Orange gel food coloring
  • Yellow gel food coloring
  • Green gel food coloring
  • Blue gel food coloring
  • Purple gel food coloring
  • 1 cup unsalted butter, softened, for buttercream
  • 3 cups powdered sugar
  • 23 tablespoons heavy cream or milk
  • 2 teaspoons vanilla extract, for buttercream
  • Pinch of salt, for buttercream
  • Rainbow sprinkles
  • Colorful sanding sugar, optional
  • Rainbow candies, optional

Instructions

  1. Preheat the oven to 350°F (175°C) and line a standard 12-cup muffin pan with cupcake liners.
  2. Whisk together the flour, baking powder, and salt in a medium bowl. Set aside.
  3. In a large mixing bowl, beat the softened butter and granulated sugar until pale, light, and fluffy.
  4. Add the eggs one at a time, mixing well after each addition. Mix in the vanilla extract.
  5. Gradually add the dry ingredients to the butter mixture, alternating with the milk. Mix just until the batter is smooth and combined.
  6. Divide the cupcake batter evenly among six small bowls.
  7. Tint the portions separately with red, orange, yellow, green, blue, and purple gel food coloring, adding the coloring gradually until the desired shades are reached.
  8. Spoon small amounts of colored batter into each cupcake liner to form layers, beginning with purple and continuing with blue, green, yellow, orange, and red. Fill each liner no more than approximately two-thirds full.
  9. Do not stir or swirl the layers so the individual rainbow colors remain distinct.
  10. Bake for 18–22 minutes, or until a toothpick inserted into the center comes out clean or with a few moist crumbs.
  11. Cool the cupcakes in the pan for about 5 minutes, then transfer them to a wire rack to cool completely.
  12. For the vanilla buttercream, beat the softened butter until smooth and creamy. Gradually add the powdered sugar, followed by the vanilla, salt, and enough heavy cream or milk to create a light, fluffy consistency.
  13. Pipe or spread the vanilla buttercream over the completely cooled cupcakes.
  14. Decorate with rainbow sprinkles, colorful sanding sugar, or rainbow candies before serving.

Notes

  • Gel food coloring works best for creating vibrant rainbow layers without adding excessive liquid to the batter.
  • For pastel cupcakes, use smaller amounts of food coloring to create softer shades.
  • For a tie-dye effect, spoon the colored batters randomly into the liners and gently swirl once with a toothpick.
  • For rainbow frosting cupcakes, leave the cake batter uncolored and tint separate portions of buttercream before piping the colors together.
  • For funfetti cupcakes, fold rainbow sprinkles into the vanilla batter before dividing and coloring it.
  • For surprise-center cupcakes, remove a small section from each cooled cupcake, fill with mini sprinkles or candies, replace a little cake, and frost as usual.
  • A white or vanilla boxed cake mix can be used as a shortcut. Divide the prepared batter, tint each portion, and layer as directed.
  • Store cupcakes in an airtight container at room temperature for up to 2 days or refrigerate for up to 4 days.
  • Unfrosted cupcakes can be wrapped individually and frozen for up to 2–3 months. Thaw at room temperature before decorating.
  • Bring refrigerated cupcakes to room temperature for 20–30 minutes before serving. Do not reheat decorated cupcakes.

Nutrition

  • Serving Size: 1 cupcake
  • Calories: 405 kcal
  • Sugar: 43 g
  • Sodium: 130 mg
  • Fat: 21 g
  • Saturated Fat: 13 g
  • Unsaturated Fat: 7 g
  • Trans Fat: 0.5 g
  • Carbohydrates: 52 g
  • Fiber: 1 g
  • Protein: 4 g
  • Cholesterol: 85 mg
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments