Star Wars Galaxy Cake
This Star Wars Galaxy Cake is the birthday cake I turn to when you want something that looks like it came from a galaxy far, far away, but still tastes like a classic vanilla party cake. No complicated tools, just a soft sheet cake and swooshy buttercream that hides any imperfections.

The dark buttermilk crumb stays moist for days, and the vanilla frosting is just sweet enough to balance it. You can pull it together in an afternoon, and the decorating part is genuinely forgiving, swirls always look better than you think they will.
Why This Galaxy Cake Works
The cake itself is a straightforward buttermilk slab that’s hard to mess up. The crumb is tender and even, so it slices cleanly for a crowd.
The buttercream is where the galaxy thing happens. You tint one batch of frosting a few different shades, then swirl them right on the cake. There is no piping, no stencils, and no special skill needed. Just a small offset spatula and maybe a toothpick. The result is a dark, moody swirl that looks impressive with very little effort.
Ingredients

For the cake
- 2 ½ cups all-purpose flour: spooned and leveled, not scooped.
- 1 ¾ cups granulated sugar
- 2 tsp baking powder
- ½ tsp baking soda
- ½ tsp fine sea salt
- 1 cup whole buttermilk, at room temperature: the tang keeps the cake moist.
- ½ cup vegetable oil or other neutral oil
- 3 large eggs, at room temperature
- 2 tsp vanilla extract
For the galaxy buttercream
- 2 cups unsalted butter, softened: a full pound, really.
- 8 cups powdered sugar: sifted if it’s lumpy.
- ¼ cup whole milk, plus more as needed
- 2 tsp vanilla extract
- Black gel food coloring
- Royal blue gel food coloring
- Purple gel food coloring
- Pink gel food coloring: (or fuchsia)
- Star sprinkles: silver or gold, and maybe a few edible glitter stars.
Variations / Substitutions
- Make it chocolate: swap ½ cup of the flour for cocoa powder and use hot coffee instead of buttermilk for a richer chocolate cake.
- Dairy free: use unsweetened almond milk with a teaspoon of lemon juice in place of buttermilk, and a good vegan butter stick for the frosting. The buttercream won’t be quite as fluffy, but the swirl still works.
- Box mix shortcut: a 15.25 oz box of white or yellow cake mix works just fine. Follow the package directions, then proceed with the galaxy frosting.
- Extra galaxy drama: dust a little edible silver luster dust over the swirls before adding the star sprinkles.
If you want a completely different theme, the vanilla cake and buttercream base also make a great Funfetti birthday cake.
How to Make Star Wars Galaxy Cake
Step 1: Mix the Cake Batter

Preheat the oven to 350°F (175°C) and grease a 9×13-inch metal baking pan, then line the bottom with parchment. In a large bowl, whisk together the 2 ½ cups flour, 1 ¾ cups sugar, 2 teaspoons baking powder, ½ teaspoon baking soda, and ½ teaspoon salt. In a separate bowl or a large measuring cup, whisk the 1 cup buttermilk, ½ cup oil, 3 eggs, and 2 teaspoons vanilla until smooth. Pour the wet ingredients into the dry and whisk just until you don’t see any dry pockets. A few small lumps are fine, overmixing will make the cake tough.
The batter will be thin and pale yellow, which is exactly what you want. You are looking for a smooth, pourable consistency that settles evenly in the pan.
If your buttermilk and eggs are straight from the fridge, the batter may look slightly curdled. That will smooth out in the oven. Room temperature ingredients just make the mixing a little easier, so pull them out about 30 minutes before you start.
Step 2: Bake the Cake

Pour the batter into the prepared pan and spread it to the edges with a spatula. Bake on the middle rack for 28 to 32 minutes, until the top is golden and a toothpick inserted in the center comes out with a few moist crumbs clinging to it. Start checking at 28 minutes.
The cake will rise evenly and the edges will just start to pull away from the sides of the pan. If you press lightly in the center, it should spring back rather than leaving a dent.
Do not open the oven door during the first 20 minutes. A rush of cooler air can cause the center to sink. Trust the timer, then check.
Step 3: Whip the Buttercream

While the cake cools completely in the pan on a wire rack, make the frosting. In a stand mixer fitted with the paddle, beat the 2 cups softened butter on medium speed for about 2 minutes until it’s pale and creamy. Turn the speed to low and gradually add the 8 cups of powdered sugar, a cup or two at a time. Scrape down the bowl, add ¼ cup milk and 2 teaspoons vanilla, then beat on medium for another 2 minutes until the frosting is light and fluffy.
If the buttercream feels too stiff, drizzle in another tablespoon of milk. If it’s too soft, add a little more powdered sugar. You want a spreadable consistency that holds a swoop.
Butter temperature matters most here. If the butter is too cold, the frosting will be lumpy. If it is too soft and greasy, the whole batch can slide off the cake. The butter should give a little when you press it but still hold its shape.
Step 4: Frost the Cake

