share this post

Keto Magic Cookie Bars

4.95 from 80 votes
Jump to Recipe Pin This Recipe!

This recipe may contain Amazon or other affiliate links. As an Amazon Associate I earn from qualifying purchases.

These Keto Magic Cookie Bars are crispy, buttery shortbread bars topped with shredded coconut, sugar-free chocolate chips, walnuts, pecan, and Homemade Keto Condensed Milk!

Keto magic cookie bars are an easy, popular American dessert.

These bars are called ‘magic’ because they magically turn into a layered bar without having to mix the layer ingredients.

Usually, the traditional recipe is very high in sugar and carbs. In fact, the regular recipe is made of sweetened condensed milk, store-bought graham crackers, and chocolate chips.

The keto magic bar version is a sugar-free and gluten-free version of this popular dessert.

A magic bar is a 5-layer dessert bar that magically forms by simply layering each ingredient into a square pan. It’s made of:

  • Shortbread crust
  • Coconut layer
  • Chocolate layer
  • Nut layer
  • Condensed milk

Keto Condensed Milk

Before starting this recipe, make a batch of my keto condensed milk recipe. It’s a delicious keto-sweetened condensed milk with no sugar.

You will use the entire batch of this low-carb condensed milk recipe to make these magic bars.

You can make this condensed milk recipe 1 or 2 days before making this magic bar keto recipe.

To make this sugar-free condensed milk, you will need:

  • Butter
  • Heavy Cream
  • Vanilla
  • Powdered Erythritol – not crystal! To make your own powdered sugar-free sweetener, bring 2 cups of crystal erythritol into a high-speed blender. Blend until it becomes fine and powder forms. It is the cheapest way to make it at home! Store in a sealed container in the pantry for up to 3 months.
  • Xanthan gum

Ingredients for the Keto shortbread crust

First, prepare the keto shortbread crust by combining the ingredients below into a large mixing bowl.

To make this grain free sugar free crut, you need:

  • Almond Flour – use ultra-fine, not almond meal. Learn how to pick your keto flour.
  • Erythritol – don’t use xylitol, or the crust will be too soft! Convert your sweeteners with my Sweetener Converter.
  • Coconut Oil or melted butter if preferred.
  • Water
  • Vanilla Extract
  • Salt

Prebaking The Crust

Pressing the base layer of a keto magic cookie bar on a large baking pan with a silicone spatula.

Preheat the oven to 320°F (160°C). Line an 8-inch x 8-inch baking pan with parchment paper.

Then, press the shortbread dough evenly into the baking dish to fully cover the surface with the same thickness all over the pan.

Press the dough with a spatula or the back of a spoon to smoothen the surface.

Prick the crust with a fork and prebake the crust for 12 minutes, until golden. Cool it down before assembling the low-carb magic bar layers.

Assembling The Layer

Keto Magic Cookie Bars

A magic cookie bar magically creates layers in the oven.

To make this happen, you must sprinkle the ingredients evenly all over the baking dish in this order:

  • Sugar-free chocolate chips – it’s important to start with the first layer of chocolate chips, not the coconut, or the coconut won’t stick well to the shortbread base.
  • Half the amount of unsweetened shredded coconut.
  • Remaining shredded coconut.
  • Sugar-free chocolate chips.
  • Finely chopped pecans and walnuts.
  • 1 batch of homemade sugar-free condensed milk.

The chocolate chips and sugar-free condensed milk melt in the oven, sticking the layer together and forming the magic cookie bars recipe!


Pouring condensed milk on the Keto Magic Cookie Bars.

Gently bake the bar at 320°F (160°C). Do not bake at a higher temperature to avoid burning the chocolate chips.

Bake for 20 to 25 minutes or until all the ingredients are melted and bubbles form on the side of the bars.

Cooling Down

Cool the bars down at room temperature first.

I recommend 10 minutes in the baking dish, then pull out the magic bars from the pan, lifting the pieces of parchment paper hanging out of the dish.

Transfer onto a cooling rack for 1 hour.

Finally, pop the rack with the bars in the fridge for at least 3 hours or overnight.

This is crucial to set the layers. It makes the cutting easy and prevents the bars from crumbling or the layers from sticking to each other.

Keto Magic Bars

Want To Save This Recipe?

Enter your email & get this recipe sent to your inbox.

This field is for validation purposes and should be left unchanged.

Storage Instructions

You can store the bars in a sealed container in the fridge for up to 5 days.

You can also freeze each bar in an individual container and thaw it the day before at room temperature.

Frequently Asked Questions

How Do Magic Cookie Bars Taste?

Keto magic cookie bars are buttery shortbread cookie bars with crunchy chocolate, and coconut nut layers topped with condensed milk – that actually tastes like caramel sauce!
It is a very sweet bar, perfect for a keto low-carb dessert during the holiday season, with only 4.6 grams of net carbs per serving.

More Keto Bar Recipes

If you enjoy easy keto bars, you’ll also love the following recipes:

Did You Like This Recipe?

Leave a comment below or head to our Facebook page for tips, our Instagram page for inspiration, our Pinterest for saving recipes, and Flipboard to get all the new ones!

Keto Magic Bars
4.6gNet Carbs
These Keto Magic Cookie Bars are an easy keto dessert recipe for coconut and chocolate lovers with gooey Keto Condensed Milk.
Prep: 10 minutes
Cook: 20 minutes
Total: 30 minutes
Yield: 12 bars
Serving Size: 1 bar
4.95 from 80 votes


Shortbread crust

Coconut layer

