This post may contain affiliate links. Please read our disclosure policy.

This flag cake comes out every 4th of July at my house, and at this point, my family would notice if it didn’t show up.

American flag cake decorated with strawberries, blueberries and piped cream cheese frosting on a sheet pan surrounded by fresh berries and American flag picks.
Want to save this recipe?
Enter your email below and we’ll send the recipe straight to your inbox (and more recipes sent daily!)

I’ve made a lot of flag cakes over the years. What I kept coming back to was the frosting. I wanted something that would hold its shape in the heat, pipe into clean stripes and stars without deflating, and not feel heavy by the time dessert rolled around at the end of the night. A pudding and whipped topping frosting does all of that in a way a traditional cream cheese base doesn’t.

The frosting is what makes this version different. A pudding and whipped topping combination is not something you usually see on a from-scratch cake, and that’s the whole point.

The pudding thickens the frosting just enough to hold its shape for piping, while the whipped topping keeps it airy. It doesn’t taste heavy. It tastes like summer.

If you’re building out your 4th of July dessert spread, my 4th of July Trifle is another crowd-pleaser that can be made ahead. And my 4th of July Desserts roundup has even more red, white, and blue ideas for the whole table.

Why This Recipe Works

A flag cake has specific demands. It needs to serve a crowd, look intentional, and hold up when it’s sitting outside at a backyard party in July. The half sheet pan solves the crowd problem. You get more surface area for the flag design and more slices without the cake feeling thin or sparse.

The pudding frosting is what I keep coming back to. It thickens just enough to pipe cleanly and hold its shape without getting stiff or heavy. Cream cheese frosting softens fast in the heat. This one holds. That’s why the design still looks sharp when you’re finally cutting into it at the end of the night.

American flag cake ingredients.

key Ingredients

  • Buttermilk. I use buttermilk here and it’s not negotiable. The acid reacts with the baking powder and tenderizes the crumb in a way regular milk won’t. It’s worth picking up a carton.
  • Sour cream and vegetable oil. I use both, and they work as a team. The oil keeps the crumb moist even after the cake cools to room temperature. The sour cream adds a quiet richness and helps the butter and sugar cream properly. Both stay in.
  • Instant vanilla pudding mix. This is the ingredient that makes the frosting work the way it does. The pudding thickens the cold milk into a base that holds its shape without being stiff. You end up with a frosting that spreads smoothly, pipes into clean lines and stars, and doesn’t weigh down the fruit. I’ve also made this with white chocolate and cheesecake flavored instant pudding and both work.
  • Whipped topping, fully thawed. I move mine from the freezer to the fridge the night before. If it’s still partially frozen when it goes into the frosting, it won’t fold in evenly and you’ll end up with lumps. Completely thawed is the only way this works.
  • Whole milk, very cold. Take it straight from the fridge when you’re ready to make the frosting. Warm milk won’t let the pudding thicken the way it needs to.
  • Fresh berries, large and uniformly sized. I shop for the biggest, most evenly sized berries I can find, and it makes a real difference. When the blueberries are all roughly the same size, the rows sit evenly. When the strawberry halves are consistent, the stripes line up cleanly.
american flag cake with fireworks.

How to Make Flag Cake

Make the Cake

Step 1: Prep the pan. Preheat the oven to 350°F. Lightly spray a 12x17x1-inch half sheet pan with nonstick baker’s spray and set it aside.

Step 2: Sift the dry ingredients. Sift together 2 1/2 cups all-purpose flour, 2 teaspoons baking powder, and 1/2 teaspoon salt into a medium bowl. Set aside.Hands sifting flour into a glass bowl over a marble surface.

Step 3: Cream the butter and sugar. In the bowl of a stand mixer fitted with the paddle attachment, beat 1 3/4 cups granulated sugar and 3/4 cup room-temperature unsalted butter on medium-high speed for 4 to 5 minutes, until very light and fluffy. I set a timer for this one. The full creaming time is what gives you a light crumb, don’t cut it short.

