This post may contain affiliate links. Read our privacy policy.
This moist and delicious 4th of July Cake (also known as Flag Cake) features a moist vanilla cake with a light and fluffy whipped cream topping with fresh berries. It’s the loveliest patriotic treat for celebrating Independence Day!

Looking for the easiest, dreamiest 4th of July Cake that can easily be made gluten-free? You’ll love this festive combination of flavors!
We’re going for a classic vanilla cake (or yellow cake) that turns out so moist, fluffy, and perfectly sweet.
I like using classic homemade whipped cream as the frosting because it is light and less sweet. Plus, I find whipped cream and berries to be a part of traditional 4th of July desserts.
If you prefer classic vanilla frosting, vanilla butter cream, or cream cheese frosting, feel free to make the switch!
The light summery flavors come together magically, and the whole thing is so simple to prepare! To me, it turns out much better than boxed cake and doesn’t require much more time to make.
Ingredient Notes:
Flour: Use gluten-free all-purpose flour or regular all-purpose flour as the base of the cake. It creates a light and fluffy texture.
Eggs: A few eggs give rise to the batter so that the cake reaches its fluffiest potential.
Milk: Pick your favorite kind of milk. Stick with a higher fat milk, such as whole milk, half & half, or full-fat canned coconut milk for the moistest texture. Any non-dairy milk works too, including almond milk, oat milk or cashew milk.
Avocado Oil: Here for the moist crumbs, oil brings richness and sultry moisture to the cake. I like using avocado oil due to its omega-3 fatty acid content and neutral flavor.
Granulated Sugar: Use cane sugar or your favorite sugar-free sweetener. I use allulose, which is sugar-free, to keep the cake lower in carbohydrates but still tasting sweet.
Baking Powder and Baking Soda: The leavening agents here. Baking powder and baking soda help the batter rise, bake evenly and generate the absolute best texture. The cake won’t be the same without it!
Sea Salt: A little salt enhances the sweet and vanilla flavor. Don’t skip it!
Pure Vanilla Extract: The source of the vanilla flavor. I recommend selecting a high quality vanilla extract for the best tasting results. You can even go a little heavier on it (1 tablespoon + 1 to 2 teaspoons) for extra vanilla flavor.
American Flag Cake Topping:
Heavy Whipping Cream: The base of the frosting. I love the lightness the whipped cream brings and the fact that the cake doesn’t turn out overly sweet.
Powdered Sugar: Used to sweeten the whipped cream topping. To be transparent, I don’t add powdered sugar because I love whipped cream on its own without a sweetener. Feel free to reduce or increase the amount of confectioners’ sweetener to your personal taste.
Vanilla Extract: Brings a lovely vanilla essence to the whipped cream to enhance the experience.
Fresh Blueberries: Blueberries are used to mimic the stars of the flag. They also bring their little berry pops of freshness which I find so tasty!
Fresh Strawberries: Juicy ripe strawberries serve as the red stripes of the flag. I love the berry freshness they bring too! You can do rows of raspberries instead of strawberries if you prefer.

Recipe Adaptations:
- To save time, you can use yellow boxed cake mix and cool whip. I personally prefer my homemade version, but I’m also a big fan of saving time!
- Rather than arranging the berries like a flag, you can arrange them in the center of the cake, or however you think looks good. You can also go with other kinds of fresh fruit, including kiwi, oranges, bananas, etc.
Recipe Tips
- If you’re going for clean slices of cake, I recommend using a classic buttercream frosting or cream cheese frosting. The whipped cream frosting makes slightly messier slices, which is fine by me because I love the touch the whipped cream brings.
- For even more berry flavor, you can make a strawberry filling to swirl inside of the vanilla cake.
How to Make a 4th of July Cake:
Make the Vanilla Cake:
Preheat the oven to 350 degrees Fahrenheit and spray a 13” x 9” baking pan or casserole dish with cooking spray.
Add the flour, sugar, salt, baking powder, and baking soda to a large bowl and mix to combine the dry ingredients.

In a separate bowl, Whisk the avocado, milk, eggs, and vanilla extract together to combine the wet ingredients.

Pour the dry ingredients into the bowl with the wet ingredients and mix well until a smooth batter forms.

Pour the cake batter into the prepared baking dish and spread it into an even layer.
Bake on the center rack of the preheated oven for 30-40 minutes (mine takes 30), or until the cake tests clean. Insert a digital thermometer into the center of the cake. If it is 190 degrees or higher (ideally 190 to 205 max), it is ready.

