• Cake
  • Frosting
  • YouTube
  • My Favorite Tools
  • Nav Social Icons

  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Recipes
    • Cake
    • Cupcakes
    • Frosting
    • Ice Cream
    • Vegan
  • Cake Basics
  • Tutorials
  • Blog
  • About
  • Mobile Menu Widgets

    Connect

    Search

Sugar & Sparrow logo in script font

Sugar & Sparrow

Lifestyle and Cake from Portland Oregon

  • Cake Basics
  • Recipes
    • Cake
    • Cupcakes
    • Cookies & Bars
    • Filling
    • Frosting
    • Ice Cream
    • No-Bake
    • Small Batch
    • Vegan
  • Tutorials
  • Book
  • Blog
  • About

How to Make Rainbow Swirl Cupcakes

March 5, 2026 · In: Cupcakes, Featured, Recipes, Tutorials

Jump to Recipe

In this tutorial, I’ll teach you how to master the perfect rainbow buttercream swirl for cupcakes using just four colors of buttercream in one piping bag! Yes, there are technically seven colors in the rainbow but when these four colors are piped at the same time, they end up mixing together to make the in-between colors seamlessly. The rainbow swirls turn out so whimsical and this technique doesn’t need to be limited to cupcakes – you can use this method for decorating cakes, cookies, and more! 

rainbow swirl cupcakes tutorial
rainbow buttercream swirl cupcakes tutorial

These rainbow cupcakes are perfect for St. Patrick’s Day, birthdays, and any event that could use a little more magic. They’re so pretty to look at and so much fun to make! 

What Kind of Buttercream to Use

You can use any kind of buttercream for this tutorial that can be tinted easily. I usually gravitate toward this vanilla buttercream recipe (pictured throughout this post), which is an American buttercream that I’ve altered to be less sweet than average. It’s super easy to make, has amazing vanilla flavor, and is really easy to tint with any kind of food coloring. If you already have a go-to buttercream (Swiss Meringue, Italian Meringue, etc), you can easily use it with this tutorial. 

rainbow cupcakes recipe

What Kind of Food Coloring to Use 

Any kind of food coloring will work, but I love using gel food coloring. For the pastel rainbow color palette pictured here, I used AmeriColor Deep Pink, Lemon Yellow, Sky Blue, and Regal Purple. All the food coloring brands that I love are:

  • AmeriColor
  • Wilton
  • Colour Mill – oil-based gel that’s great for meringue-based buttercreams
  • Chefmaster
  • ENCO Naturals – if you’re looking for dye-free natural food coloring
rainbow buttercream swirl tutorial for cupcakes

Rainbow Swirl Cupcakes Tutorial Video

Here’s how to make these rainbow cupcakes, from coloring the buttercream to piping the swirls:

If you love video tutorials like this one, be sure to check out my YouTube channel! I’ve got a growing collection of cake recipes, decorating tutorials, and Cake Basics over there. Hit the subscribe button on my page so you never miss a new video.

Rainbow Cupcake Supplies

  • 14 baked cupcakes (recipe below)
  • 1 batch of vanilla buttercream 
  • Pink, blue, yellow, and purple food coloring
  • 4 bowls and spoons for mixing 
  • Piping bags
  • Plastic wrap
  • Scissors
  • Wilton Tip 1M or piping tip of your choice

How to Make Rainbow Swirl Cupcakes 

Step 1: Tint the Buttercream

Divide the buttercream equally between four bowls. To the first bowl, add a few drops of pink food coloring and mix it in until you have a pastel pink color (or whatever shade of pink you’re hoping for). 

how to color buttercream for rainbow cupcakes

Repeat the process with the yellow, blue, and purple food coloring and the remaining three bowls of buttercream. To recreate the rainbow cupcakes pictured throughout this post, here is the color palette you should aim for: 

how to make rainbow buttercream frosting for cupcakes

Step 2: Prepare the Rainbow Piping Bag

Spread a piece of plastic wrap onto a flat surface and pipe or spoon the pink buttercream onto it in a straight line. Add the yellow buttercream directly next to the pink buttercream, followed by blue and purple. It’s important to place the buttercream colors in this order:

how to make rainbow piping with frosting

Once the colors are added onto the plastic wrap, gently fold/roll up the buttercream in the plastic wrap so that the pink and purple end up on top of one another. Continue rolling so that the buttercream is enclosed in a tube of plastic wrap, then cut off the end of the plastic wrapped buttercream tube. Place the tube inside a piping bag that’s already been fitted with a piping tip. I used Wilton Tip 1M. 

