• 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. If you make them, let me know in the comments below and feel free to tag @sugarandsparrowco on Instagram and show me – I love to see your baking projects!

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

sugar and sparrow coffee layer cake

Coffee Layer Cake With Vanilla Espresso Buttercream

small batch lemon cake recipe by sugar and sparrow

Small Batch Lemon Cake

sugar and sparrow chai cake recipe

Spiced Vanilla Chai Cake Recipe

Search

Archives

Follow Along

@sugarandsparrowco

SHEET PAN COOKIE CAKE 🍪 slice it warm for a fud SHEET PAN COOKIE CAKE 🍪 slice it warm for a fudgy chocolate chip cookie OR let it settle into a moist and chewy cookie cake that’s perfect for decorating! My fave vanilla buttercream + sprinkles turn this giant chocolate chip cookie into the perfect birthday cake alternative at the end 🥳
⁣
Full recipe + decorating ideas at https://sugarandsparrow.com/sheet-pan-chocolate-chip-cookie-cake/
⁣
INGREDIENTS⁣
1 Cup (226g) unsalted butter, melted⁣
1 1/3 Cups (267g) packed light or dark brown sugar⁣
1/2 Cup (100g) granulated sugar⁣
3 large eggs⁣
1 Tbsp pure vanilla extract⁣
1 tsp baking soda⁣
1 tsp cornstarch⁣
1/2 tsp salt⁣
3 Cups (398g) all purpose flour⁣
2 Cups (350g) semi-sweet chocolate chips⁣
⁣
INSTRUCTIONS⁣
1. Preheat the oven to 350ºF (177ºC). Grease and line a 13×18 inch sheet pan.⁣
2. In a large bowl, add the brown sugar and granulated sugar. Melt the butter in the microwave and pour it over the top of the sugars. Whisk together until uniform. Add the eggs and vanilla, then continue whisking until uniform. Whisk in the baking soda, cornstarch, and salt.⁣
3. Add the flour and use a silicone spatula to fold it in until smooth cookie dough forms. Reserve 1/2 Cup of the chocolate chips and set them aside, then fold the remaining 1 1/2 Cups of chocolate chips into the cookie dough.⁣
4. Place the chocolate chip cookie dough onto the prepared sheet pan and use an offset spatula to spread it all the way to the edges in an even layer.⁣
5. Bake the cookie cake for 14-16 minutes, until it looks golden brown on the edges and set. 
6. Enjoy warm or let it cool and decorate with vanilla buttercream and sprinkles! ⁣
⁣
#cookiecake #chocolatechipcookies #sheetcake #birthdaycake #cakedecorating
STRAWBERRY CUPCAKES 🍓based on my beloved strawb STRAWBERRY CUPCAKES 🍓based on my beloved strawberry layer cake recipe, this cupcake version is just as moist yet fluffy and bursting with natural strawberry flavor! Between the mix of fresh strawberries in the cupcakes + freeze-dried strawberries in the frosting, the flavor is out of this world 🚀

Full recipe link in my bio (with strawberry buttercream) + at https://sugarandsparrow.com/strawberry-cupcakes/

STRAWBERRY CUPCAKES
Yield: 14 cupcakes

INGREDIENTS:
5 oz (143g) fresh or frozen strawberries
1/3 Cup (80ml) whole milk, room temp
1 1/2 Cups (158g) sifted cake flour
1 tsp baking powder
1/4 tsp baking soda
1/2 tsp salt
6 Tbsp (85g) unsalted butter, room temp
1 Cup (200g) granulated sugar
2 large eggs, room temp
3 Tbsp (45g) sour cream, room temp
1 tsp vanilla extract
1 drop pink food coloring (optional)

INSTRUCTIONS: 
1. Puree the strawberries using a food processor (you’ll have about 1/2 cup of puree), then place into a saucepan over medium-low heat. Bring to a simmer, then cook for 10-15 min, stirring occasionally, until you have 1/4 cup. Refrigerate until room temp.
2. Preheat oven to 350ºF (177ºC) and line a standard cupcake pan with liners.
3. Whisk together the sifted cake flour, baking powder, baking soda, and salt and set aside.
4. In a stand mixer w/ paddle attachment (or hand mixer + large bowl), whip the butter on high for 2 min. Add sugar and beat for 2 min, until light and fluffy. Turn the mixer to low and add the eggs one at a time, then add the vanilla and sour cream, turn the mixer to high and beat for 1 min. Meanwhile, whisk together the strawberry puree, whole milk, and food coloring (if using).
5. Turn the mixer off and add all of the dry ingredients at once. Mix on low until just combined, then add the strawberry milk mixture until just combined, about 30 seconds.
6. Fill the cupcake liners 2/3 full and bake for 14-18 minutes. Cool completely before topping with strawberry buttercream (full recipe linked above). 