This recipe may contain Amazon or other affiliate links. As an Amazon Associate I earn from qualifying purchases.


  • Before you start, prepare 1 batch of my homemade keto condensed milk recipe here.
  • Preheat oven to 320°F (160°F). Line an 8-inch x 8-inch non-stick brownie pan, grease with oil spray (avoid glass pans, or the bar will stay soft!). Set it aside.
  • In a large mixing bowl, add almond flour, erythritol, salt, melted coconut oil, water, and vanilla.
  • Stir until it forms a shortbread dough that sticks together into a ball. If too dry and crumbly, add 1 teaspoon extra water at a time, knead until it sticks together. It shouldn't be runny or too wet.
  • Transfer the dough onto the prepared pan and press with your hands to evenly cover the surface of the pan. Smooth with the back of a spoon and prick the crust with a fork
  • Pre-bake crust for 12 minutes. After that time, remove the pan from the oven and set it aside at room temperature to cool down for at least 10 minutes.

Assemble the magic bar layers

  • Sprinkle the ingredients all over the pre-baked shortbread crust in this order to form layers 1/2 cup sugar-free milk chocolate chips, 1/2 cup unsweetened shredded coconut, 1/2 cup sugar-free dark chocolate chips, and remaining 1/2 cup unsweetened shredded coconut. To finish, sprinkle the finely chopped walnuts and pecan.
  • Now drizzle the keto condensed milk all over the bar and press with the back of a spatula to make sure all the ingredients are packed onto the crust.
  • Bake on the center rack of the oven at 320°F (160°C) for 20-25 minutes or until golden brown on top and bubbly on the sides.
  • Remove from the oven and cool in the pan for 15 minutes. Then, pull out the hanging pieces of parchment paper to release the bar and place it on a cooling rack.
  • Cool the bars down for at least 1 hour on the rack, and then place the rack with the bars for 3 hours in the fridge (or overnight) before slicing into bars. Don't slice before refrigerating, or the bars can be fragile and crumble apart.

Storage and freezing

  • Store in the fridge, in a cookie jar or sealed container for up to 5 days, or freeze in ziplock bags and defrost at room temperature 3 hours before eating.
Tried this recipe?Mention @sweetashoneyrecipes
Nutrition1 bar
Yield: 12 bars


Serving: 1 barCalories: 405.2 kcal (20%)Carbohydrates: 13.4 g (4%)Fiber: 8.8 g (37%)Net Carbs: 4.6 gProtein: 5.9 g (12%)Fat: 40.3 g (62%)Saturated Fat: 18.4 g (115%)Cholesterol: 41.5 mg (14%)Sodium: 86.1 mg (4%)Potassium: 120.6 mg (3%)Sugar: 1.6 g (2%)Vitamin A: 451.9 IU (9%)Vitamin C: 0.4 mgCalcium: 60.8 mg (6%)Iron: 1.2 mg (7%)
Carine Claudepierre

About The Author

Carine Claudepierre

Hi, I'm Carine, the food blogger, author, recipe developer, published author of a cookbook and many ebooks, and founder of Sweet As Honey.

I have an Accredited Certificate in Nutrition and Wellness obtained in 2014 from Well College Global (formerly Cadence Health). I'm passionate about sharing all my easy and tasty recipes that are both delicious and healthy. My expertise in the field comes from my background in chemistry and years of following a keto low-carb diet. But I'm also well versed in vegetarian and vegan cooking since my husband is vegan.

I now eat a more balanced diet where I alternate between keto and a Mediterranean Diet

Cooking and Baking is my true passion. In fact, I only share a small portion of my recipes on Sweet As Honey. Most of them are eaten by my husband and my two kids before I have time to take any pictures!

All my recipes are at least triple tested to make sure they work and I take pride in keeping them as accurate as possible.

Browse all my recipes with my Recipe Index.

I hope that you too find the recipes you love on Sweet As Honey!

Posted In:

Leave a comment

4.95 from 80 votes (78 ratings without 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.

    7 Thoughts On Keto Magic Cookie Bars
  1. I’m eating a magic cookie bar as I type this comment. They are absolutely AMAZING. I used Lily’s milk chocolate chips and Lily’s salted caramel chips and these bars are divine!!! OMG!!! When I made the condensed milk I KNEW the bars were going to be over the top delicious. Oh and I didn’t wait 3 hours for them to set. It was more like 1.5 hours. A warm, gooey, chocolatey treat falling apart doesn’t scare me one bit! (They weren’t even falling apart! Also, I had to use my glass baking dish because it’s all I had and they still came out fabulous!) Thank you so much for this recipe!!! I’ll definitely freeze them so I can have one whenever.

  2. 5 stars
    Thank you for all your amazing recipes.
    Can I ask, is there anything else I can use instead of the cream
    I’m lactose intolerant
    Thank you.

  3. Hello I can’t wait to make this it looks so good. I clicked the link to see how to make home made condensed milk but it takes me to bacon wrapped asparagus. Is there a different link please. Thank you in advance.


The recipes, instructions, and articles on this website should not be taken or used as medical advice. You must consult with your doctor before starting on a keto or low-carb diet. The nutritional data provided on Sweetashoney is to be used as indicative only.

The nutrition data is calculated using WP Recipe Maker. Net Carbs is calculated by removing the fiber and some sweeteners from the total Carbohydrates. As an example, a recipe with 10 grams of Carbs per 100 grams that contains 3 grams of erythritol and 5 grams of fiber will have a net carbs content of 2 grams. Some sweeteners are excluded because they are not metabolized.

You should always calculate the nutritional data yourself instead of relying on Sweetashoney's data. Sweetashoney and its recipes and articles are not intended to cure, prevent, diagnose, or treat any disease. Sweetashoney cannot be liable for adverse reactions or any other outcome resulting from the use of recipes or advice found on the Website.