how to pipe rainbows with frosting

Step 3: Pipe the Rainbow Swirls

Starting in the center of the cupcake, squeeze the piping bag while pulling it up about ½ inch from the cupcake surface, then continue squeezing while you move the piping bag to the left and swirl it around the edge in a counter-clockwise rotation. Once you’ve made a full rotation, gently release the pressure on the piping bag while quickly pulling the bag counter-clockwise. This will create the pointed end of the rainbow swirl. 

how to pipe a rainbow buttercream swirl on a cupcake

Repeat the rainbow swirl process on each cupcake until they all look perfectly whimsical!

st patricks day cupcakes

You’ll find the full recipe for the vanilla cupcakes and vanilla buttercream I used to create these rainbow cupcakes below. Let me know if you make them in the comments below (be sure to leave a star rating!) and feel free to tag @sugarandsparrowco on Instagram to show me if you post a photo. I love to see what you create with my recipes!

rainbow swirl cupcakes tutorial

Rainbow Swirl Cupcakes

Super soft and moist vanilla cupcakes topped with a swirl of rainbow-colored vanilla buttercream. So whimsical and fun to make!
Print Recipe Pin Recipe
Prep Time:25 minutes mins
Cook Time:14 minutes mins
Cooling Time:1 hour hr
Total Time:1 hour hr 39 minutes mins
Course: Dessert
Cuisine: American
Servings: 14 cupcakes

Equipment

  • Wilton Tip 1M

Ingredients

Vanilla Cupcakes

  • 1 1/4 cups (132g) sifted cake flour* DIY recipe in notes
  • 1 tsp baking powder
  • 1/4 tsp baking soda
  • 1/2 tsp salt
  • 6 Tbsp (82g) unsalted butter, softened to room temperature
  • 2 Tbsp (30ml) vegetable oil
  • 3/4 cup (150g) granulated white sugar
  • 2 large eggs, room temperature
  • 2 Tbsp (30g) sour cream, room temperature
  • 1 1/2 tsp pure vanilla extract
  • 1/2 cup (120ml) whole milk, room temperature

Rainbow Vanilla Buttercream

  • 1 Cup (226g) unsalted butter, room temperature
  • 3 1/2 Cups (420g) powdered sugar
  • 2 Tbsp whole milk, room temperature
  • 2 tsp pure vanilla extract
  • 1/4 tsp salt, or to taste
  • 1-2 drops pink food coloring
  • 1-2 drops yellow food coloring
  • 1-2 drops blue food coloring
  • 1-2 drop purple food coloring

Instructions

Make the Vanilla Cupcakes

  • Preheat the oven to 350°F (177ºC) and line standard cupcake pan(s) with liners. This recipe makes about 14 cupcakes.  
  • Add the sifted cake flour, baking powder, baking soda, and salt into a bowl and whisk to combine. Set aside. 
  • In the bowl of your stand mixer fitted with the paddle attachment (or with an electric mixer and large bowl), beat the butter on high for two minutes until creamy. Add the vegetable oil and sugar and continue to mix on high for another two minutes. Scrape down the bowl and paddle. Turn the mixer to low speed and add the eggs one at a time, mixing thoroughly after each addition. Add the vanilla and sour cream, then turn the mixer to high speed and mix for one minute. Scrape down the bowl and paddle as needed.
  • With the mixer on low speed, add in the dry ingredients all at once and mix until just combined, then add the milk in a steady stream. Continue mixing for another 20-30 seconds, until just combined. Scrape down the sides and bottom of the bowl and give it a few stirs to make sure there are no lumps (without over-mixing). The batter will be slightly thick.
  • Spoon or pour the batter into the cupcake tins until they’re about ⅔ full, then bake for 14-18 minutes, until they spring back to the touch and a toothpick inserted into the middle comes out clean. Let the cupcakes cool in the pan for about five minutes before removing them from the pan and continuing to cool on a wire rack until room temperature. Make sure they are entirely room temperature before adding any frosting. 

