Print

🌈 Rainbow Cupcakes Recipe

A rainbow cupcake sliced in half, showing colorful cake layers inside and swirled frosting on top

These rainbow cupcakes are fluffy, fun, and full of vibrant color! With soft vanilla cake layers dyed into a rainbow and swirled buttercream frosting on top, they’re perfect for birthdays, Pride, or any day that needs a splash of joy. Easy to make from scratch or with a box mix shortcut!

Ingredients

Scale

For the Cupcakes:

  • 1 white cake mix (optional shortcut base)

  • OR:

    • 2–5 eggs (see notes)

    • 1 cup sour cream or Greek yogurt

    • 1/2 cup milk or buttermilk

    • 1/3 cup vegetable oil

    • 1/2–1 cup unsalted butter, softened or melted

    • 2 1/3 cups granulated sugar

    • 3 cups all-purpose flour

    • 4 tsp baking powder

    • 1/2 tsp baking soda

    • 1/2 tsp salt

    • 1 tbsp vanilla extract (use clear vanilla for white batter)

    • Gel food coloring (red, orange, yellow, green, blue, purple)

For the Frosting:

  • 1–1.5 cups unsalted butter (2–3 sticks)

  • 4–6 cups powdered sugar (sifted)

  • 3–5 tbsp milk or heavy cream

  • 1/2 tsp vanilla extract

  • 1/2 tsp coconut extract (optional)

  • Pinch of salt

  • Gel food coloring (for tinting)

  • Gold sprinkles or glitter stars (optional)

Instructions

  • Prep: Preheat oven to 350°F (175°C). Line a muffin tin with cupcake liners.

  • Mix Batter: Prepare white cake batter (from mix or scratch). Divide into 5–6 bowls and tint each one a different color using gel food coloring.

  • Layer: Spoon small amounts of each colored batter into liners, one color at a time. Don’t swirl—just layer!

  • Bake: Bake for 16–20 minutes, or until a toothpick comes out clean. Cool completely.

  • Make Frosting: Beat butter until creamy. Add sifted powdered sugar, milk, and extracts. Mix until fluffy. Divide and tint with food coloring.

 

  • Decorate: Pipe swirled frosting onto cooled cupcakes. Top with glitter or sprinkles if you’re feelin’ fancy!

Notes

  • For brightest colors, always use gel food coloring, not liquid.

  • Want fewer dishes? Use one bowl and wash between colors.

  • Use only egg whites for whiter batter.

  • These freeze beautifully! Store unfrosted in an airtight container for up to 2 months.

Nutrition

Keywords: rainbow cupcakes, rainbow cupcake recipe, colorful cupcakes, rainbow cupcakes with frosting, pastel rainbow cupcakes