Remove the cake from the oven and place it on a wire rack to cool. Let the cake cool to room temperature before frosting it.
Frost and Decorate the Cake:
Pour the heavy whipping cream into the bowl of a stand mixer fitted with the whisk attachment.
Whisk on low speed for 1 minute, until the cream is bubbly, then increase the speed to medium or high speed and continue whisking for another 2 to 4 minutes, or until soft to stiff peaks form.

Spread the whipped cream over the cooled cake in an even layer.
Press 4 to 5 rows of blueberries in the upper left corner of the top of the cake to make the star portion of the American flag.
Thinly slice fresh strawberries and lay them into vertical layers with plenty of overlapping to create the stripes of the flag.

Slice the cake using a sharp knife and a spatula to lift the slices out of the cake pan. Note that the slices will be slightly messy given the soft nature of whipped cream. You can always sprinkle more fresh blueberries or slices strawberries on top of each slice or use a butter knife to clean up the whipped cream.
Storage Options:
- Room Temperature: Cover the cake pan with plastic wrap and store on the counter for up to 2 days.
- Refrigerator: Store in an airtight container or in the cake pan wrapped in plastic wrap for up to 5 days.
- Freezer: Transfer leftover cake to a freezer-safe container and freeze for up to 3 months.
And that’s it!
A refreshing and light cake that’s perfect for celebrating the 4th of July.
This festive dessert doesn’t have to be reserved as a fourth of July cake, as you can easily make it for all special occasions. It is a great option for Memorial Day too and is a perfect dessert to enjoy throughout the summer.

If you’re looking for more summery dessert recipes, try out these gems!
More Summertime Desserts:
- Frozen Yogurt Bites
- No-Bake S’mores Bars
- 3-Ingredient No-Churn Vanilla Ice Cream
- Cottage Cheese Cheesecake
- Gluten-Free Strawberry Cobbler
4th of July Cake

Ingredients
- 2 ⅓ cups (320g) gluten-free all-purpose flour , or regular all-purpose flour
- 1 ½ cups (330g) granulated sugar
- 1 tsp sea salt
- 2 tsp baking powder
- 1/4 tsp baking soda
- 3/4 cup (175ml) avocado oil
- 1 cup (225ml) whole milk , or full-fat canned coconut milk
- 3 large eggs
- 1 Tbsp pure vanilla extract
Topping:
- 1 cup heavy cream
- 2 Tbsp powdered sugar
- ½ tsp pure vanilla extract
- Fresh blueberries
- Fresh strawberries, sliced
Instructions
Make the Vanilla Cake:
- Preheat the oven to 350 degrees Fahrenheit and spray a 13” x 9” baking pan or casserole dish with cooking spray.
- Add the flour, sugar, salt, baking powder, and baking soda to a large bowl and mix to combine the dry ingredients.
- In a separate bowl, Whisk the avocado, milk, eggs, and vanilla extract together to combine the wet ingredients.
- Pour the dry ingredients into the bowl with the wet ingredients and mix well until a smooth batter forms.
- Pour the cake batter into the prepared baking dish and spread it into an even layer. Bake on the center rack of the preheated oven for 30-40 minutes (mine takes 30), or until the cake tests clean. Insert a digital thermometer into the center of the cake. If it is 190 degrees or higher (ideally 190 to 205 max), it is ready.
- Remove the cake from the oven and place it on a wire rack to cool. Let the cake cool to room temperature before frosting it.
Frost and Decorate the Cake:
- Pour the heavy whipping cream into the bowl of a stand mixer fitted with the whisk attachment. Whisk on low speed for 1 minute, until the cream is bubbly, then increase the speed to medium ot high speed and continue whisking for another 2 to 4 minutes, or until soft to stiff peaks form.
- Spread the whipped cream over the cooled cake in an even layer.
- Press 4 to 5 rows of blueberries in the upper left corner of the top of the cake to make the star portion of the American flag.
- Thinly slice fresh strawberries and lay them into vertical layers with plenty of overlapping to create the stripes of the flag.
- Slice the cake using a sharp knife and a spatula to lift the slices out of the cake pan. Note that the slices will be slightly messy given the soft nature of whipped cream. You can always sprinkle more fresh blueberries or slices strawberries on top of each slice or use a butter knife to clean up the whipped cream.
Nutrition
Nutrition information is automatically calculated, so should only be used as an approximation.
Like this recipe? Rate and comment below!