Make the Vanilla Buttercream

  • With a hand mixer or paddle attachment on your stand mixer, cream the butter on medium-high until it’s creamy and light (almost white) in color. About 7 minutes. 
  • With the mixer on low, add the sifted powdered sugar one cup at a time, scraping down after each addition and making sure each cup is fully incorporated before adding the next one. Add vanilla, milk, and salt and mix on low for another minute until fully incorporated. 
  • Color the Buttercream: divide the vanilla buttercream between four bowls. Add the pink food coloring to the first bowl and mix it in. Repeat with the other three bowls and the yellow, blue, and purple food coloring.

Assembly

  • Prepare the Rainbow Piping Bag: Spread a piece of plastic wrap onto a flat surface and pipe or spoon the pink buttercream onto it in a straight line. Next to the pink, pipe or spoon the yellow buttercream in a straight line and repeat the process with the blue and purple buttercream. See the picture in the blog post above for reference.
  • Roll up the plastic wrap so that the pink and purple buttercream end up on top of one another. Continue rolling until the plastic wrap encloses the buttercream in a tube, then snip off the end. Place the buttercream tube into a piping bag fitted with Wilton Tip 1M with the cut end facing down.
  • Pipe the Rainbow Swirls: Starting in the center of the cupcake, squeeze the piping bag while pulling it up about ½ inch from the cupcake surface, then continue squeezing while you move the piping bag to the left and swirl it around the edge in a counter-clockwise rotation. Once you’ve made a full rotation, gently release the pressure on the piping bag while quickly pulling the bag counter-clockwise. This will create the pointed end of the rainbow swirl. Repeat until each cupcake is topped with a rainbow swirl.

Notes

*DIY Cake Flour Recipe: To make your own cake flour, spoon and level one cup of all-purpose flour and remove 2 Tbsp. Add 2 Tbsp of cornstarch. Repeat per the amount of cake flour you need, then sift the flour and cornstarch mixture 4 times (don’t skip that step!). After sifting, spoon and level to re-measure the amount of cake flour you need. Keep in mind that if you do use the homemade version, the gram measurement will weigh more (295g instead of 265g) since all-purpose flour is heavier than cake flour.
Make Ahead Tips:
  1. The vanilla cupcakes can be baked, cooled, stored in their cupcake pan with plastic wrap over the top, and left out at room temperature up to one day ahead of decorating. Unfrosted cupcakes can be stored in an airtight container in the freezer for up to one month before thawing and frosting.
  2. The vanilla buttercream can be made ahead and stored at room temperature in an airtight container for up to one day, or in an airtight container in the refrigerator for up to two weeks. When you’re ready to use it, bring it back to room temperature and re-whip in your stand mixer to bring back to smooth buttercream consistency.
  3. Once decorated, the rainbow swirl cupcakes can be stored at room temperature for up to 4 days. 

By: Whitney · In: Cupcakes, Featured, Recipes, Tutorials · Tagged: pride cupcakes, rainbow buttercream, rainbow cake, rainbow cupcakes, st patricks day cupcakes

you’ll also love

Rainbow layer cake with rainbow frostingThe Ultimate Rainbow Cake (Inside and Out!)
st patricks day cake ideas by sugar and sparrowSt. Patrick’s Day Dessert Ideas
green velvet cake recipe for st patricks day dessertGreen Velvet Cake with Rainbow Frosting

Join the List

Stay up to date & receive the latest posts in your inbox.

Reader Interactions

Leave a Reply Cancel reply

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

Recipe Rating




Next Post >

The Perfect Vanilla Cupcake Recipe

Primary Sidebar

Welcome to Sugar & Sparrow

Welcome to Sugar & Sparrow

Helping you whip up pretty desserts with confidence and creativity. And hopefully sharing a few laughs with you along the way!

Learn More

Connect

let’s bake!

Get my very best recipes, baking tips, and decorating tutorials sent to your inbox

Featured Posts

strawberry ice cream recipe no churn

No-Churn Strawberry Ice Cream Recipe

baked graham cracker crust recipe for pies and cheesecakes

Perfect Graham Cracker Crust Recipe

ocean cake tutorial

Under The Sea Cake Tutorial

Search

Archives

Follow Along

@sugarandsparrowco

