This Flag Cake for the 4th of July is the perfect patriotic dessert using fresh summer berries for topping a rich and decadent blueberry sheet cake. Make a homemade buttercream for the richest bite. It’s a showstopper for any backyard barbecue, picnic, or gathering.

I love hosting a big July 4th barbecue every summer and this Flag Cake is what everyone looks forward to as the dessert at the end of the cookout. I make an easy homemade cake batter that I love stirring frozen blueberries into for a fun fruity surprise in each bite.
Then I top the cake with a homemade buttercream that’s just 4 ingredients. It makes the flavor truly bakery-quality and it’s so simple to do. The flag design on top is so pretty and is foolproof for any level of baker! Serve it with Pickle Fried Chicken and Macaroni and Cheese for a menu that will have everyone coming back for seconds.
Why You’ll Love this Recipe
- Festive centerpiece dessert for any party. Perfect for any summer holiday celebration as a showstopper treat.
- Fun for kids to decorate. It’s a great dessert for kids to help with the baking too before a big party.
- Easy to make ahead of time to keep dessert time stress-free. Make the flag cake the day before, then frost and decorate a few hours before the party.

Ingredients
For the Cake:
- All-purpose flour: Base to the cake batter for structure.
- Baking powder: Helps the cake batter rise for a light and tender texture.
- Salt: Add a pinch to help bring out all the other flavors of the cake.
- Butter: The base fat for the cake batter, make sure it’s softened for even mixing.
- Sugar: Sweetens the cake batter nicely.
- Egg: Binds the cake batter together.
- Milk: Adds creaminess and moisture.
- Frozen blueberries: Do not thaw the blueberries before adding them to the cake batter.
- Fresh strawberries: Make sure they are bright red for the best flavor.
- Fresh blueberries: Used for garnish on top for making the flag shape.
For the Vanilla Icing:
- Unsalted butter: Softened base of the vanilla icing.
- Powdered sugar: Beat into the butter to sweeten it to make a classic buttercream.
- Vanilla extract: A drop of pure vanilla adds caramel and floral notes.
- Milk: Helps to thin the buttercream to the correct texture.
How to Make 4th Of July Cake
- Heat the oven to 375 F, and generously grease a 9-inch square or round pan. Combine the flour, baking powder, and salt in a small bowl, and stir with a fork to mix well. In a medium bowl, combine the butter and sugar, and beat with a mixer at high speed until well combined. Add the egg and beat well for 1 to 2 minutes, stopping to scrape down the bowl, until the mixture is smooth and light.

2. Stir in half the flour mixture, and then half the milk, mixing just enough to keep the batter fairly smooth and well combined. Add the remaining flour, and then the milk, mixing gently. The batter will be very thick. Gently fold in the frozen blueberries.

3. Pour the batter into your greased pan and spread out evenly. Place in the oven and bake at 375 F for 30 to 35 minutes, or until the cake is puffed up and golden.

4. Remove from the oven and let it cool in the pan.

5. To prepare the icing- In the bowl with a hand mixer or in a stand mixer with the paddle attachment add the 1 cup butter and mix on low-medium speed for 30 seconds-1 minute.
6. Stop the mixer, add in the 3 cups of powdered sugar, and turn the dial to the lowest mixing setting so powdered sugar doesn’t blow up in your face. Move to a medium speed when the sugar is more incorporated. Mix for 2 minutes.
7. Stop the mixer and add in the 1 tsp vanilla extract and 2 tsp cream. Mix on medium-high speed for 1 minute-2 minutes.
8. The icing should have stiff peaks, and hold its shape, not runny at all. Add the icing on top of your cooled cake and decorate with the icing as you wish.
9. To create the flag design, trim caps from strawberries and slice in half.
10. Place blueberries in rows in the top left corner of the cake, filling a space half way across and about 1/3 of the way down the surface of the cake.
11. Arrange the strawberries in rows, covering the remaining open surface of the cake. Put similar sizes and shapes of strawberries together to make defined rows, leaving a little space between rows for the white stripes.
12. Reserve extra berries for fruit salad, smoothies and snacks. Cut into squares and serve.

Expert Tips
- Do not thaw the frozen blueberries before mixing into the cake. If you do, then they will leak juices and bleed into the batter making it messy and muddied in color.
- Always cool the cake completely before frosting. If you don’t, then the buttercream will melt, making the cake very messy.
- Drain the strawberries of excess liquid after cutting in half. This helps to avoid the berry juice from dripping down the buttercream which will change the buttercream color.
- Don’t overmix the cake batter. It will make the cake dense in texture and potentially gummy.
- If the frosting is too thick, add a teaspoon or two of more milk. If it’s too thin, add more powdered sugar and re-whip.
Storage
Store any leftover cake in an airtight container in the fridge for up to 2 days. I recommend removing the berries if possible to prevent them from softening and bleeding into the cake.
If you want to freeze cake slices, make sure you remove the fruit then freeze for up to 2 months. Thaw overnight in the fridge until soft and ready to eat.
You can make the buttercream in advance if desired and keep it in the fridge for a day covered with plastic wrap. Let it sit out for an hour or so before frosting and re-mix if needed.

FAQs
Make a sheet cake as the base, usually with vanilla cake. Top the cake with frosting and arrange blueberries and strawberries into a flag design.
Vanilla icing or buttercream works best. You can make it homemade or use store-bought.
Yes, you can use strawberries, raspberries, blueberries and blackberries to make the flag design.
More Easy Dessert Recipes

July 4th Flag Cake
Ingredients
Method
- Heat the oven to 375 F, and generously grease a 9-inch square or round pan. Combine the flour, baking powder, and salt in a small bowl, and stir with a fork to mix well. In a medium bowl, combine the butter and sugar, and beat with a mixer at high speed until well combined. Add the egg and beat well for 1 to 2 minutes, stopping to scrape down the bowl, until the mixture is smooth and light.
- Stir in half the flour mixture, and then half the milk, mixing just enough to keep the batter fairly smooth and well combined. Add the remaining flour, and then the milk, mixing gently. The batter will be very thick. Gently fold in the frozen blueberries.
- Pour the batter into your greased pan and spread out evenly. Place in the oven and bake at 375 F for 30 to 35 minutes, or until the cake is puffed up and golden.
- Remove from the oven and let it cool in the pan.
- To prepare the icing- In the bowl with a hand mixer or in a stand mixer with the paddle attachment add the 1 cup butter and mix on low-medium speed for 30 seconds-1 minute.
- Stop the mixer, add in the 3 cups of powdered sugar, and turn the dial to the lowest mixing setting so powdered sugar doesn’t blow up in your face. Move to a medium speed when the sugar is more incorporated. Mix for 2 minutes.
- Stop the mixer and add in the 1 tsp vanilla extract and 2 tsp cream. Mix on medium-high speed for 1 minute-2 minutes.
- The icing should have stiff peaks, and hold its shape, not runny at all. Add the icing on top of your cooled cake and decorate with the icing as you wish.
- To create the flag design, trim caps from strawberries and slice in half.
- Place blueberries in rows in the top left corner of the cake, filling a space half way across and about 1/3 of the way down the surface of the cake.
- Arrange the strawberries in rows, covering the remaining open surface of the cake. Put similar sizes and shapes of strawberries together to make defined rows, leaving a little space between rows for the white stripes.
- Reserve extra berries for fruit salad, smoothies and snacks. Cut into squares and serve.