Magic cookie bars are sweet dessert bars layered with a graham cracker crust, toasted coconut and chocolate chips. This simple, crowd-pleasing recipe delivers rich, buttery flavor and a perfectly chewy texture.

This magic cookie bars recipe is a classic for a reason. A buttery graham cracker base supports a layer of sweetened condensed milk, then generous amounts of chocolate chips and shredded coconut. The coconut toasts while the bars bake, adding a nutty, caramelized note that balances the sweetened condensed milk and chocolate. These bars are easy to assemble, bake quickly, and are ideal for potlucks, parties, or an everyday dessert.
How to make magic cookie bars
For these bars you’ll need: graham cracker crumbs, unsalted butter, a 14 oz can of sweetened condensed milk, shredded coconut and semisweet chocolate chips. The steps are straightforward and require minimal tools.
- Melt the butter in the pan. Place an unwrapped stick of butter in a 9×13-inch pan and put the pan in the oven while preheating to 350°F. The butter will melt in a few minutes.
- Form the crust. Remove the pan, sprinkle graham cracker crumbs evenly over the melted butter, then press the mixture into an even layer using the bottom of a measuring cup or the back of a spoon.
- Add the condensed milk. Pour the sweetened condensed milk over the crust and spread gently by tilting the pan or using an offset spatula.
- Layer the chocolate chips. Sprinkle half of the chocolate chips over the condensed milk.
- Add the coconut. Evenly distribute the shredded coconut across the chocolate layer.
- Finish with chocolate chips. Scatter the remaining chocolate chips on top.
- Bake at 350°F for 25–30 minutes. Bake until the coconut is golden and the filling is set. Cool completely before slicing into bars.
If you prefer to skip coconut, swap in chopped nuts or mini marshmallows for a different texture and flavor.

Frequently Asked Questions
How to cut magic cookie bars: Allow bars to cool completely before slicing. Chilling in the refrigerator will speed this up. Use a sharp knife (or a plastic knife) and wipe the blade between cuts for neat squares. In a 9×13 pan, cutting 4 columns by 6 rows yields about 24 bars.
Can magic cookie bars be frozen? Yes. After cooling, cut into squares and layer them in an airtight container with parchment paper between layers. Freeze for up to 3 months. Thaw in the refrigerator and bring to room temperature before serving.
Related dessert bar recipes
If you enjoy bar desserts, try these other favorites prepared in a pan for quick sharing:
- Sugar cookie bars – Sugar cookie dough baked as bars and topped with buttercream.
- S’mores bars – Graham cracker crust with chocolate and marshmallow layers for a campfire flavor.
- Classic blondies – Browned butter blondies studded with semisweet and white chocolate chips and pecans.
- Chocolate chip cookie bars – All the flavor of chocolate chip cookies baked as easy bars.

The combination of buttery graham cracker crust, toasted coconut and melty chocolate chips makes these bars especially satisfying. Sweetened condensed milk binds the layers and adds a rich, caramel-like sweetness that pulls the whole dessert together.
If you make this recipe, consider sharing a photo on social media so others can see your creation.
Magic Cookie Bars
Ingredients
- ½ cup (1 stick or 113 g) unsalted butter
- 14 oz can sweetened condensed milk
- 1 ½ cups (about 10 full sheets) graham cracker crumbs
- 2 ½ cups semisweet chocolate chips, divided (about 1 1/4 cups + 1 1/4 cups)
- 1 ½ cups (90 g) shredded coconut
Instructions
- Unwrap the butter and place it in a 9×13-inch pan. Put the pan in the oven and preheat to 350°F so the butter melts while the oven heats (about 5–10 minutes).
- Remove the pan, evenly sprinkle graham cracker crumbs over the melted butter, and press into an even crust with the bottom of a measuring cup or the back of a spoon.
- Pour the sweetened condensed milk over the graham crust and spread gently by tilting the pan or using an offset spatula.
- Sprinkle 1 1/4 cups of chocolate chips over the condensed milk, then evenly add the shredded coconut. Top with the remaining 1 1/4 cups of chocolate chips.
- Bake at 350°F for 25–30 minutes, or until the coconut is golden brown. Cool completely, then cut into squares using a sharp knife, wiping the blade between cuts for clean edges.
Notes
Storing: Store cooled bars in an airtight container at room temperature for up to 5 days.
Freezing: Cool and cut bars, then layer in an airtight container with parchment between layers. Freeze up to 3 months. Thaw in the refrigerator and bring to room temperature before serving.
Suggested tools: A 9×13 baking pan and a food processor to crush graham crackers make the process easier, but a zip-top bag and rolling pin work well for crumbs.
Calories: 203 kcal
Carbohydrates: 15 g
Protein: 2 g
Fat: 15 g