DYE-FREE BLACK BUTTERCREAM 🖤 (recipe below) there DYE-FREE BLACK BUTTERCREAM 🖤 (recipe below) there is ZERO food coloring in this black buttercream recipe which means it won’t turn your mouth black (or anything else 💩) + it tastes like Oreo cookie butter so it’s a win all around!! The key is to use EXTRA dark black cocoa powder, which also comes in handy in my black velvet cake recipe 🙌🏼 ideal secret ingredient for your Halloween cakes! 
⁣
Full recipe (and the black cocoa powder I use!) is linked in my bio and at https://sugarandsparrow.com/dye-free-black-buttercream/
⁣
DYE-FREE BLACK BUTTERCREAM⁣⁣
Yield: 2.5 Cups⁣⁣
⁣⁣
INGREDIENTS:⁣⁣
1 Cup (226g) unsalted butter, room temp
2 1/2 Cups (300g) powdered sugar⁣⁣
1/2 Cup (56g) EXTRA DARK black cocoa powder⁣⁣*
1 tsp pure vanilla extract⁣⁣
2 Tbsp whole milk, room temp
pinch of salt⁣⁣
⁣⁣
INSTRUCTIONS:⁣⁣
1. In a stand mixer fitted with the paddle attachment, whip the butter on medium speed until creamy and light in color, 4 min. Add half of the powdered sugar and mix on low until just combined, then add the rest of the powdered sugar. With the mixer still in the off position, sift in the black cocoa powder and add the vanilla, milk, and salt. Mix on low until all ingredients are thoroughly combined, 2-3 minutes, scraping down the bowl and paddle as needed.⁣⁣
2. Place the buttercream in an airtight container and allow the color to deepen for 24 hours or more. ⁣⁣

*I use a brand called The Cocoa Trader that I get on Amazon. It’s the darkest black cocoa powder I’ve seen so far!!
⁣⁣
#blackbuttercream #naturalfoodcoloring #blackcake #buttercream #blackcocoapowder
SMALL BATCH pumpkin cake with cream cheese frostin SMALL BATCH pumpkin cake with cream cheese frosting 🧡 This mini cake is a scaled down version of my favorite pumpkin cake recipe + makes the perfect amount for 2-4 people! Bake it as a 4-inch mini layer cake or a single layer 6-inch cake, either way is absolutely delicious and the perfect for date night, a small gathering, or any time you’re craving pumpkin cake without having to make a huge dessert 🙌🏽

Comment RECIPE and I’ll send you the full recipe (with thick and stable cream cheese frosting!) or find it linked in my bio + at https://sugarandsparrow.com/small-batch-pumpkin-cake/ 

INGREDIENTS 
2/3 Cup (88g) all-purpose flour
1 tsp baking powder
1/4 tsp baking soda
1/4 tsp salt
1 tsp ground cinnamon
1/2 tsp allspice
1/4 tsp nutmeg
1/8 tsp ground ginger
1/3 Cup (67g) packed brown sugar
2 Tbsp (25g) granulated sugar
1/3 Cup (80ml) vegetable oil or melted butter
1 large egg, room temp
1/2 Cup (125g) canned pumpkin puree
1/2 tsp pure vanilla extract

INSTRUCTIONS
1. Preheat the oven to 350ºF (177ºC). Grease and line three 4-inch cake pans or one 6-inch cake pan.
2. In a medium bowl, whisk together the all-purpose flour, baking powder, baking soda, salt, cinnamon, allspice, nutmeg, and ground ginger. Set aside.
3. In a separate medium bowl, add the brown sugar, granulated sugar, vegetable oil (if using melted butter in place of the oil, cool it for 5-10 minutes prior to adding here), egg, pumpkin puree, and vanilla extract. Whisk together until uniform, then add the flour mixture and whisk until smooth.
4. Pour the batter evenly between the prepared cake pan(s). If using 4-inch cake pans, bake for 22-26 minutes. If using a 6-inch cake pan, bake for 25-30 minutes. Cool completely before frosting (full recipe with cream cheese buttercream is linked in my bio!)

#pumpkincake #smallbatchcake #minicake #creamcheesefrosting #fallbaking
TOP 10 FALL CAKES 🍂 These are not only MY favorite TOP 10 FALL CAKES 🍂 These are not only MY favorite Fall cake recipes, they’re yours too! 🥰

Comment “FALL” and I’ll send you all of the cake recipes shown here and all 36+ of my favorite Fall baking ideas – classic cakes like pumpkin cake with cream cheese frosting, spice cake, and cranberry orange cake, more complex flavor combinations like chocolate pecan pie cake with salted caramel and apple crisp cake, and cozy recipes like no-bake pumpkin cheesecake, homemade salted caramel, and my favorite brown butter chocolate chip cookie bars. 

