A rainbow cake does not need a complicated sponge. The useful trick is to start with one reliable vanilla batter, divide it accurately, colour each portion, then bake the layers evenly. This version uses oil and yoghurt for a soft, tender crumb and Swiss meringue buttercream for a clean finish.
If you want the finished cake rather than the washing-up, browse our Rainbow Cakes. For more home-baking recipes, see our Recipes & Baking Guides.
Rainbow Layer Cake Recipe
Makes: five 6-inch sponge layers.
Ingredients
- 380g caster sugar
- 120ml neutral oil, such as vegetable or sunflower oil
- 3 medium eggs
- 1 tablespoon vanilla extract
- 120g plain yoghurt
- 350g plain flour, sifted
- 3 teaspoons baking powder
- 1 teaspoon fine salt
- 300ml whole or semi-skimmed milk
- Gel food colours: pink, yellow, green, blue and purple
Method
- Heat the oven to 170°C. Grease and line five 6-inch round cake tins. If you do not own five identical tins, bake in batches using cooled, re-prepared tins rather than leaving some batter sitting for a very long time.
- Whisk the eggs, oil and sugar until evenly combined. Stir in the yoghurt.
- Add the flour, baking powder, salt, milk and vanilla. Mix only until no dry pockets remain.
- Weigh the finished batter and divide it equally between five bowls. Weighing gives more even layers than judging by eye.
- Colour each bowl pink, yellow, green, blue or purple. Add gel colour gradually; a little goes a long way and excessive liquid colour can alter the batter.
- Transfer each colour to its prepared tin and bake for about 20 to 25 minutes. Start checking early. A layer is ready when it springs back lightly and a skewer inserted through the centre comes out without wet batter.
- Cool in the tins for 10 minutes, then turn onto racks and cool completely before stacking.
Swiss Meringue Buttercream
Ingredients
- 150g egg whites
- 225g granulated sugar
- 300g unsalted butter, softened but not greasy
- 1 teaspoon vanilla extract
- Pinch of salt
- Gel food colours, optional
Use our Swiss meringue buttercream method. Heat the egg whites and sugar to 71°C on a digital thermometer before whipping. Once the buttercream is finished, keep most of it white and colour small portions if you want piped rainbow details.
Assembling the Rainbow Cake
- Secure the purple layer to an 8-inch cake board with a small dab of buttercream.
- Spread an even layer of buttercream over it, then stack the blue, green, yellow and pink layers with buttercream between each.
- Apply a thin crumb coat over the top and sides and chill until firm.
- Add the final coat of buttercream and smooth it with a scraper or palette knife.
- Finish with coloured buttercream, sprinkles, macarons or other decorations if you like. Check packaged decorations for relevant allergen information before serving.
Storage and Serving
Keep the finished cake covered and cool. If it is refrigerated, allow it to come back towards room temperature before serving so the sponge softens and the buttercream becomes silky again. If you add cream cheese, custard, whipped cream, fresh cream or another perishable filling, refrigerate according to that ingredient rather than treating all rainbow cakes the same.
Can I Substitute the Yoghurt?
Buttermilk is a sensible alternative because it brings acidity and moisture. A homemade soured-milk mixture can work in some cakes, but it is not chemically identical to cultured yoghurt or buttermilk, so use it as a fallback rather than assuming every substitution is interchangeable.
The colour is the theatre; the sponge still has to taste good. Keep the batter simple, divide it accurately and stop baking as soon as the layers are done.












Thank you so much for sharing this recipe. It looks amazing! I can’t wait to try making it for my twins Christening in next week. Fingers crossed it looks and tastes half as decent as yours.