Step 4: Add the eggs and vanilla. Reduce the speed to low and add 3 large room-temperature eggs one at a time, followed by 1 tablespoon of vanilla extract. Let each egg fully incorporate before adding the next, and scrape the bowl as needed. The batter may look slightly curdled at this point – that’s normal.

Step 5: Add the sour cream and oil. Add 1/2 cup sour cream and 1/4 cup vegetable oil. Mix on low speed until fully combined.Whipped eggs and sugar mixture in a stand mixer bowl.

Step 6: Alternate the flour and buttermilk. With the mixer on low, add the flour mixture and 1 cup buttermilk in alternating additions – start and end with flour. Add a third of the flour, then half the buttermilk, another third of the flour, the remaining buttermilk, then finish with the last of the flour. Let each addition fully incorporate before adding the next, and scrape the bowl as needed.Finished cake batter in a stand mixer bowl.

Step 7: Bake and cool. Spread the batter into an even layer in the prepared pan. Bake for 16 to 18 minutes – I start checking at 16 every time. The cake is done when the edges are very lightly golden, the center springs back when pressed, and a toothpick comes out with just a few moist crumbs. Let it cool completely before adding frosting. A warm cake will melt everything.Baked sheet cake in a rectangular pan.

Make the Frosting

Step 1: Dissolve the powdered sugar. In a large mixing bowl, beat 1 1/2 cups very cold whole milk and 1/2 cup sifted powdered sugar together on low speed for 15 to 30 seconds, until fully dissolved.

Step 2: Add the pudding and thicken. Add both 3.4-ounce boxes of instant vanilla pudding mix and beat for 1 to 1 1/2 minutes, until the mixture thickens. Set it aside for 2 to 3 minutes to let it fully set before folding in the topping.

Step 3: Fold in the whipped topping. Using a rubber spatula, gently fold in 2 containers of fully thawed whipped topping until the frosting is smooth and combined.Cream cheese frosting being folded together with a spatula in a glass bowl.

Decorate the Flag

Step 4: Frost the cake. Spread about two-thirds of the frosting evenly over the cooled cake. Transfer the remaining frosting to a large piping bag fitted with a large star tip. I use a #16 or #21 – either works well for both the stripes and the stars.Sheet cake evenly frosted with cream cheese frosting in a pan.

Step 5: Place the blueberries. In the upper left corner of the cake, arrange 48 blueberries in 6 rows of 8. Take your time here. A messy blueberry section throws off the whole design.Hand placing blueberries in the corner of a frosted sheet cake to create the flag design.

Step 6: Add the strawberry stripes. Place halved strawberries in rows across the remaining frosted area of the cake. Leave white frosting space between each row – that’s where the white stripes go.Flag cake with blueberries and rows of halved strawberries arranged on frosted sheet cake before piping.

Step 7: Pipe the white stripes and stars. Pipe the frosting in straight lines between the rows of strawberries to create the white stripes. Then pipe small stars between the blueberries – about 16 total. Whether you end up with dots or actual stars depends on the tip, but a star tip gives the cleanest result.Hand piping frosting stripes between strawberry rows and adding star details in the blueberry section of the flag cake.

Step 8: Refrigerate until serving. Keep the decorated cake in the refrigerator until you’re ready to serve.

Tips for the Best Results

  • Check the cake at 16 minutes. I check at the low end every time because this cake bakes faster than you’d expect. Pull it when the center springs back and the toothpick has a few moist crumbs, not wet batter. Overbaking dries out the crumb.
  • Rinse and completely dry the berries before decorating. I rinse mine and pat them dry with paper towels before they go on the cake. Any moisture left on the fruit will seep into the frosting as the cake sits and soften it faster than it should.
  • Shop for large, uniformly sized berries. The sizing makes a bigger difference than you’d think. When the berries are all roughly the same size, the rows line up and the flag actually looks like a flag. Look for the biggest blueberries and the most evenly sized strawberries you can find.
  • Thaw the whipped topping completely before using. I move it from the freezer to the fridge the night before, every time. If it’s still partially frozen when you fold it in, the frosting will be lumpy and won’t pipe or spread right.
  • Make it the morning of, decorate close to serving. I bake the cake earlier in the day, let it cool completely, and cover it at room temperature. Then I frost and decorate as close to serving time as I can. The berries release moisture as the cake sits, and the frosting softens over time.
