Healthier Magic Cookie Bars (Vegan + Gluten-Free)

Healthier magic cookie bars made grain-free, gluten-free and vegan with homemade sweetened condensed coconut milk.

Last month I went to Isaac’s school for a holiday celebration and as luck would have it a parent had brought in Magic Cookie Bars for the teachers. Remember those bad boys? Some people call them Seven Layer Bars but they have a graham cracker crust, chocolate chips, coconut and sweetened condensed milk… so rich and delicious! My mom used to make them and they were one of my favorite holiday baked goods.

A stack of healthier magic cookie bars. An almond flour coconut crust, topped with coconut caramel, coconut flakes, pecans and chocolate chips.

At Isaac’s school that day, I couldn’t resist having a bite (or two). It was just as a good as I remembered it: before long the wheels started turning in my head and I had my mind set on making a version of my own. I can’t really call these healthy because they’re still decadent, but they’re made with wholesome ingredients and a bit healthier.

Healthier magic cookie bars. An almond flour cookie crust topped with coconut caramel, coconut, pecans, and chocolate chips.

And I have a feeling that they would make an excellent Valentine’s Day treat to make for that special someone (or your family, friends, co-workers and neighbors)!

Having tasted the classic version only a day or two before I made this variation, I can honestly say they look and taste like the real deal. You could easily take them to a party, not tell anyone that they’re grain-free, dairy free and made with sweetened condensed coconut milk and people would go crazy for them.

Healthier magic cookie bars. An almond flour cookie crust topped with coconut caramel, coconut, pecans, and chocolate chips.

I mean, how could they not…

Chocolate + coconut + nuts = magic.

Healthier magic cookie bars. An almond flour cookie crust topped with coconut caramel, coconut, pecans, and chocolate chips.

I hope you all like these as much as we do!

Hand holding a healthier, gluten free, grain free, vegan, magic cookie bar. An almond flour cookie crust topped with coconut caramel, coconut, pecans, and chocolate chips.

If you make these healthy magic cookie bars please be sure to leave a comment and star rating below letting me know how they turn out. Your feedback is so helpful for the EBF team and other EBF readers!

clock clock icon cutlery cutlery icon flag flag icon folder folder icon instagram instagram icon pinterest pinterest icon print print icon squares squares icon
Healthier square magic cookie bars. An almond flour cookie crust topped with coconut caramel, coconut, pecans, and chocolate chips.

Healthier Magic Cookie Bars

  • Author: Brittany Mullins
  • Prep Time: 15 minutes
  • Cook Time: 75 minutes
  • Total Time: 1 hour 30 minutes
  • Yield: 16


Healthier magic cookie bars made grain-free, gluten-free and vegan with homemade sweetened condensed coconut milk. 



  • 3/4 cup almond flour
  • 3/4 cup unsweetened shredded coconut
  • 1/8 cup coconut oil, liquid
  • 1/2 Tablespoon maple syrup
  • 1 teaspoon vanilla
  • 1/4 teaspoon sea salt


  • 1 can (13.5 oz) full-fat coconut milk
  • 1/2 cup coconut sugar
  • 1 cup vegan chocolate chips (I used Enjoy Life)
  • 1 cup unsweetened flaked coconut
  • 1/2 cup chopped pecans


  1. Preheat oven to 350°F and line a square (8×8) glass baking dish with parchment paper.
  2. Combine all ingredients for the crust in a large bowl and press firmly into the prepared pan. Bake for 12 to 15 minutes until your crust is golden brown in color. Remove from oven and cool on a wire rack.
  3. While crust is cooling, in a saucepan over medium heat bring coconut milk and sugar to a low boil, reduce heat and simmer for approximately 45 minutes, stirring frequently until the mixture has reduced by half. The coconut milk mixture should be thick reduced to about 3/4 cup. Remove from heat and cool slightly. Pour the sweetened condensed coconut milk over the crust and spread to the edges.
  4. Sprinkle the chocolate chips evenly over the condensed milk, then the flaked coconut, and then the pecans. Using your hands, press the mixture down a tiny bit until the milk soaks upward into the layers.
  5. Place in oven (still at 350°F) and bake for about 30 minutes, until edges are browning a bit. Remove from oven and cool for 30 to 60 minutes on a cooling rack. Once the bars have cooled a bit, place the pan in the refrigerator to allow the bars to set-up for at least two hours (or overnight). If you’re in a rush you could put the bars in the freezer for an hour instead.
  6. After cooling, lift the parchment out of the pan and place bars on a cutting board or other flat surface. If the bars are coming from the freezer, you may need to let them thaw for a few minutes before cutting as they will be pretty firm. Cut bars into 16 squares and dig in! Any leftover bars should be wrapped or placed in a sealed container. They can be left out for a couple days or stored in the fridge or freezer for longer storage.


