Creamy Chocolate Coconut Magic Bars {Gluten-Free}


Jump to Recipe

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

Magic bars are layered with sweet chocolate, coconut, and crunchy pecan flavors, and they couldn’t be easier to make. This gluten-free version is perfect for sharing at potlucks, picnics, and parties! 

stacked layer bars on a wooden table

Chewy, sweet, and crunchy. Magic bars are called ‘magic’ for a reason. This dessert has everything: sweet coconut, melty chocolate, crunchy nuts, a tender crust, and it can be prepped and baked in under 30 minutes. This gluten-free version is perfect for gatherings where food sensitivities are a concern, but it’s been a favorite on this site for over a decade because it is a hit even with those for whom eating gluten isn’t a concern. 

These quick and easy bars are the perfect dessert for super busy home cooks that need a sweet treat for a crowd, and don’t have time to make a batch of chocolate chip cookies. To make this recipe, you only need to press the easy coconut flour crust into a baking pan, layer the chocolate in, sprinkle the coconut and nuts, and then pour thick, rich sweetened condensed milk over the top.

If you love desserts that travel well, and are perfect for everything from casual bake sales to festive parties, then magic bars are just the treat you’ve been looking for. 

What are magic bars?

Magic bars get their name for the “magical” layers of flavor in this addictive cookie bar. Typically, recipes will include: sweet coconut, bitter-sweet chocolate, sweetened condensed milk (which give the cookies a caramel flavor), crunchy nuts, graham cracker cookies, and rich butter. 

Magic bars also go by 7-layer bars or dolly bars. Recipes for 7-layers bars also include butterscotch chips. There are so many fun variations of this easy dessert, which adds to the fun of making (and eating) these wonderful snacks.

How to Make

  1. Preheat the oven to 350 degrees F, and prep the baking pan.
  1. In a mixing bowl, stir together the ingredients for the crust. Press the crust into the bottom of the pan.
  1. Top the crust with chocolate chips, then pecans and coconut. Pour the condensed milk evenly over the bars.
  1. Bake the bars just until the coconut is golden brown, 20 to 25 minutes.
  1. Let the bars cool completely before slicing.
a coconut bar on a wooden table


  • Coconut Flour, Light Brown Sugar, Kosher Salt, Unsalted Butter – Pantry staples that you’ll need to make the crust. 
  • Semi-Sweet Chocolate Chips – Semi-sweet chips have a bitter-sweet taste that is just the right amount of sweet. Milk chocolate chips work too, but will give you a sweeter seven layer bars.
  • Shredded Sweetened Coconut – Be sure to use sweetened shredded coconut, which is moister than unsweetened coconut.  
  • Pecans – Chopped pecans add a nutty crunch to the bars. You could also use walnuts or almonds.
  • Sweetened Condensed Milk – An unassuming ingredient that does some heavy lifting in this recipe by binding the ingredients together, and producing a sweet, caramel-like taste in each bite.
chocolate chips on a white table


  • To make removing the bars from the pan easier, grease the 8×8 baking dish with butter and line with parchment paper.

How to store

Storing chocolate coconut bars in the refrigerator will help these dessert bars maintain the perfect consistency for cutting into squares. You can either keep them in the baking pan, and cover tightly with plastic wrap, or place them in an airtight container. Enjoy within 5-7 days.


  • Try different mix-ins – Marshmallows, peanut butter chips, butterscotch chips, and chopped dates add their own unique layers of flavors. Chop your favorite candy bars up and add them for a decadent mix-in.
  • Make them salty and sweet – Chopped gluten-free pretzels make an amazing salty-sweet 7-layer bar.
  • Drizzle with butterscotch – Layer magic bars achieve another level of, well, magic, when you drizzle them with butterscotch before serving.


Can magic bars be frozen?

This cookie bar recipe freezes really well. Slice the magic cookie bars and place them in an airtight container. If you stack the bars in the container, use a piece of parchment paper to separate the bottom layer from the top layer. This will prevent them from sticking together.

How to slice?

When slicing magic bars, a good rule of thumb is to refrigerate the bars before slicing. When you bake the magic bars, all of the delicious ingredients will melt together to create the perfect 7-layer bar. An hour or two in the refrigerator will firm up the melty chocolate and sticky sweet coconut just enough to make clean slices.

More Dessert Bar Recipes

Favorite Tools

coconut bars stacked on a wooden table

Pin this now to save it for later

Pin It Now
coconut bars stacked on a wooden table
4.50 from 12 votes

Creamy Chocolate Coconut Magic Bars {Gluten-Free}

Magic bars are layered with sweet chocolate, coconut, and crunchy pecan flavors, and they couldn’t be easier to make. This gluten-free version is perfect for sharing at potlucks, picnics, and parties!
Prep: 15 minutes
Cook: 23 minutes
Total: 38 minutes
Servings: 16


  • 8×8 baking pan
  • Mixing Bowl
  • Parchment Paper


  • 1/2 cup coconut flour (see note)
  • 1/3 cup light brown sugar
  • ½ teaspoon kosher salt
  • 1/4 cup unsalted butter, melted
  • 4 large eggs
  • 1/4 teaspoon almond extract
  • 1 1/4 cups semi-sweet chocolate chips
  • 1/2 cup chopped pecans (optional)
  • 1 1/4 cup shredded sweetened coconut (see note)
  • 1 cup sweetened condensed milk


  • Preheat the oven to 350 degrees F. Grease an 8×8 baking dish with butter and line with parchment paper (this will makes it easy to pull the bars out in one piece when they finish baking).
  • In a large mixing bowl, whisk together the coconut flour, light brown sugar, and salt. Add the melted butter, eggs, and almond extract all at once and stir with a wooden spoon until evenly combined.
  • Spread the batter out in the prepared pan until even. Bake until it just begins to set, 8 minutes.
  • Remove the crust from the oven and sprinkle the chocolate chips evenly over the top. Top with pecans and coconut. Drizzle the sweetened condensed mil in even stripes across the coconut.
  • Return the bars to the oven and bake just until the coconut is golden brown, 13-15 minutes.
  • Let the bars cool completely before slicing.


The bars can be stored in the refrigerator for up to 4 days.


Calories: 222kcal | Carbohydrates: 23g | Protein: 4g | Fat: 13g | Saturated Fat: 9g | Polyunsaturated Fat: 1g | Monounsaturated Fat: 3g | Trans Fat: 0.1g | Cholesterol: 53mg | Sodium: 130mg | Potassium: 161mg | Fiber: 3g | Sugar: 18g | Vitamin A: 181IU | Vitamin C: 0.3mg | Calcium: 48mg | Iron: 1mg

Nutrition information is automatically calculated, so should only be used as an approximation.

Author: Jess Smith via Inquiring Chef
Cost: $8.00
Calories: 222
Keyword: chocolate, coconut, dessert bars, easy snack, gluten free
Like this? Leave a comment below!Jump to Comments


Want to save this recipe?
Get it emailed to you directly! Enter your email below.

About Jess Smith

Jess is the recipe creator and photographer at She spent nearly a decade as the Chief Recipe Developer for the award-winning meal planning app Cook Smarts. Her colorful, healthyish recipes have been featured in popular online publications including Parade, Hallmark, and HuffPost.

Leave a comment

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

Recipe Rating

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