American flag sheet cake with strawberry rows, blueberry star section, and white cream cheese frosting on a baking sheet.

Make-Ahead and Storage

  • I bake this the morning of every time. Let it cool completely, cover the pan tightly, and leave it at room temperature. Frost and decorate within a few hours of serving.
  • Once frosted and decorated, it will keep in the refrigerator for up to 2 days. The berries release moisture as the cake sits and the frosting will gradually soften.
  • Same-day is the sweet spot. I don’t recommend frozen fruit for decorating this one.
Sheet cake slice on blue plate topped with rows of halved strawberries and piped whipped frosting.

Frequently Asked Questions

Can I use a boxed cake mix instead?

I only tested this recipe with the from-scratch cake, so that’s what I recommend. The combination of buttermilk, sour cream, and oil is what gives this cake its texture, and a boxed mix will behave differently. If you go the semi-homemade route, know the texture and bake time will vary from what’s described here.

What piping tip should I use for the stripes and stars?

Use a medium star tip for both. Different brands number their tips differently, but a #16 or #21 size will give you clean, defined stripes and stars. If you only have one tip, use it for both.

More 4th of July Recipes

No ratings yet
American flag cake

Flag Cake

Serves — 16
This flag cake is made from scratch in a half sheet pan, topped with a light pudding-based frosting, and decorated with fresh blueberries and strawberries. It pipes beautifully, feeds a crowd, and has been on my 4th of July table every single year.
Prep Time 25 minutes
Bake Time 18 minutes
Total Time 43 minutes

Ingredients
 

Cake

  • 2 ½ cups all-purpose flour
  • 2 teaspoons baking powder
  • ½ teaspoon salt
  • 1 ¾ cups granulated sugar
  • ¾ cup unsalted butter room temperature
  • 3 large eggs room temperature
  • 1 tablespoon vanilla extract
  • ½ cup sour cream
  • ¼ cup vegetable oil
  • 1 cup buttermilk

Frosting

  • 1 ½ cups whole milk very cold
  • ½ cup powdered sugar sifted
  • 2 boxes (3.4 ounce) instant vanilla pudding
  • 2 containers (8 ounce) whipped topping thawed

Toppings

  • 48 large fresh blueberries
  • 26-28 26-28 whole fresh strawberries halved

Instructions
 

Cake

  • Preheat the oven to 350°F. Lightly spray a 12x17x1-inch half sheet pan with non-stick baker’s spray and set aside.
  • Sift together the all-purpose flour, baking powder, and salt in a medium bowl. Set aside.
    2 ½ cups all-purpose flour, 2 teaspoons baking powder, ½ teaspoon salt
  • In the bowl of a stand mixer fitted with the paddle attachment, cream together the granulated sugar and unsalted butter on medium-high speed for 4-5 minutes or until very light and fluffy.
    1 ¾ cups granulated sugar, ¾ cup unsalted butter
  • Reduce the speed to low and add the eggs, one at a time, followed by the vanilla extract. Be sure to fully incorporate each egg before adding the next. Scrape the bowl and paddle as needed to ensure even mixing of the ingredients.
    3 large eggs, 1 tablespoon vanilla extract
  • Add the sour cream and vegetable oil. Mix on low speed just until fully combined.
    ½ cup sour cream, ¼ cup vegetable oil
  • With the mixer on low, add a third of the flour mixture, followed by ½ cup of the buttermilk, another third of the flour mixture, the remaining ½ cup buttermilk, and the final third of the flour mixture. Be sure to allow each addition to fully incorporate into the batter before adding the next. Scrape the bowl and paddle as needed to ensure the batter is evenly combined.
    1 cup buttermilk
  • Spread the batter into an even layer in the prepared pan. Bake for 16-18 minutes or just until the edges are very lightly browned and the center springs back when lightly pressed. A toothpick inserted into the center should come out with just a few moist crumbs. Allow the cake to cool completely in the pan before adding the frosting and berries.

