Flag Cake

Tested & Perfected Recipes

This post may contain affiliate links. Read my full disclosure policy.

A soft yellow cake topped with cream cheese frosting and fresh berries, this flag cake is the perfect patriotic dessert for a crowd.

Cake decorated like an American flag missing a piece.

A soft yellow cake topped with luscious cream cheese frosting and fresh berries, this festive flag cake is the ultimate July 4th dessert. I know that decorating cakes can be intimidating, especially for non-bakers, but this one is quick and easy — promise!

Before we get to the step-by-step, I have to give credit where it’s due. The cake portion of this recipe comes from my all-time favorite cake cookbook, Perfect Cakes by Nick Malgieri. Decorating inspiration comes from Gaby Dalkin of the fun cooking blog What’s Gaby Cooking, whose easy method for creating the stars and stripes I copied. Instead of using a frosting-filled pastry bag fitted with a star tip to make the white portions of the flag design, she coats half of the berries in powdered sugar. This makes decorating the cake doable for everyone, even kids.

What You’ll Need To Make A Flag Cake

ingredients for flag cake

The ingredients for this flag cake are pretty straightforward. My only advice is to get the prettiest, firmest berries you can find. It will make decorating the cake much easier.

How To Make A Flag Cake

Step 1: Bake the Cake

whisked dry ingredients

In a medium bowl, whisk together the flour, salt and baking soda. Set aside.

In the bowl of an electric mixer fitted with the paddle attachment (or beaters), beat the butter and sugar on medium speed until light and fluffy, about 5 minutes.

creamed butter and sugar

Beat in the vanilla.

Vanilla added to butter and sugar in a stand mixer.

Beat in the eggs, one at a time, scraping down the sides of the bowl as necessary.

adding eggs one at a time

Don’t worry if the batter looks a little curdled at this point.

Stand mixer of curdled batter.

Reduce the speed to low, then beat in one-third of the flour mixture, followed by half of the buttermilk. adding the flour mixture to the batter

adding the buttermilk to the batter

Scrape down the sides and bottom of the bowl, then add another third of the flour, followed by the remaining buttermilk. Beat in the remaining flour, then scrape down the bowl and beat again until the batter is evenly combined. Do not overmix.

finished flag cake batter in mixing bowl

Scrape the batter into the prepared baking pan.

flag cake batter in pan ready to bake

Bake for about 30 minutes, until the cake is set and lightly golden around the edges, and a toothpick inserted into the center comes out clean. Set the cake on a wire rack to cool completely.

Baked cake in a cake pan.

Step 2: Make the Frosting

In the bowl of a stand mixer fitted with the paddle attachment (or large bowl if using a hand mixer), combine the cream cheese, butter, vanilla and salt. Mix on low speed until combined, then increase the speed to medium-high and beat until aerated and light, about 2 minutes. beating butter and cream cheese

Gradually add 4 cups of the confectioners’ sugar, mixing on low speed to combine.

adding the sugar

Once the confectioners’ sugar is mixed in, increase the speed to medium-high and beat until fluffy, about 1 minute. Set aside 1 tablespoon of the frosting (you’ll need it for the blueberry “stars.”)

whipped cream cheese frosting

Step 3: Frost The Cake

Frosted cake in a cake pan.

When the cake is completely cool, use an offset spatula to spread the frosting evenly over top. The frosting won’t show, so no need to fuss over making it perfect.

Step 4: Decorate with “Stars” and “Stripes”

Outline the “stars” section on the upper left corner of the cake with a toothpick (or skip this step and just eyeball it) and fill with a generous layer of blueberries. Arrange 1 row of raspberries across the top of the cake, laying them sideways, like a red stripe. Gently roll the next row of raspberries in the confectioners’ sugar to make a white stripe, and alternate until the flag is completed.

Pan with a rectangle of blueberries, a  row of sugared raspberries, and two rows of red raspberries.Dip a small handful of the remaining blueberries in the reserved frosting, and then in the remaining cup of confectioners’ sugar to make white “stars.” Evenly scatter the “stars” among the section of blueberries.

Serve the cake directly from the pan. This flag cake is best made on the day of serving or one day ahead of time at most.

Cake decorated like an American flag missing a piece.

You May Also Like

Flag Cake

A soft yellow cake topped with cream cheese frosting and fresh berries, this flag cake is the perfect patriotic dessert for a crowd.

