I first tried magic cookie bars on my first trip to Magnolia Bakery in Los Angeles. I picked out a few different treats to try, including their famous banana pudding, but these bars were the one I was most curious about.
I liked them enough to make my own version at home, and I was surprised by how easy they are. Itโs basically a graham cracker crust layered with sweetened condensed milk, chocolate chips, coconut, and pecans. No mixer, no complicated steps, just one pan and the oven doing most of the work.
I keep it close to the bakery version, with toasted pecans on top. A little sugar and a pinch of salt in the crust are optional, but they keep the base from tasting flat under all that sweetness.

Save This Recipe ๐
Jump to:
Why Youโll Love These Magic Cookie Bars
- Short ingredient list. Graham crackers, butter, a can of sweetened condensed milk, chocolate chips, pecans, and coconut. Most of it keeps in the pantry, so theyโre easy to make when a cookie tray sneaks up on you.
- Toasted pecans. Toasting brings out their flavor, so they hold their own next to the chocolate and condensed milk.
- No mixer, one pan. The crust is mixed by hand in a bowl, and everything else gets layered right in the pan. Thereโs no batter or dough to make.
- They travel well. Firm bars that stack in a tin, which makes them easy to bring to a holiday party or share in a cookie exchange.
What Is a Magic Cookie Bar
A magic cookie bar is a layered bar cookie made with a graham cracker crust, sweetened condensed milk, chocolate chips, shredded coconut, and nuts. In the oven, the condensed milk thickens into a chewy, caramel-like layer that holds everything together. Thatโs the โmagicโ: no batter, no mixer, just layers.
Youโll also see them called magic bars, seven layer bars, or Hello Dollies. Seven layer bars usually add butterscotch chips, which makes an extra layer. The recipe became popular after it was printed on cans of Eagle Brand sweetened condensed milk, and most versions still follow that same layering idea.
Bakeries like Magnolia Bakery sell their own versions, and thatโs where I first tried them. Mine uses pecans and semi-sweet chocolate, with the coconut on top so it toasts golden in the oven.
Ingredients Youโll Need

For the crust:
- Graham cracker crumbs. These form the base that holds everything up. About 10 full graham crackers make enough. Crush them fine so the crust presses into an even, compact layer. Large pieces leave gaps where the condensed milk can soak through.
- Unsalted butter. Melted, it binds the crumbs together. Unsalted lets you control the salt, especially if you add a pinch to the crust.
- Sugar and salt (optional). A little sugar and a pinch of salt in the crumbs. You can skip them, but they balance the very sweet layers on top so the crust tastes like more than plain crackers.
For the filling:
- Sweetened condensed milk. This is the โmagic.โ As it bakes, it thickens into a chewy, caramel-like layer that glues the toppings to the crust. I used Nestlรฉ. Any brand works, but it has to be sweetened condensed milk, not evaporated milk, which is unsweetened and stays runny.
- Semi-sweet chocolate chips. Semi-sweet keeps the bars from getting too sweet, since the condensed milk and coconut already add plenty of sugar. Milk chocolate chips would push them further toward sweet.
- Pecans. Chopped and toasted before they go in. Toasting deepens their flavor and keeps them from tasting soft and raw once theyโre baked into the sticky layer. Toast them in a dry skillet or the oven until they smell nutty, then let them cool.
- Shredded coconut. It toasts on top in the oven and gives the bars their chewy, golden finish. I used unsweetened, which keeps the bars from getting too sweet. Sweetened coconut works too. It just makes them sweeter.
Youโll find the exact amounts in the recipe card below.
How to Make Magic Cookie Bars

- Make the crust. Heat the oven to 350ยฐF. Stir the melted butter into the graham cracker crumbs, along with the sugar and salt if youโre using them, until the crumbs are evenly moistened and look like wet sand. Dry spots wonโt hold together, and the crust will crumble when you cut it.

- Press it into the pan. Press the mixture firmly into the bottom of an 11x11x2-inch baking pan in an even layer. A flat-bottomed measuring cup helps pack it tight. A firm crust holds up under the toppings and slices cleanly.

- Add the pecans and chocolate chips. Sprinkle them evenly over the crust. Going on first, they get sealed in by the condensed milk and stay put when you slice.

- Drizzle the condensed milk. Pour it evenly over the top, reaching the edges and the gaps between the nuts and chips. This is what binds the layers together as it bakes.

- Top with coconut. Sprinkle the shredded coconut evenly over everything. It goes on last so it toasts in the oven and gives the bars their golden top.

- Bake. Bake for 25 to 30 minutes, until the coconut is lightly golden and the bars are set.