Frosting

  • Using a large mixing bowl and a handheld mixer on low speed, add the cold milk and powdered sugar. Beat for 15-30 seconds or until the powdered sugar is fully dissolved into the milk.
    1 ½ cups whole milk, ½ cup powdered sugar
  • Add the vanilla instant pudding mix and beat for 1 to 1 ½ minutes or just until thickened. Set aside for 2-3 minutes to fully set.
    2 boxes (3.4 ounce) instant vanilla pudding
  • Using a rubber spatula, gently fold in the thawed whipped topping until thoroughly combined.
    2 containers (8 ounce) whipped topping
  • Spread about two-thirds of the frosting evenly over the cooled cake. Transfer the remaining frosting to a large piping bag fitted with a large decorative piping tip. (A medium size star tip will also work for both the stripes and the stars. Keep in mind that different brands will be numbered differently, but a #16 or 21 size tip will work.)
  • Top the cake with the fresh blueberries and strawberry halves in the pattern of the American flag. In the upper left hand corner place 6 rows, with 8 blueberries in each row, to create the blue area where the stars go. Then place the halved strawberries in rows across the rest of the frosted cake (representing the red strips of the flag), being sure to leave some white space between rows of strawberries.
    48 large fresh blueberries, 26-28 26-28 whole fresh strawberries
  • Once the fruit is properly placed, pipe the frosting in straight lines in the spaces between the strawberry rows to represent the white strips of the flag.
  • Use the remaining frosting to place little dots or stars between the blueberries, (about 16 stars). The design (dots versus stars) will depend on the type of tip used for the piping, but we recommend stars.

Jenn’s Notes

Storage:
  • For best results, bake this cake the morning you plan to serve it. Allow it to cool completely, then cover the pan tightly and keep it at room temperature until you’re ready to add the frosting and decorations, ideally within a few hours of serving.
  • If you have leftovers, the frosted and decorated cake can be stored in the refrigerator for up to 2 days. Keep in mind that the berries will release moisture over time, causing the frosting to gradually soften.
  • For the best experience, serving it the same day is the way to go. Fresh fruit is also strongly recommended for decorating, as frozen fruit doesn’t work well for this cake.
 
Tips:
  • Since every oven runs a little differently, start checking your cake at the earlier end of the baking time. This helps prevent overbaking, which can leave you with a dry cake.
  • Make sure your frozen whipped topping is fully thawed before folding it into the pudding mix. This step is key to getting that perfect, creamy frosting consistency.
  • Give your blueberries and strawberries a good rinse and make sure they are thoroughly patted dry before placing them on the cake. Excess moisture can affect how they sit on top.
  • When it comes to decorating, stick with fresh fruit only. Frozen fruit isn’t recommended for topping this cake.
  • Feel free to swap the vanilla pudding mix for white chocolate or cheesecake flavored instant pudding if you’d like a different twist on the frosting. Just note that sugar-free varieties haven’t been tested in this recipe.

Nutrition Info

Calories: 445kcal | Carbohydrates: 63g | Protein: 6g | Fat: 20g | Saturated Fat: 11g | Polyunsaturated Fat: 3g | Monounsaturated Fat: 4g | Trans Fat: 0.4g | Cholesterol: 63mg | Sodium: 263mg | Potassium: 164mg | Fiber: 1g | Sugar: 45g | Vitamin A: 443IU | Vitamin C: 12mg | Calcium: 117mg | Iron: 1mg

Related Recipes

Secrets to Quick & Easy Desserts
FREE EMAIL BONUS
How to make delicious desserts in no time at all!

Leave a comment

Your email address will not be published. Required fields are marked *

How many stars would you give this recipe?