About the Recipe
There is something magical about bringing a colorful layer cake to the table and watching everyone’s reaction when the first slice is cut. This Gluten-Free Exploding Rainbow Cake takes that excitement to the next level with six vibrant rainbow cake layers, silky vanilla buttercream frosting, and a hidden surprise center overflowing with colorful sprinkles or candy. From the outside, it looks like a beautifully decorated cake, but inside it hides a fun explosion of color that makes every celebration feel extra special.
Whether you are planning a birthday party, graduation celebration, baby shower, Pride event, family gathering, or holiday dessert table, this gluten-free rainbow cake is guaranteed to become the star of the occasion. Not only is it visually stunning, but it also delivers incredible flavor. Each layer is moist, tender, and rich with vanilla flavor, while the buttercream frosting adds the perfect creamy finish.
Unlike many gluten-free cakes that can sometimes be dry or crumbly, this recipe uses carefully selected ingredients to create a soft, bakery-style texture that rivals any traditional cake. The combination of sweet rice flour, tapioca flour, brown rice flour, buttermilk, and sour cream helps create a cake that is light, fluffy, and sturdy enough to support multiple layers.
One of the best things about this recipe is its flexibility. You can choose between a homemade gluten-free flour blend or a simple Measure for Measure flour option. You can also customize the colors using vibrant gel food coloring or naturally derived colorings made from fruits, vegetables, and plant powders. Whether you prefer bright rainbow colors or softer natural shades, the result is a breathtaking dessert that will leave guests talking long after the party is over.
The hidden center is what truly makes this cake unforgettable. By cutting out the center of several layers before stacking them, a tunnel is created inside the cake. This cavity is then filled with colorful sprinkles, candy-coated chocolates, or your favorite gluten-free candies. When the cake is sliced, the filling spills out dramatically, creating the signature exploding rainbow effect that delights both children and adults.
If you have never made a surprise-inside cake before, do not worry. The process is easier than it looks, and the results are well worth the effort.
Prep Time
45 minutes
Bake Time
20 minutes
Cooling Time
1 hour 30 minutes
Decorating Time
30 minutes
Total Time
3 hours 5 minutes
Servings
12-16 slices
Ingredients
Option 1: Homemade Gluten-Free Flour Blend Cake
½ cup + 1 tablespoon sweet rice flour
½ cup white rice flour
½ cup + 1 tablespoon tapioca flour
¼ cup brown rice flour
¾ teaspoon xanthan gum
1 teaspoon baking powder
½ teaspoon baking soda
½ teaspoon kosher salt
1 stick unsalted butter, room temperature, or ½ cup neutral oil
1 cup granulated sugar
4 large eggs
2 teaspoons pure vanilla extract
½ cup room temperature buttermilk
8 ounces sour cream, room temperature
Option 2: Measure for Measure Flour Cake
2 cups Measure for Measure flour
¾ teaspoon table salt
1½ teaspoons baking powder
½ teaspoon baking soda
¾ cup plus 2 tablespoons milk
½ cup butter, softened
1 large egg
1 cup granulated sugar
1 tablespoon vanilla extract
Buttercream Frosting
4½ cups confectioners’ sugar
2 sticks unsalted butter, softened
1 stick salted butter, softened
3 to 4 tablespoons heavy cream
1½ teaspoons vanilla extract
Gel Food Coloring Option
½ teaspoon Super Red
¼ teaspoon Lemon Yellow
¼ teaspoon Leaf Green
¼ teaspoon AmeriColor Royal Blue
½ teaspoon AmeriColor Violet
¼ teaspoon AmeriColor Orange
Natural Dye Option 1
Red: 1 to 2 tablespoons beet juice
Orange: 1 tablespoon carrot juice
Yellow: 1 egg yolk
Green: 1 tablespoon spinach juice
Blue: 1 tablespoon or more blueberry juice
Purple: 1 tablespoon or more blackberry juice
Natural Dye Option 2
Red: ½ teaspoon red yeast rice powder plus ½ teaspoon beet powder
Orange: ¼ teaspoon red yeast rice powder plus ¾ teaspoon golden berry powder
Yellow: 1 teaspoon golden berry powder
Green: 1 teaspoon matcha powder
Blue: 2 teaspoons butterfly pea powder
Purple: 1 teaspoon purple sweet potato powder
Surprise Filling
1 to 1½ cups rainbow sprinkles
or
1 to 1½ cups candy-coated chocolates
or
1 to 1½ cups gluten-free colorful candies
Optional Decorations
Rainbow sprinkles
Colored buttercream swirls
Edible glitter
Candy pearls
Mini marshmallows
Colorful cake toppers
Preparation
Option 1: Homemade Gluten-Free Flour Blend Cake
Preheat the oven to 350°F. Grease and line six 6-inch cake pans with parchment paper.
In a medium bowl, whisk together the sweet rice flour, white rice flour, tapioca flour, brown rice flour, xanthan gum, baking powder, baking soda, and salt until thoroughly combined.
In a large mixing bowl, beat the butter and sugar until pale and fluffy, approximately 3 to 5 minutes. Proper creaming helps incorporate air into the batter, resulting in a lighter cake texture.
Add the eggs one at a time, beating well after each addition. Stir in the vanilla extract.
Gradually add the flour mixture in three additions, alternating with the buttermilk. Mix until just combined.
Fold in the sour cream until the batter is completely smooth and creamy.
Divide the batter evenly among six separate bowls.
Add a different color to each bowl. Mix carefully until each color is fully incorporated and no streaks remain.
Transfer each colored batter into a prepared cake pan.
Gently tap each pan on the counter to remove any large air bubbles.
Bake for 18 to 22 minutes or until a toothpick inserted into the center comes out clean.
Allow the cakes to cool in the pans for 10 minutes before transferring them to cooling racks.
Cool completely before assembling.
Option 2: Measure for Measure Flour Cake
Preheat the oven to 350°F.
Prepare six 6-inch cake pans with parchment paper and nonstick spray.
Cream together the butter and sugar until light and fluffy.
Mix in the egg and vanilla extract.
In a separate bowl, whisk together the Measure for Measure flour, salt, baking powder, and baking soda.
Alternate adding the dry ingredients and milk to the butter mixture.
Mix until smooth and fully combined.
Divide the batter evenly into six bowls.
Color each portion with your preferred food coloring or natural dye.
Pour each colored batter into a prepared cake pan.
Bake for 18 to 22 minutes or until fully baked.
Cool completely before frosting and assembling.
Buttercream Frosting
Place the softened butter into a large mixing bowl.
Beat until smooth and creamy.
Gradually add the confectioners’ sugar one cup at a time.
Mix in the vanilla extract.
Add heavy cream one tablespoon at a time until the desired consistency is reached.
Continue whipping for 3 to 5 minutes until the frosting becomes fluffy and spreadable.
If desired, divide portions of the frosting and tint them different rainbow colors for decorating.
Building the Surprise Center
Select one cake layer to be the bottom layer and leave it intact.
Place it on a cake stand or serving plate.
Spread an even layer of frosting across the top.
Using a round cookie cutter, biscuit cutter, or small bowl as a guide, remove the center from the next three cake layers.
Leave the final top layer intact.
Place one hollow layer on top of the base layer and spread frosting between each layer.
Continue stacking the hollow layers while carefully aligning the cut-out centers.
This creates a hollow tunnel in the center of the cake.
Fill the cavity with rainbow sprinkles, colorful candies, or candy-coated chocolates.
Fill nearly to the top but do not overfill.
Place the final uncut cake layer on top.
Frosting and Decorating
Apply a thin crumb coat over the entire cake.
Refrigerate for 15 to 20 minutes.
Cover the cake with a final layer of frosting.
Smooth the sides using an offset spatula or cake scraper.
Decorate with rainbow sprinkles, piped buttercream swirls, edible glitter, candy pearls, or themed decorations.
For a dramatic rainbow effect, divide additional frosting into six bowls and tint each color separately. Pipe colorful swirls around the top edge of the cake.
Refrigerate for 20 minutes before slicing.
When cut, the hidden center will release a colorful cascade of sprinkles or candy, creating the spectacular exploding rainbow effect.
Decorating Ideas
Create an ombré frosting effect by gradually changing the color intensity as you pipe decorations.
Add rainbow-colored buttercream rosettes around the top edge.
Cover the sides with rainbow sprinkles for a festive look.
Decorate with edible stars, glitter, or metallic dragees.
Use themed colors for holidays, sports teams, school colors, or special events.
Top with candles, custom cake toppers, or personalized decorations.
Storage
Store covered in the refrigerator for up to 4 days.
Allow the cake to sit at room temperature for approximately 30 minutes before serving.
Wrap individual slices tightly and freeze for up to 2 months.
Thaw overnight in the refrigerator before enjoying.
Notes
Room-temperature ingredients produce the best cake texture and help prevent a dense crumb.
A kitchen scale is helpful for evenly dividing the batter between bowls and cake pans.
Natural food colorings create softer shades while gel food colorings create brighter rainbow colors.
The cake layers can be baked a day in advance and wrapped tightly until ready to assemble.
The frosting can also be prepared one day ahead and stored in the refrigerator. Allow it to soften before using.
Save the cake centers to make gluten-free cake pops, trifles, parfaits, or ice cream toppings.
This cake is ideal for birthdays, graduations, baby showers, Pride celebrations, anniversaries, and festive holiday gatherings.
The surprise filling can be customized to match any party theme or color scheme.
Why This Recipe Works
The combination of sweet rice flour and tapioca flour helps create elasticity and tenderness that can sometimes be difficult to achieve in gluten-free baking.
Sour cream adds moisture and richness while helping the cake remain soft for several days.
Buttermilk contributes a subtle tanginess while reacting with the baking soda to create a lighter texture.
Using multiple thin cake layers creates the beautiful rainbow effect without making the cake too dense.
The surprise center transforms an already beautiful rainbow cake into an unforgettable party centerpiece.