Servings: 24
Prep Time: 30 Minutes
Cook Time: 30 Minutes
Total Time: 1 Hour, plus time to cool the cake

Ingredients

For the Cake

  • 2¾ cups all-purpose flour, spooned into measuring cup and leveled-off
  • ½ teaspoon salt
  • ½ teaspoon baking soda
  • 2 sticks (1 cup) unsalted butter, softened
  • 2 cups sugar
  • 2 teaspoons vanilla extract
  • 4 large eggs, at room temperature
  • 1 cup buttermilk (see note)

For the Frosting and Topping

  • 8 oz cream cheese, at room temperature
  • 1 stick (½ cup) unsalted butter, at room temperature
  • 1 teaspoon vanilla extract
  • Pinch salt
  • About 5½ cups confectioners' sugar, divided
  • 1 half-pint (6 oz) blueberries (see note)
  • 4 half-pints (24 oz) raspberries (see note)

Instructions

For the Cake

  1. Preheat the oven to 350°F and set an oven rack in the middle position. Butter and flour a 9x13-in metal pan, or use nonstick cooking spray with flour in it, such as Baker's Joy or Pam with Flour.
  2. In a medium bowl, whisk together the flour, salt and baking soda. Set aside.
  3. In the bowl of an electric mixer fitted with the paddle attachment (or beaters), beat the butter and sugar on medium speed until light and fluffy, about 5 minutes. Beat in the vanilla, then beat in the eggs, one at a time, scraping down the sides of the bowl as necessary. (Don't worry if the batter looks a little curdled at this point.)
  4. Reduce the speed to low, then beat in one-third of the flour mixture, followed by half of the buttermilk. Scrape down the sides and bottom of the bowl, then add another third of the flour, followed by the remaining buttermilk. Beat in the remaining flour, then scrape down the bowl and beat again until the batter is evenly combined. Do not overmix.
  5. Scrape the batter into the prepared baking pan and bake for 30 to 35 minutes, until the cake is set and lightly golden around the edges, and a toothpick inserted into the center comes out clean. Set the cake on a wire rack to cool completely.

For the Frosting and Topping

  1. In the bowl of a stand mixer fitted with the paddle attachment (or large bowl if using a hand mixer), combine the cream cheese, butter, vanilla and salt. Mix on low speed until combined, then increase the speed to medium-high and beat until aerated and light, about 2 minutes. Gradually add 4 cups of the confectioners' sugar, mixing on low speed to combine. Once the confectioners' sugar is mixed in, increase the speed to medium-high and beat until fluffy, about 1 minute. Set aside 1 tablespoon of the frosting (you'll need it for the blueberry "stars.")
  2. When the cake is completely cool, use an offset spatula to spread the frosting evenly over top. The frosting won't show so no need to fuss over making it perfect.
  3. Outline the "stars" section on the upper left corner of the cake with a toothpick (or skip this step and just eyeball it) and fill with a generous layer of blueberries. Dip a small handful of the remaining blueberries in the reserved frosting, and then in the remaining 1½ cups of confectioners' sugar to make white "stars." Evenly scatter the "stars" over the section of blueberries. Arrange 1 row of raspberries across the top of the cake, laying them sideways, like a red stripe. Gently roll the next row of raspberries in the confectioners' sugar to make a white stripe, and alternate until the flag is completed. (I suggest using one hand for rolling and one for placing; if any powdered sugar accidentally gets on the red "stripes," use your fingertip to dab the berries lightly with water and it will come right off. )
  4. Cut the cake into squares and serve directly from the pan.
  5. Note: If you’d like to make your own buttermilk, check out the easy method here.
  6. Note: The berries should be dry before decorating the cake. (In general, I don't rinse raspberries because they are so delicate.)
  7. Make-Ahead Instructions: The cake itself can be made one day ahead of time. Cover with plastic wrap and store at room temperature. Frost and decorate the cake before serving.

Nutrition Information

Powered by Edamam

  • Per serving (24 servings)
  • Serving size: 1 piece
  • Calories: 393
  • Fat: 16 g
  • Saturated fat: 9 g
  • Carbohydrates: 60 g
  • Sugar: 46 g
  • Fiber: 2 g
  • Protein: 4 g
  • Sodium: 143 mg
  • Cholesterol: 72 mg

This website is written and produced for informational purposes only. I am not a certified nutritionist and the nutritional data on this site has not been evaluated or approved by a nutritionist or the Food and Drug Administration. Nutritional information is offered as a courtesy and should not be construed as a guarantee. The data is calculated through an online nutritional calculator, Edamam.com. Although I do my best to provide accurate nutritional information, these figures should be considered estimates only. Varying factors such as product types or brands purchased, natural fluctuations in fresh produce, and the way ingredients are processed change the effective nutritional information in any given recipe. Furthermore, different online calculators provide different results depending on their own nutrition fact sources and algorithms. To obtain the most accurate nutritional information in a given recipe, you should calculate the nutritional information with the actual ingredients used in your recipe, using your preferred nutrition calculator.

See more recipes:

Comments

  • Hi Jenn,
    I’m planning to make the flag cake for the 4th. Would it be ok for me to bake it in my red Emile Henry casserole pan? Would I need to adjust time or temperature?
    Thanks!

    • — Maura Visconsi on July 3, 2024
    • Reply
    • Hi Maura, Sorry I’m weighing in too late to help, but hope the cake came out well! And, in general, when baking in ceramic, the bake time will be a bit longer.

      • — Jenn on July 5, 2024
      • Reply
  • Can you freeze the cake ahead of time, then frost and decorate before serving?

    • — Carol Lamond on June 28, 2024
    • Reply
    • Sure!

      • — Jenn on June 28, 2024
      • Reply
  • Thank you, my Flag Cake looked just like your picture. It was a big hit at our 4th of July family party. Your instructions are the best.

    • — Dianne Wilson on July 5, 2023
    • Reply
  • The Flag Cake was a fabulous hit at our Fourth of July party! My white “stars” didn’t look good so I cut petals from white carnation flowers (which are edible) and it looked amazing!

    Thanks, love your recipes!

    • — Marjorie on July 5, 2023
    • Reply
  • Delicious and pretty simple instructions, everyone loved

    • — Julia Crain on July 4, 2023
    • Reply
  • Made this today for the 4th of July Independence Day celebration. Directions were great and my husband and son were sampling along the way so I’m sure it’s going to be delicious!

    • — Jen C on July 4, 2023
    • Reply
  • I made this for a Memorial Day BBQ and it got rave reviews! Is there a way I can cut the sweetness of the frosting without compromising the texture? Thanks!

    • — Dianna on May 29, 2023
    • Reply
    • Hi Dianna, so glad the cake was a hit! You can cut the sugar back a bit; just keep in mind that it helps to thicken up the cream cheese and butter to give the frosting structure. Because of that, I’d probably notreduce it by more than about a half cup.

      • — Jenn on May 30, 2023
      • Reply
  • Hi Jenn!
    Do you think a whipped cream type of frosting would work for this? I was thinking about the mascarpone whipped cream that goes with your chocolate pavlova (LOVE that recipe). I’ve got someone who doesn’t care for cream cheese frosting so was just doing some brainstorming.
    Thanks!!

    • — Kate on May 26, 2023
    • Reply
    • Hi Kate, I do think that would work really well. Please LMK how it turns out if you try it!

      • — Jenn on May 27, 2023
      • Reply
      • Thank you, Jenn! I used the mascarpone whip and it was awesome! Rave reviews from family!

        • — Kate on June 29, 2023
        • Reply
        • So glad to hear it — thanks for taking the time to report back!

          • — Jenn on June 29, 2023
          • Reply
  • Hi, Jenn. I made this cake twice so far and it was delicious. I also bought the cake cookbook that you mentioned, Perfect Cakes. I would love to know what your favorite recipes in that book are and what you would recommend. Thanks!

    • Glad you like it, Heather! A few other cakes I really like are the high ratio pound cake, sour cream coffee cake, buttermilk cake layers, and coconut cake. Hope that helps!

      • Hi! Who is the author of the cake cookbook if you don’t mind me asking? Thanks! I’m hoping for another Jenn cookbook in the future. 🙂

        • — Samantha on May 17, 2024
        • Reply
        • Hi Samantha, the book is by Nick Malgieri. 😊

          • — Jenn on May 20, 2024
          • Reply
  • This recipe turned out perfectly. The cake was moist and fluffy, and the frosting was easy to handle.

Add a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.