This post may contain affiliate links. Please read our disclosure policy.
This rainbow cake is bright, fun, and guaranteed to steal the show at any celebration. With vibrant layers of color and fluffy buttercream frosting in every bite, it’s just as delicious as it is stunning!
For another reader-favorite cake recipe, try my Homemade Chocolate Cake or Copycat Portillo’s Chocolate Cake!

Why you’ll love this rainbow birthday cake recipe!

A classic rainbow birthday cake is all about creating a fun surprise inside. From the outside, it looks like a simple frosted cake—but once you slice into it, the colorful layers are revealed, making it extra special.
This cake keeps things simple on the flavor side with a vanilla base and creamy buttercream frosting, allowing the vibrant colors to take center stage. It’s the perfect combination of playful and delicious.
- A True Showstopper: This cake looks absolutely incredible when sliced, revealing colorful layers that instantly wow guests at birthdays, parties, or special occasions.
- Surprisingly Easy to Make: While it may look complicated, this recipe uses a simple boxed cake mix base, making it approachable even for beginner bakers.
- Soft and Moist Texture: Thanks to the addition of sour cream and oil, each layer is incredibly fluffy, tender, and full of moisture.
- Perfect for Celebrations: Whether it’s a birthday, holiday, or just a fun weekend bake, this cake brings instant joy to any table.
- Customizable Colors and Flavors: You can switch up the colors, add flavors, or decorate it however you like to match your theme.
Table of Contents
Ingredient Notes

See recipe card below this post for ingredient quantities and full instructions for this rainbow birthday cake.
- White cake mix – The white cake will hold the food coloring the best.
- Vegetable oil – Keeps the cake moist and tender.
- Sour cream – Adds richness and improves texture.
- Eggs – Helps bind the batter and create structure.
- Gel food coloring – Provides bold, vibrant colors for each layer.
- Buttercream frosting (this Homemade Cream Cheese Frosting recipe would also work!)
Variations
- Change the Colors: Customize the layers to match a party theme or holiday.
- Add Flavoring: Mix in vanilla, almond, or citrus extract for extra flavor.
- Use Cream Cheese Frosting: For a tangier twist, swap buttercream for cream cheese frosting.
- Make Cupcakes Instead: Divide the batter into cupcake liners for mini rainbow treats.
- Add Sprinkles: Mix sprinkles into the batter or use them for decoration. Perfect for a rainbow birthday cake!
How to Make a Rainbow Cake

- Prepare the batter: In a large bowl, mix the cake mix with oil, sour cream, eggs, and water until smooth.

- Divide and color: Split the batter evenly into six bowls and add different food coloring to each one. Pour each colored batter into separate greased cake pans.

- Bake the layers: Bake until a toothpick inserted in the center comes out clean, then let the cakes cool completely.

- Make the frosting: Prepare your buttercream while the cakes cool.

- Assemble the cake: Stack the layers with frosting between each one, starting from the bottom and working your way up.

- Crumb coat and finish: Apply a thin crumb coat, chill, then frost the entire cake and decorate as desired.

How to Store Rainbow Cake
Room Temperature: Store this rainbow layer cake in an airtight container for up to 2 days.
Refrigerator: Keep refrigerated for up to 1 week.
Freezer: Freeze slices or whole layers for up to 3 months. Thaw before serving.
Frequently Asked Questions
A rainbow color cake typically tastes like a classic vanilla cake with buttercream frosting. The flavor is simple and delicious, letting the visual appeal shine.
A rainbow layer cake is made by stacking multiple colored cake layers, usually in the colors of the rainbow, to create a vibrant, striped effect when sliced.
Using gel food coloring is the key. It produces bold, vivid colors without affecting the texture of the batter.
Yes! You can bake the layers in batches if you don’t have enough pans.
More Cake Recipes You’ll Love
💌 Love easy recipes? Join my newsletter and get my Top 10 Reader-Favorite Recipes eBook FREE! Sign up here.
Need help with this recipe?
Click the buttons below to summarize it, adjust for diets, swap ingredients, or ask your own questions!

Rainbow Layer Cake
Ingredients
- 2 boxes white cake mix
- 1 cup water
- 1 cup vegetable oil
- 16 oz sour cream
- gel food coloring
- 4 eggs
Instructions
- Preheat the oven to the temperature on the back of the cake box. Prepare and grease the cake pans. Set aside.
- In a large bowl, combine the cake mix, water, vegetable oil, sour cream, and eggs. Mix well to combine.
- Evenly distribute the batter into six bowls to make all of the colors. Add the desired amount of food coloring to each bowl and mix until the color is smooth.
- Add the batter to the pan for each color and bake according to the package on the back of the cake mix box.
- Let the cake cool completely before frosting the cake with buttercream frosting. Frost the cake, first with a crumb coat, and then with the remaining frosting. Top with sprinkles if desired.














This turned out perfectly and my kids LOVED the colored layers!
Did you bake all the cakes in the oven at the same time? I have little faith in my oven to achieve this successfully all at once, lol.
We do, but you can work in batches as needed!
What size cake pans should I use?🙃
WELL I BE THIS IS ADORABLE! MY OLDEST DAUGHTER WOULD ABSOLUTELY LOVE THIS I THINK I WILL MAKE IT FOR HER DURING PRIDE MONTH AS A LITTLE SURPRISE GIFT TO LET HER KNOW EVEN MORE THAT I SUPPORT HER AND WILL ALWAYS BE ON HER SIDE AND THAT REGARDLESS OF HER DECISIONS I WILL ALWAYS Want her to be happy and and no matter who she loves I want the relationship to be healthy One where she is there partner,best friend,team mate where she feels loved supported understood and at home whoever she’s with needs to be Patient and understanding And supportive. PRIDE MONTH MEANS SOMETHING DIFFERENT FOR ME TO ME ITS A MOTHERS LOVE FOR HER CHILD AND PRIDEFUL THAT SHES ALWAYS KNEW WHIS SHE WAS AND WHAT SHE WANTS SHES SO STRONG AND HAS A HUGE HEART SHES SUCH AN OLD SOUL WITH A GIFT FOR NURTURING SHE HAS A GIFT FOR Making anyone feel better during a emotionally draining experience when you are sad or devastated her presence around you you automatically feel better that child has sVed me more times than I can count ❤️ by just simply being there!! I’m so of the woman she has become. So this is my Gift to her to show her how proud of her I am for her being so strong and not caring about what others think So my strong willed flamboyant child is getting a Rainbow cake for Pride month in honor of her coming out of the closet!!
I’m not understanding what the sour cream is for. The directions say to mix all ingredients together according to box directions, but box direction don’t require sour cream? If you could clarify it would be appreciated. I am making this for my daughters 4th Birthday party this weekend. Thank you!
HI Kerry! The sour cream is for moistness. I think it give it a little more flavor as well. You could leave it out if you choose. Good luck!
This looks so easy, thanks for sharing. I want to make one for the kids and surprise them!
wow! look at that… i will defintely make this cake for my nephews on thier next birthday.
I just thought about making an “house cake” with a red roof and green windows 🙂
Looks Yummy! My kids would get a kick out of this.
Hi Kasey, thanks for the idea, I always try to think of a cool cake for the kids that won’t be super difficult to made. By the way do you use any special coloured gels?
HI Jo! Yes, I use the food coloring gels from Wilton. They always turn out bright and colorful.
Wow, I want to make one of these 😀
You should, Robin! They are yummy, too!
Goregous cake!
Thank you, Louise!