Recipe adapted from Simply Living Healthy.

  • Category: Dessert
  • Method: Bake
  • Cuisine: American


  • Serving Size: 1 bar
  • Calories: 333
  • Sugar: 15g
  • Fat: 27g
  • Saturated Fat: 19g
  • Carbohydrates: 23g
  • Fiber: 4g
  • Protein: 3g

Keywords: magic cookie bars, coconut magic cookie bars, seven layer bars

This post may include affiliate links. Thank you for your support.

Leave a Comment

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

    1. Danielle
      September 4, 2020 AT 11:16 pm

      Are about 3 squares of these tonight! I hated I had to let them cool for so long- haha. I had a hard time getting the condensed milk mixture thick enough but probably because I had an electric stove instead of gas like I’m used to. Wonderful recipe!

      1. Brittany Mullins
        September 7, 2020 AT 5:54 pm

        I know, that’s definitely the hardest part is waiting for them to cool!! So glad these bars were a hit. Thanks for making them, Danielle. 🙂

    2. Karen
      August 12, 2020 AT 11:11 pm

      You have got to be kidding me, this recipe was so long in the same amount of time it took to make it a could’ve grown a tree. Not to mention the ingredients, Who in their right dang mind would spend 100$ on the ingredients to make this long crazy recipe. Who do you think I am, do I have all the time in the dang world. I mean seriously what the heck

      1. CounselorChick
        September 11, 2020 AT 1:58 pm

        Typical “Karen” comment. How rude. 😂

      2. Anne
        August 28, 2020 AT 4:58 pm

        This was a very simple recipe. To leave that kind of comment is a bit unfair. Many of us who follow this site have those ingredients on hand. I have grown many trees and I can assure you the was much more simple. Lol I made this the first time following all directions and didn’t like the taste of the coconut condensed milk so I buy ready made now. Makes everything easier….for me. Lol either way, fabulous recipe.

        1. Brittany Mullins
          August 28, 2020 AT 5:20 pm

          Thanks so much, Anne!! So glad you love this recipe. I appreciate you. 🙂

      3. Brittany Mullins
        August 13, 2020 AT 11:41 am

        Hi Karen. Just curious… did you make the recipe?

    3. Shelley Buckborough
      July 12, 2020 AT 5:39 pm

      Made them. Love them. I too, grew up with the traditional Magic cookie bar with eagles brand sweetened condensed milk. I saw this recipe and said, oh, trying this one. And, true to your word…..who could tell the difference. And, actually, I like your version better! Thanks again for doing what you do! Much appreciated.

      1. Brittany Mullins
        July 13, 2020 AT 1:19 pm

        Ahh that makes me so happy to hear, Shelley! I’m so glad you enjoyed this recipe. Thanks for making it and for coming back to leave a comment + star rating. The reviews are super helpful for other readers, so I appreciate it. 🙂

    4. Tina
      June 16, 2020 AT 10:40 am

      My kids and I made these yesterday and the bars are delish — they say they taste just like Girl Scout Samoas! Thanks for another yummy, healthier, sweet treat recipe I don’t feel guilty about giving my kiddos.

      1. Brittany Mullins
        June 17, 2020 AT 5:34 pm

        Ahh that makes me so happy to hear, Tina!! I’m so glad these bars were a hit. Thanks for making them and for coming back to leave a comment + star rating. I so appreciate it. <3

    5. Christine
      June 3, 2020 AT 2:31 pm

      Hi I don’t have coconut sugar so can I sub maple syrup? Can’t wait to try these!

      1. Brittany Mullins
        June 4, 2020 AT 1:33 pm

        Hey Christine – Do you have a granulated sweetener like brown sugar or cane sugar? I would go for one of those options as the consistency is more similar to that of coconut sugar. Using maple syrup might work, but it also might make the condensed milk too liquidy.

        1. Molly Foster
          June 17, 2020 AT 1:36 pm

          I tried brown sugar and my first try came out grainy and burnt at 45 minutes. I tried again and stirred for 30 minutes on low heat until it was carmel color and runnier than the video provided. It seemed to work fine, just a bit runnier. I also chopped up dates since I didn’t have enough chocolate chips. It’s in the oven now! Looking forward to trying this yummy desert!

          1. Brittany Mullins
            June 17, 2020 AT 5:28 pm

            Ohhh I’m so sorry the first batch didn’t turn out for you, but thank you for letting me know. How did the second batch turn out and taste?!

    6. LM
      May 22, 2020 AT 11:58 am

      Is there a gluten free substitute for the almond flour??

      1. Brittany Mullins
        May 22, 2020 AT 7:43 pm

        Almond flour is gluten-free!

        1. LM
          May 27, 2020 AT 12:51 pm

          My apologies, I meant GF and nut free!!

          1. Brittany Mullins
            May 27, 2020 AT 1:09 pm

            You could try oat or gluten-free AP flour. I haven’t tried it, so I’m not 100% sure if the ratios should be the same, but let me know what you end up trying and how it turns out!

            1. LM
              May 29, 2020 AT 9:06 pm

              Thanks so much Brittany, can’t wait to try this! Love your recipes 🙂

    7. Diane
      April 26, 2020 AT 10:53 pm

      It was a disaster. I did everything to the directions and the liquid did not reduce down. I had no idea what spreading meant. In my case it means you pour over the crust. They did not turn out. Wish I had a video I could have referred to.

      1. Brittany Mullins
        April 27, 2020 AT 11:42 am

        Hi Diane. I’m so sorry the recipe didn’t turn out for you. Were you using regular canned coconut milk to make the sweetened condensed coconut milk? Did you change anything with the ingredients?

    8. Katherine
      April 22, 2020 AT 8:02 pm

      I have a complaint. These are too delicious and my boyfriend demands them too frequently. It’s straining our relationship. Please, think twice before posting such an amazing, easy, and adaptable recipe again. Jk, never stop.

      1. Brittany Mullins
        April 23, 2020 AT 1:10 pm

        Haha!! You had me worried for a second. 🙂 I’m so glad you guys are loving these bars, Katherine!! I so appreciate you taking the time to come back to leave a comment + star rating. It means the world to me!

    9. Morgan
      April 9, 2020 AT 11:25 am

      Hi Brittany, thank you for all of the delicious recipes! I was wondering if for the crust, you could just use vegan Graham crackers and coconut oil, and if you would happen to know roughly how much that would require?
      I am soooooo excited to try these, haven’t had these bars in YEAAARSSS!
      Thank youuuu :))

      1. Brittany Mullins
        April 9, 2020 AT 4:43 pm

        You’re so welcome, Morgan!! I’m sure you could, I haven’t tried it so I’m not sure how many graham crackers you would need, but I’d just experiment with it. 🙂 Let me know if you try it and how the bars turn out!!

    10. Alanna
      March 27, 2020 AT 5:20 pm

      The recipe is good, all the flavours are delicious. However, realistically this makes 9servings. 16 servings in an 8×8 is 1/2 inch by 1/2 inch…
      I also would do 1.5x the crust recipe to make it thicker, it barely went to the edges of an 8×8 pan.

      1. Kaitlyn
        April 29, 2020 AT 6:40 am

        Absolutely delicious! I took one shortcut and used a can of sweetened condensed coconut milk but otherwise followed the recipe exactly. Yum, my husband and I loved these. Love all of the recipes we’ve tried from your site!

        1. Brittany Mullins
          April 30, 2020 AT 12:56 am

          Ahh yay! I’m so glad you enjoyed this recipe, Kaitlyn. Thanks for trying it and for coming back to leave a comment and star rating. I really appreciate it!

    11. Sarah
      March 22, 2020 AT 10:23 pm

      This was so frikin’ good! I never comment on recipe blogs but for this one I just had to. My husband requested magic squares like the ones he grew up eating but minus all the crap. And here we are! So so good!

      1. Brittany Mullins
        March 23, 2020 AT 4:08 pm

        Ahh this makes me so happy to read, Sarah! 🙂 I’m so glad these bars were a hit. Thanks for trying my recipe and for coming back to leave a comment and star rating. I really appreciate it.

    12. Julie
      March 21, 2020 AT 9:08 pm

      Just made these. First the sweetened condensed coconut milk- omg just sipping it with a spoon! I did have to use regular sugar as I was out of coconut sugar. The milk took a while to make but I just did other cooking while it reduced. I baked and refrigerated them. We have already eaten like half the pan! OMG dangerous- I keep telling myself it’s mostly good fat😆

      1. Brittany Mullins
        March 22, 2020 AT 8:20 pm

        Ahh this makes me so happy to hear, Julie!! I’m so glad these bars were a hit. Thanks for tying my recipe and for coming back to leave a comment. I so appreciate it!

    13. Stacey
      February 12, 2020 AT 5:41 pm

      My partner and I devoured these! Absolutely delicious!

      1. Brittany Mullins
        February 12, 2020 AT 8:22 pm

        Aren’t they sooo good?! I’m glad they were a hit! Thanks for trying this recipe and for coming back to leave a comment + star rating, Stacey. I so appreciate it!

    14. Alexandra
      February 7, 2020 AT 12:29 pm

      Would it be possible to use cashew milk or cashew cream instead of coconut milk?

      1. Brittany Mullins
        February 10, 2020 AT 1:27 am

        Hey Alexandra – I’m not sure, I’ve never tried it! It might not turn out the same, but you can certainly try it. Let me know if you do and how the bars turn out!

    15. Émilie
      February 7, 2020 AT 8:29 am

      Omg made them yesterday, saw them on your instagram ! Wow, I think I didn’t let the coconut milk reduce enough but it was a gooey heaven. I put most of them in the freezer so I don’t eat them all ! Seriously I just wish I found this recipe earlier, I have always love magic bars but know it is not the healthiest so it had been a while since I had some, and really does taste as the less healthy version 🙂

      1. Brittany Mullins
        February 7, 2020 AT 6:31 pm

        Ahh that makes me so happy to hear, Emilie!! I’m so glad you tried this recipe and loved it. 🙂 Thanks so much for coming back to leave a comment + star rating. It means the world to me. <3

    16. Judy
      January 19, 2020 AT 7:10 pm

      I’ve been craving a good dessert with some substance (being gluten free (And rice/oat free) sometimes I miss the texture of food). This was an out of park home run – and my gluten eating husband also gave it a 5+ rating! (Darn now he and I will be competing to eat them)
      Thank you!

      1. Brittany Mullins
        January 20, 2020 AT 7:51 pm

        Ahh I love hearing that, Judy! Looks like you might have to make a double batch next time. 🙂 Thanks for coming back to leave a comment + star rating. It means the world to me!

    17. Natasha
      May 8, 2015 AT 2:44 pm

      Thank you for sharing this recipe – is it ok to substitute other kids of flour – eg coconut flour, oat flour? what would that change the baking time?

      1. Brittany Mullins
        May 8, 2015 AT 6:41 pm

        I’m not 100% sure because I’ve only tried it with almond flour, but feel free to experiment! Coconut flour typically requires more liquid so I’d probably use less (maybe 1/2 cup instead of 3/4 cup)? Let me know how they turn out if you try them. 🙂

    18. Dixya @ Food, Pleasure, and Health
      February 4, 2015 AT 8:04 am

      this is pretty sweet!!! my family is obsessed with classic magic cookie bars, i wonder if i can trick them with these.

      1. Brittany Mullins
        February 4, 2015 AT 8:38 am

        I bet they’ll love this version. They’re just as good.

    19. ahejl
      February 3, 2015 AT 3:33 pm

      These look soo yummy! Thank you so much for offering vegan, gluten free recipes – it’s such a huge help.

    20. taramdeal
      February 3, 2015 AT 2:05 pm

      Yum! These sound absolutely amazing!

    21. backyardowl
      December 27, 2014 AT 7:05 pm

      I made them tonight! They turned out beautifully – and that condensed coconut milk is amazing. 🙂

      1. Brittany Mullins
        December 28, 2014 AT 11:30 am

        Hooray! So happy that they turned out well. Enjoy! 🙂

        1. Kris
          December 15, 2019 AT 11:24 pm

          Wondering if walnut flour could be used , as. my daughter is sensitive to almonds
          Thank you for postinng your recipes!

          1. Brittany Mullins
            December 17, 2019 AT 2:12 pm

            Hey Kris – Yes, I think walnut or oat flour would work just fine as a replacement for the almond flour. Let me know how they turn out for you if you make these bars. 🙂

    22. backyardowl
      December 15, 2014 AT 12:04 pm

      This recipe looks wonderful! I’m planning to make these for the holidays this year. My dad requested a healthier version of magic bars, and I think this recipe looks like the perfect fit.

      1. Brittany Mullins
        December 16, 2014 AT 11:51 am

        Yay! Let me know how they turn out.

    23. Jen
      August 25, 2014 AT 12:14 pm

      Seriously?! I haven’t had these in SOOO long! Can’t wait to try them!

    24. Sarah
      March 10, 2014 AT 5:41 am

      I made these cookie bars last week and, even though they were slightly singed, they were delish! I made them again yesterday and they were even better because I didn’t burn them this time! My mum used to make the 7 layer cookie bars on rare occasions when I was a kid, and I remember them as yummy, delectable treats – and very rich. This vegan, refined-sugar free recipe is just as good – actually better since they are so benign.

      Many thanks for the great recipe!

    25. Alyssa
      February 26, 2014 AT 2:11 pm

      These were good. But I couldn’t get the coconut milk/coconut sugar to reduce and thicken. Any tips?

      1. Brittany Mullins
        February 26, 2014 AT 4:14 pm

        hmmmm.. it does take quite a long time (about 45 minutes) — did you have it simmering for that long? Perhaps it wasn’t at a high enough heat during the simmer? I would also make sure the top of your pot is off while simmering. Hope these ideas help!

Subscribe + get eating!

Grab your Free 3 Day Clean Eating Meal Plan

Subscribe to our list and get your free printable PDF of the 3 Day Clean Eating Meal Plan and Shopping List!