https://sugarandsparrow.com/fall-baking-recipes/

#pumpkincake #applecake #fallcake #cakeinspiration #cakeideas
The BEST pumpkin cake with cream cheese frosting 🧡 The BEST pumpkin cake with cream cheese frosting 🧡 this pumpkin layer cake is easy to make, perfectly spiced, so moist, irresistible with cream cheese frosting, and uses the ENTIRE 15oz can of pumpkin (no awkward leftovers!). Top it with pretty piped pumpkins to make it extra cute 🥰

Comment RECIPE to get the full recipe (with frosting + cake decorating tutorial) or find it linked in my bio and at https://sugarandsparrow.com/pumpkin-layer-cake-recipe/

INGREDIENTS
2 Cups (265g) all-purpose flour
2 tsp baking powder
1 tsp baking soda
1 tsp salt
2 tsp ground cinnamon
1 tsp allspice
1 tsp nutmeg
1/2 tsp ground ginger
1 Cup (200g) packed brown sugar
1/2 Cup (100g) granulated sugar
1 Cup (240ml) vegetable oil or melted butter
4 large eggs, room temp
15 Oz (425g) canned pumpkin puree
2 tsp pure vanilla extract

INSTRUCTIONS
1. Preheat the oven to 350ºF (177ºC). Grease and line three 6-inch or two 8-inch cake pans.
2. In a medium bowl, whisk together the all-purpose flour, baking powder, baking soda, salt, cinnamon, allspice, nutmeg, and ground ginger. Set aside.
3. In a separate large bowl, add the brown sugar, granulated sugar, oil (if using melted butter in place of the oil, cool it for 5-10 minutes prior to adding here), eggs, pumpkin puree, and vanilla extract. Whisk together until uniform, then add the flour mixture and whisk until smooth.
4. Pour the batter evenly between the prepared cake pans and bake for 32-36 minutes, until a toothpick inserted comes out clean or with just a few moist crumbs. Cool the cakes completely to room temp before frosting!

#pumpkincake #creamcheesefrosting #layercake #cake #fallbaking
EASY HOMEMADE SALTED CARAMEL✨(recipe below) even i EASY HOMEMADE SALTED CARAMEL✨(recipe below) even if you’ve never made salted caramel from scratch before, this recipe is VERY beginner friendly + nearly fail proof! There are only 4 ingredients involved, no candy thermometer required, and takes just 10 minutes to make 👏🏽 this is my go-to caramel for drip cakes, drizzling desserts, flavoring coffee, adding it to buttercream, and so much more! 🍯  
 
Full recipe (with video + detailed instructions) linked in my bio or at https://sugarandsparrow.com/salted-caramel-recipe/
⁣ 
SALTED CARAMEL 
Yield: 1.25 Cup⁣s
⁣⁣ 
Ingredients:⁣⁣ 
1 Cup (200g) white granulated sugar⁣⁣ 
6 Tbsp (85g) unsalted butter, room temperature, cut into cubes⁣⁣ 
1/2 Cup (120ml) heavy whipping cream, room temperature⁣⁣ 
1 1/4 tsp kosher salt⁣⁣ 
⁣⁣ 
Instructions:⁣⁣ 
1. Place the sugar in a medium saucepan over medium-high heat and stir constantly until it melts into an amber-colored liquid and no sugar clumps remain, 5-6 minutes. ⁣⁣ 
2. Reduce the heat to medium. Carefully add the butter (it will bubble up when you do) and use a whisk to combine it with the sugar mixture until the butter is fully melted and incorporated, 2-3 minutes. ⁣⁣ 
3. Add the heavy whipping cream in a steady stream while whisking. As soon as the cream is incorporated, let the caramel boil for a full minute before removing it from the heat and stirring in the salt. ⁣⁣ 
4. Let the caramel cool to room temperature before using it in a cake recipe or as a drip. If you’re using it to drizzle over ice cream or warm baked goods, you only need to cool it slightly (20 minutes or so). It will thicken as it cools. ⁣⁣ 
⁣⁣ 
#caramel #saltedcaramel #bakedfromscratch #caramelcake #caramelsauce

Footer

On the Blog

  • Cake Basics
  • Recipes
  • Tutorials

Info

  • About
  • Privacy Policy & Disclosure

stay in the know

Copyright © 2026 · Theme by Sugar & Sparrow