Once the cake is completely cool, run a knife around the edges and turn it out onto a serving board or large plate. Peel off the parchment. Place a few small pieces of parchment under the edges of the cake to keep the board clean. Spread a thin crumb coat of plain white buttercream over the top and sides, just enough to seal in any crumbs. Chill the cake in the fridge for 15 minutes while you divide and tint the remaining frosting.
This crumb coat does not need to be perfect. It’s just a sticky barrier. The cold surface will make the galaxy swirls easier to spread later.
Step 5: Create the Galaxy Swirl

Divide the remaining buttercream into four small bowls. Tint one bowl deep black with the black gel food coloring, one royal blue, one purple, and one pink. The black will take the most color, so add it a little at a time until you get a true dark shade rather than gray. Using an offset spatula, drop spoonfuls of all four colors randomly over the top and sides of the chilled cake. Then gently spread and swirl the colors together. Don’t overblend, let the individual tones show through. Scatter the star sprinkles across the top while the frosting is still soft.
You are going for messy, streaky swoops that look like space. As you spread, the black will dominate and the other colors will peek through. Take a toothpick and drag through any areas that need a little more motion.
If a spot looks muddy, drop a fresh dollop of bright blue or pink right on top and give it one gentle swipe. The contrast makes the galaxy effect pop. Step back, admire it, and serve the cake right away or let it sit at room temperature for up to a few hours.
Tips for the Best Galaxy Effect
- Gel food coloring gives the truest dark colors. Liquid drops will make the frosting too runny and won’t get nearly as black or vivid.
- Chill the crumb-coated cake well. A cold surface stops the colored buttercream from sliding around and muddying the swirls.
- Work fast once the tinted frosting is on the cake. Buttercream sets up quickly, and you get the smoothest swooshing motion in the first couple of minutes.
- Star sprinkles go on last while the frosting is tacky. If you wait too long, they will not stick.
Bake times by pan:
| Pan size | Bake time (same 350°F) |
|---|---|
| 9×13-inch metal | 28–32 mins |
| Two 8-inch round pans | 25–28 mins |
| Three 6-inch round pans | 22–25 mins |
Storing Leftover Cake
- Refrigerate: Cover the cake tightly and store in the fridge for up to 4 days. The buttercream firms up nicely, and the cake stays moist.
- Reheating: No reheating needed. Let refrigerated slices sit at room temperature for about 20 minutes before serving to soften the frosting.
- Serve Cold: I actually like it cold from the fridge on day two, the frosting gets almost fudgy against the soft cake.
Frequently Asked Questions
Can I use black cocoa powder instead of black food coloring?
Yes, you can substitute a few tablespoons of black cocoa powder for some of the powdered sugar in the black-tinted portion. It gives a natural dark color and a mild chocolate taste, though the swirls won’t be as stark black as gel coloring.
How do I keep the frosting from turning gray?
Add a tiny amount of royal blue gel coloring to the black frosting bowl. Blue counteracts any warm tones and helps you reach a deep black shade without using a whole bottle of black.
Can I make the cake the night before?
You can bake the cake up to one day ahead. Wrap it tightly once cooled and keep it at room temperature. Make the frosting and decorate the day you serve for the freshest look.
My buttercream looks greasy and separated, what happened?
Usually the butter was too soft or the mixer ran too long. Pop the whole bowl in the fridge for 10 minutes, then beat it again on low. It should come back together smoothly.
What if I don’t have a 9×13-inch pan?
Use two 8-inch round pans for a layer cake. Just split the frosting and stack them, then do the galaxy swirl on the top and sides as normal. The bake time is shorter, see the table above.

Star Wars Galaxy Cake Recipe
Ingredients
Method
- Preheat oven to 350°F. Grease a 9×13-inch metal pan, line with parchment. Whisk together flour, sugar, baking powder, baking soda, and salt. In a separate bowl, whisk buttermilk, oil, eggs, and vanilla. Combine wet and dry, stir just until smooth.
- Pour batter into pan, spread evenly. Bake 28 to 32 minutes until golden and a toothpick comes out with moist crumbs. Cool completely on a wire rack.
- Beat butter until pale. Gradually add powdered sugar, then milk and vanilla. Beat until fluffy. Set aside about 1 cup of plain white buttercream for the crumb coat.
- Once cake is cool, turn out onto a board. Crumb coat with the reserved white buttercream and chill 15 minutes. Divide remaining frosting and tint black, royal blue, purple, and pink with gel colors.
- Spoon dollops of colored frosting all over the cake and gently swirl with an offset spatula. Leave streaks visible. Scatter star sprinkles on top while frosting is tacky. Serve at room temperature.
