Rainbow cupcakes recipe

(1176 ratings)

Rainbow cupcakes are a wonderful colour treat for birthdays, picnics or bake sales and they are very easy to make.

rainbow cupcakes with buttercream frosting on a plate
(Image credit: Future)
Preparation Time20 mins
Cooking Time25 mins
Total Time45 mins
Cost RangeCheap
Nutrition Per PortionRDA
Calories633 Kcal32%
Sugar69.3 g77%
Fat32.7 g47%
Saturated Fat16.4 g82%
Protein3.7 g7%
Carbohydrates81.5 g31%

Our rainbow cupcakes are easy to make with kids and only take 45 minutes from start to finish. 

You can use our basic cupcake recipe and then divide into bowls before adding your chosen colours or use a box of cake mix instead. We like the subtle vanilla flavour but you can omit this if you like. These cupcakes are an indulgent bake at 633 calories but you can serve them as dessert or as an occasional treat.


  • 150g caster sugar
  • 150g butter
  • 130g self-raising flour
  • 20g cornflour
  • 3 medium eggs
  • 30ml semi-skimmed milk
  • 1tsp vanilla extract
  • Purple, blue, green, yellow, orange and red food colouring

For the icing:

  • 500g icing sugar
  • 250g unsalted butter
  • 1tsp vanilla extract
  • 3tbsp semi-skimmed milk
  • Hundreds and Thousands sprinkles, to decorate




  • Heat your oven to 160C (140C fan, Gas 3). Line a cupcake tin with paper cases.
  • Beat the sugar and butter with the vanilla essence until light and fluffy. Add 1 egg, a third of the flour, and a splash of milk and beat until just combined and repeat until all the ingredients are used up.
  • Add two ice cream scoops of the cake batter to a ziplock bag, then add food colour to each one, adding more if required, and massage until you have the desired colour. You could also mix the colours in individual bowls.
  • Starting with either red or purple, snip the corner of the bag off and squeeze a layer covering the bottom of the cupcake cases. Repeat with the remaining colours until all the cake batter has been added.
  • Use a toothpick to move the batter around. This helps create a marbled effect.
  • Bake in the oven for 20 - 25 minutes until the cupcakes are risen and spring back when lightly pressed on top. Remove and cool in the tins for 10 minutes before moving to a wire cooling rack.
  • For the buttercream: Put the icing sugar, butter, vanilla extract and milk into a large bowl and beat until smooth and shiny.
  • Once the rainbow cakes are cool, spread or pipe onto the tops of the cupcakes. Decorate with rainbow sprinkles, if using.

Watch how to make rainbow cupcakes 

Top tips for making rainbow cupcakes

Instead of making the cupcake batter from scratch you can use a box of cake mix. If using a 425g box you can expect to make around 16 cupcakes. Follow the instructions on the box for baking guidelines. Please note the nutrition will vary.

We recommend using gel-based food colours because they provide a more intense finish. Remember the colour will likely dull a little after cooking. Liquid food colouring may affect the consistency of your cake batter. For more tips to help you make the best rainbow cupcakes, continue reading below. 

How do you pipe swirls of icing?

You will need to use a piping bag fitted with a star nozzle. We use a Wilton 1M tip but use whatever you have. Start in the centre of the cupcake and work outwards to the paper, using this as a guide, follow it round and build up into a swirl. To finish, push down slightly and pull up quickly. Read our guide on how to ice cupcakes for more inspiration and designs.

Can you freeze rainbow cupcakes?

You can freeze these cupcakes once baked and cooled. The cupcakes must not be decorated with buttercream if you want to freeze them. Wrap in clingfilm and freeze for a couple of months. Defrost in the fridge or at room temperature and gently reheat if you like or eat as it is. 

How do you arrange cupcakes into rainbows?

Instead of cooking marbled cupcakes you could bake different coloured cupcakes and then arrange in a rainbow shape. You might need to double the quantity of cakes you make so you have enough to achieve the desired shape and design.

Once the cupcakes are baked and cooled, arrange the blue cakes in a small semicircle. Then working outwards, line up the green cupcakes around the blue. Add the yellow cupcakes to the outside of the green cakes and then repeat with orange and red.

The secret to great cupcakes is beating the sugar and butter together until pale and fluffy. Using an electric hand mixer is the easiest way to do this. 

Kenwood Hand Mixer - View at John Lewis

Kenwood Hand Mixer - View at John Lewis 

This mixer is perfect for making cakes and cupcakes but thanks to the dough hook attachment you can also use when making bread or pizza dough. It’s lightweight and compact and the attachments can be washed in the dishwasher if you like. 

If you prefer something simpler, try our vanilla cupcake recipe. This chocolate cupcakes recipe is perfect for those that love chocolate cake or our mini cupcakes are almost too cute to eat! 

Rosie Conroy
Food Writer

Rosie is an experienced food and drinks journalist who has spent over a decade writing about restaurants, cookery, and foodie products. Previously Content Editor at Goodto.com and Digital Food Editor on Woman&Home, Rosie is well used to covering everything from food news through to taste tests. Now, as well as heading up the team at SquareMeal - the UK's leading guide to restaurants and bars - she also runs a wedding floristry business in Scotland called Lavender and Rose.