#strawberrycupcakes #strawberrycake #pinkcupcakes #strawberry #cupcakes
COFFEE BUTTERCREAM (recipe below)☕️ this frost COFFEE BUTTERCREAM (recipe below)☕️ this frosting has AMAZING coffee flavor, is so easy to decorate cakes with, and pairs beautifully with so many flavors (chocolate, vanilla, or any cake flavor you’d want to turn into a latte). 

All my cake pairing suggestions are linked in my bio or at https://sugarandsparrow.com/coffee-buttercream-recipe/ 

COFFEE BUTTERCREAM⁣
Yield: 2.5 Cups⁣

INGREDIENTS⁣
1 1/2 tsp instant coffee or espresso powder⁣
1 1/2 Tbsp whole milk, room temperature⁣
1 Cup (226g) unsalted butter, room temperature⁣
3 1/2 Cups (420g) powdered sugar⁣
2 tsp pure vanilla extract⁣
Pinch of salt⁣

INSTRUCTIONS⁣
1. Combine the instant espresso/coffee with the whole milk and set aside. In the bowl of a stand mixer, beat the butter on high until creamy and smooth (about 5 minutes), scraping down the bowl and paddle a few times in between.⁣
2. Turn the mixer to low and add the powdered sugar a few cups at a time, scraping down the bowl and paddle between intervals. Add the vanilla, the coffee/espresso milk mixture, and salt. Mix on low until fully incorporated, about one minute.⁣

#coffeebuttercream #buttercream #frosting #coffeecake
HUMMINGBIRD CAKE 🤎 after weeks of testing this HUMMINGBIRD CAKE 🤎 after weeks of testing this recipe I found that the KEY to taking this already delicious cake to the next level is: roasting the bananas!! It’s an optional step in this recipe BUT it adds unparalleled caramel notes and noticeable richness to the flavor 🙌🏼 Along with the crushed pineapple, toasted pecans, and tangy cream cheese buttercream, this cake is NEXT LEVEL delicious, ultra-moist, melts in your mouth, and will have everyone asking for the recipe. 

Full recipe (with cream cheese frosting) linked in my bio + at https://sugarandsparrow.com/hummingbird-cake-recipe/ 

#hummingbirdcake #creamcheesefrosting #bananacake #cakedecorating #cakerecipe
OREO CUPCAKES 🖤 (recipe below) I made these for OREO CUPCAKES 🖤 (recipe below) I made these for a fundraiser at @vancity.youth last weekend and was reminded of how delicious this recipe is! There’s black cocoa powder in the cupcake batter to give them the PERFECT Oreo cookie flavor profile + the most delicious cookies and cream buttercream I’d eat all on its own. 
 
Full recipe at https://sugarandsparrow.com/oreo-cupcakes-recipe/ 
 
OREO CUPCAKES 
1 Cup (132g) all purpose flour 
3/4 Cup (150g) granulated sugar 
1/3 Cup (38g) black cocoa powder 
1 tsp baking soda 
1/2 tsp baking powder 
1/4 tsp salt 
1/4 Cup (60ml) vegetable oil 
1 large egg, room temp 
1/2 tsp pure vanilla extract 
1/2 Cup (120ml) buttermilk, room temp 
1/2 Cup (120ml) hot coffee or hot water 
 
1. Preheat the oven to 350ºF/177ºC and line a cupcake pan with 12-15 liners. 
2. In a large bowl, whisk all of the dry ingredients together. Add the vegetable oil, eggs, vanilla, and buttermilk and whisk to combine. Whisk in the hot coffee (or hot water). 
3. Pour the batter into the prepared cupcake liners and bake for 14-18 minutes. 
 
OREO BUTTERCREAM 
1 Cup (226g) unsalted butter, room temperature 
3 Cups (360g) powdered sugar 
2 tsp pure vanilla extract 
2 Tbsp whole milk, room temperature 
pinch of salt, or to taste 
9 Oreo cookies (96g), finely ground 
 
1. Using a hand mixer or stand mixer, cream the butter on medium-high speed until it’s creamy and pale, 5 min. 
2. Add the powdered sugar a few cups at a time, mixing on low speed and scraping down bowl and paddle in between intervals. Keep the mixer on low and add the vanilla, milk, and salt. Mix until fully incorporated and uniform, 1-2 min. 
4. Mix in the Oreo cookie crumbs on low speed. 
 
#oreo #oreocupcakes #cookiesandcream #chocolatecupcakes #cupcakes

Footer

On the Blog

  • Cake Basics
  • Recipes
  • Tutorials

Info

  • About
  • Privacy Policy & Disclosure

stay in the know

Copyright © 2026 · Theme by Sugar & Sparrow