Irresistible Magic Cookie Bars Recipe – Seven Layer Bars

These Magic Cookie Bars are irresistible, chewy layers of buttery graham cracker crust, sweetened condensed milk, coconut, dark chocolate chips and pecans. They come together in about 10 minutes of prep and bake in 25 minutes. This recipe also includes a simple gluten-free option so everyone can enjoy them.

Magic cookie bars cut into squares.

I grew up baking with my mom during the holidays. We made quick breads, cookies and candies throughout December, then froze many treats to give away on Christmas Day. Her Magic Cookie Bars were always my favorite — they bring back warm memories and are still a go-to dessert for special occasions.

Seven layer bars in a baking dish cut into squares.

Why you’ll love this recipe:

  • Chewy and delicious. Also called seven layer bars, these are a perfect balance of sweetened condensed milk, toasted coconut, chocolate and nuts over a buttery graham crust.
  • Quick and easy. Simple steps and minimal prep make this an ideal dessert to prepare last-minute.
  • Customizable. Swap the chocolate chips for butterscotch, white chocolate or peanut butter chips, add candies, dried fruit or different nuts.
  • Gluten-free option. Use gluten-free graham crackers or crushed cookies for the crust to make them suitable for those avoiding gluten.

Recipe ingredients

This magic bars recipe uses six main ingredients and allows for many tasty variations.

Magic bars recipe ingredients
  • Graham cracker crumbs (regular or gluten-free). Use about 1 1/2 cups. For a gluten-free version, process gluten-free crackers or use a prepackaged gluten-free graham cracker product.
  • Unsalted butter. Melted — one stick. If you use salted butter, omit the added salt.
  • Sweetened condensed milk. One 14-ounce can. This is the glue that creates the gooey, chewy texture.
  • Unsweetened coconut flakes. One cup. I prefer unsweetened for less added sugar, but sweetened coconut is fine if you prefer it sweeter.
  • Dark chocolate chips. One cup. You can substitute butterscotch, white chocolate, peanut butter chips or mini candies.
  • Pecans. 1/2 cup pecan pieces. Substitute walnuts or almonds, or omit for a nut-free version.
  • Flaky sea salt (optional). A light sprinkle enhances the chocolate and balances the sweetness.

See the recipe card below for specific quantities and full instructions.

How to make magic bars

These bars are commonly called “magic” because they require only a few simple steps and minimal effort. Prep takes about 10 minutes and they bake in 25 minutes.

Pro tip: Line the baking dish with parchment or foil to prevent sticking and make removal easy.

How to make magic bars
  1. Melt the butter and stir in the graham cracker crumbs and a pinch of salt until evenly coated.
  2. Press the crumb mixture firmly into the bottom of a lined 13 x 9-inch baking dish to form the crust.
  3. Pour the sweetened condensed milk evenly over the crust.
  4. Sprinkle the coconut, chocolate chips and pecans over the milk. Press the toppings lightly with a fork so they set into the milk.
  5. Bake at 350°F for about 25 minutes, until the top is lightly golden.
  6. Cool completely on a wire rack, then cut into bars and serve.

Recipe FAQs

Why are they called magic cookie bars?

They’re called “magic” because simple layering of a few ingredients bakes up into rich, chewy bars with minimal effort.

Can I use evaporated milk instead of sweetened condensed milk?

No. Evaporated milk is not sweetened and is much thinner. Sweetened condensed milk is essential to achieve the proper texture and sweetness.

Can I make this recipe in advance?

Yes. Making them a few hours or even a day ahead helps them set, making them easier to slice and serve.

Do these bars need refrigeration?

They can be stored at room temperature in an airtight container for several days. If your kitchen is very warm, refrigerate them to prevent softening.

Can I omit the coconut?

Absolutely. Omit the coconut or replace it with additional chocolate, nuts or dried fruit if you prefer.

Recipe variations

These bars are easily customized. Try some of these ideas:

  • Swap dark chocolate for butterscotch, white chocolate or peanut butter chips.
  • Add mini candies, chopped caramels, toffee bits, or holiday sprinkles.
  • Mix in chopped pretzels for salty crunch.
  • Use different nuts (almonds, walnuts) or omit nuts for a nut-free option.
  • Add dried cranberries or fresh raspberries for a fruity note.
  • Replace the graham crust with crushed vanilla cookies, chocolate cookies, or even crushed sandwich cookies for a twist.

Recipe notes

  • Pro tip: Line the baking dish with parchment or foil for easy removal and cleanup.
  • For a gluten-free crust I used a 7.5 ounce package of gluten-free graham crackers processed in a food processor. Any gluten-free cookie or cracker can work.
  • Substitute the chocolate chips or nuts with your preferred mix-ins to suit tastes and dietary needs.
  • Store cooled bars in an airtight container at room temperature for 3–5 days, or freeze for up to 3 months.
Seven layer magic cookie bars on parchment paper.

More cookie recipes you’ll love:

  • Chocolate Dipped Almond Horn Cookies
  • Chocolate Dipped Coconut Macaroons
  • Flourless Peanut Butter Oatmeal Chocolate Chip Cookies
  • Greek Almond Cookies (Amygdalota)
  • Salted Chocolate Chip Espresso Cookies

Did you try this recipe? If so, please leave a review below and tag @flavorthemoments on social media so I can see what you made.

Magic cookie bars cut into squares.

Magic Cookie Bars

Servings: 15 bars
Prep Time: 10 mins ·
Cook Time: 25 mins ·
Total Time: 35 mins
Magic Cookie Bars are sweet, chewy layers of buttery graham cracker crust, sweetened condensed milk, coconut, dark chocolate chips and pecans. This recipe can be made traditionally or gluten-free.

Ingredients

  • 1 stick unsalted butter, melted
  • 1 1/2 cups gluten-free or regular graham cracker crumbs*
  • 1/4 teaspoon sea salt (omit if using salted butter)
  • 14 ounces sweetened condensed milk
  • 1 cup unsweetened coconut flakes
  • 1 cup dark chocolate chips
  • 1/2 cup pecan pieces
  • Flaky sea salt for sprinkling (optional)

Instructions

  • Preheat oven to 350°F (175°C). Line a 13 x 9-inch baking dish with parchment paper or foil.
  • Melt the butter in a heatproof bowl. Stir in the graham cracker crumbs and sea salt until the crumbs are well coated.
  • Press the crumb mixture firmly and evenly into the bottom of the prepared baking dish to form the crust.
  • Pour the sweetened condensed milk evenly over the crust. Sprinkle the coconut, chocolate chips and pecans evenly across the top.
  • Press the toppings lightly with a fork so they sink into the milk. Bake for 25 minutes or until the top is lightly golden.
  • Cool completely on a wire rack before slicing into bars. Serve and enjoy.

Notes

  • Pro tip: Line the pan with parchment or foil to make removing the bars easy.
  • *I used a 7.5 ounce package of gluten-free graham crackers processed in a food processor. Any gluten-free cracker or cookie will work for the crust.
  • Swap chocolate chips for butterscotch, peanut butter or white chocolate chips, and change nuts to suit preferences.
  • Store in an airtight container at room temperature for 3–5 days or freeze for up to 3 months.

Nutrition

Serving: 1 bar · Calories: 302 kcal · Carbohydrates: 29 g · Protein: 4 g · Fat: 19 g · Saturated Fat: 12 g · Cholesterol: 25 mg · Sodium: 143 mg · Fiber: 2 g · Sugar: 21 g

Note: This post was originally published in December 2019. Step-by-step photos and extra recipe details have been added.

All recipes and images © Flavor the Moments.