- Cool, chill, and cut. Let the bars cool completely in the pan, then chill for 1 hour so they cut cleanly. Slice into 16 squares.
Roseโs Tips
- Pack the crust tight. Press the crumbs down firmly with a flat-bottomed measuring cup. A loosely packed crust crumbles when you cut the bars, and the squares fall apart on the plate.
- Let the pecans cool after toasting. Warm nuts can soften the chocolate chips they sit on before the bars ever reach the oven. Toast them first, then let them cool while you make the crust.
- Get the condensed milk to the edges. Itโs the glue for the whole bar. Any spots it misses bake up dry, and the toppings there wonโt stick.
- Watch the coconut, not just the timer. The bars are done when the coconut is lightly golden and the center is set. Ovens vary, so start checking at 25 minutes. Coconut goes from golden to too dark quickly.
- Donโt skip the chill. Warm bars are soft and sticky, and they smear when you cut them. An hour in the fridge firms up the caramel layer so you get clean squares.
- Use a sharp knife and wipe it between cuts. The condensed milk layer sticks to the blade. Wiping it clean after each cut keeps the edges neat, especially if youโre wrapping them for gifts.
Variations
- Add butterscotch chips. I ran out this time, but butterscotch is a common addition and turns these into seven layer bars. Sprinkle them over the crust with the chocolate chips.
- Make them thicker. For taller bars, use an 8x8-inch pan. Itโs a little more than half the size of an 11x11, so the layers come out much thicker and the center needs more time to set. Start checking at the usual time and keep baking until the coconut is golden and the middle is no longer soft.
- Use sweetened coconut. I use unsweetened, but sweetened shredded coconut works too. The bars will be sweeter and the coconut may brown a little faster, so keep an eye on it near the end.
- Swap the nuts. Walnut work in place of pecans. Toast them the same way.
Storage
- Room temperature: Keep the bars in an airtight container for up to 3 days. Layer parchment or wax paper between them so the sticky tops donโt glue together.
- Fridge: For firmer bars, or if your kitchen is warm, store them in the fridge for up to 1 week. They cut and stack more neatly cold, and they soften again after a few minutes on the counter.
- Freezing: You can freeze magic cookie bars for up to 3 months. Wrap them well and store in a freezer-safe container, with parchment between layers. Thaw them in the fridge or at room temperature before serving.
- Gifting: To give them as gifts, chill the bars completely first, then wrap each one individually so the layers stay neat and the edges donโt get messy.

Recipe FAQs
Yes. I make these in an 11x11-inch pan, but a 9x13 is almost the same size, so the layers should come out about as thick. Start checking at 25 minutes. Youโll get bars that are a little longer and narrower.
No. Evaporated milk is unsweetened and much thinner, so it wonโt thicken into the chewy layer that holds the bars together. The toppings would slide off and the bars would stay wet. It has to be sweetened condensed milk.
Usually it wasnโt packed tightly enough, or the crumbs werenโt fully coated in butter. Stir until every crumb is moistened, then press firmly with the bottom of a measuring cup. Chilling the bars before cutting helps too.
You can leave the pecans out and keep the rest of the recipe the same. I havenโt tested a nut-free version, but the condensed milk, chocolate, and coconut still hold the bars together. Youโll just have a little less texture on top.
You can make magic cookie bars up to 3 days ahead, stored in an airtight container. Chill them before slicing so the cuts stay clean, then bring them to room temperature before serving if you like them softer.

More Holiday Desserts
Looking for other recipes like this? Try these:
- Sticky Toffee Pudding: a warm date cake under toffee sauce, made for holiday dinners when you want dessert served warm.
- Classic Polvoron: Filipino shortbread that keeps well and wraps up easily for gifts.
- Chocolate Crinkles: fudgy chocolate cookies rolled in powdered sugar, a cookie tray regular.
- Ube Crinkle Cookies: the same crinkle cookie made with ube, so it adds some purple to the tray.

Did you try this recipe?
Share how it turned out in the comment box below, and if you loved it, share it on Facebook, Pinterest & Instagram.
Thank you!


Magic Cookie Bars
Equipment
- 1 11x11x2-inch baking pan
- 1 MIxing Bowl
- 1 flat-bottomed measuring cup
- 1 skillet (for toasting the pecans)
Ingredients
For the crust:
- 1ยฝ cups graham cracker crumbs about 10 full sheets
- 6 tablespoon unsalted butter melted
- 1 tablespoon sugar optional
- Pinch of salt optional
For the filling:
- 1 can 14 oz sweetened condensed milk
- 1 cup semi-sweet chocolate chips
- 1 cup chopped pecans toasted and cooled
- 1 cup shredded coconut unsweetened or sweetened
Instructions
- Heat the oven to 350ยฐF. Stir the melted butter into the graham cracker crumbs, along with the sugar and salt if using, until the crumbs are evenly moistened.1ยฝ cups graham cracker crumbs, 6 tbsp unsalted butter, 1 tbsp sugar, Pinch of salt
- Press the mixture firmly into the bottom of an 11x11x2-inch baking pan.
- Sprinkle the chopped pecans and chocolate chips evenly over the crust.1 cup chopped pecans, 1 cup semi-sweet chocolate chips
- Drizzle the sweetened condensed milk evenly over the top, reaching the edges.1 can 14 oz sweetened condensed milk
- Sprinkle the shredded coconut evenly over everything.1 cup shredded coconut
- Bake for 25 to 30 minutes, until the coconut is lightly golden and the bars are set.
- Cool completely in the pan, then chill for 1 hour. Cut into 16 squares.
Save This Recipe ๐
Notes
- Toast the pecans first and let them cool so they donโt soften the chocolate chips.
- Pack the crust firmly. A loose crust crumbles when you slice.
- Chill before cutting. Cold bars cut into clean squares. Wipe the knife between cuts.
- Pan sizes: a 9x13 pan has almost the same area and should work with a similar bake time. An 8x8 pan makes much thicker bars that need longer in the oven, so bake until the center is set.






Rose Sioson says
These are a good one to bake the day before a party, since they cut cleaner after sitting overnight. Keep them covered in an airtight container, and chill them for a bit before slicing if your kitchen runs warm. Happy to answer questions here if you get stuck.