There are certain desserts that hit you right in the gut with pure nostalgia, and magic cookie bars are one of them. The kind of treat that showed up at every potluck, bake sale, and holiday gathering in a foil-wrapped pan, still warm from someone's oven. This keto version captures every bit of that layered, gooey, coconut-loaded magic with a buttery almond-coconut flour crust standing in for the traditional graham cracker base. Each bar delivers toasted shredded coconut, crunchy pecans, melted dark chocolate, and a thick pour of homemade condensed coconut cream that bakes into a caramelized, chewy layer holding everything together.
The macro breakdown here is tailor-made for keto. Each generous bar delivers 37 grams of fat from coconut cream, butter, pecans, and coconut oil, while keeping net carbs at just 5 grams. That puts fat at roughly 85 percent of total calories, which is deep in the ketogenic sweet spot. The combination of coconut and pecans provides mostly medium-chain and monounsaturated fats, making these bars a satisfying treat that keeps you full rather than spiking your blood sugar.
From a practical standpoint, this recipe was designed for Sunday batch prep. You make one 8x8-inch pan, chill it, slice it into 8 bars, and stash them in the fridge for the whole workweek. They actually taste better after a day or two once the coconut cream layer fully sets and the flavors meld together. Pull one out after dinner, let it sit at room temperature for five minutes, and you have a dessert that rivals anything from a bakery case.
Ingredients (serves 8)
For the crust:
- 1¼ cups (125g) almond flour
- 2 tablespoons (14g) coconut flour
- 3 tablespoons (42g) unsalted butter, melted
- 1 tablespoon granulated erythritol
- ¼ teaspoon fine sea salt
For the condensed coconut cream:
- 1 can (13.5 oz / 400ml) full-fat coconut cream
- 3 tablespoons granulated erythritol
- 1 tablespoon (14g) coconut oil
- 1 teaspoon pure vanilla extract
- Pinch of fine sea salt
For the layers (in order):
- 1 cup (80g) unsweetened shredded coconut
- ½ cup (55g) pecans, roughly chopped
- 1.5 oz (42g) dark chocolate (85% cacao or higher), roughly chopped
Instructions
Preheat and prep the pan. Set your oven to 325°F (165°C). Line an 8x8-inch (20x20cm) baking pan with parchment paper, leaving a 2-inch overhang on two sides for easy lifting later. Lightly grease any exposed edges with butter or coconut oil.
Make the crust. In a medium bowl, whisk together the almond flour, coconut flour, erythritol, and salt. Pour in the melted butter and stir with a fork until the mixture resembles wet sand and holds together when pressed. Transfer to the prepared pan and press firmly into an even layer using the flat bottom of a measuring cup or your fingers. Bake for 10 minutes until the edges just begin to turn golden. Remove from the oven but leave the oven on.
Prepare the condensed coconut cream while the crust bakes. Pour the coconut cream into a small saucepan over medium heat. Add the erythritol, coconut oil, and pinch of salt. Bring to a gentle simmer, stirring frequently. Reduce heat to medium-low and cook for 8 to 10 minutes, stirring often, until the mixture has reduced by about one-third and coats the back of a spoon. It should look noticeably thicker and slightly golden at the edges. Remove from heat and stir in the vanilla extract. Set aside.
Build the layers. Scatter the shredded coconut evenly over the warm, par-baked crust. Follow with the chopped pecans in an even layer. Finish with the chopped dark chocolate, distributing it across the surface so every bar will get some.
Pour the condensed coconut cream. Slowly and evenly pour the warm condensed coconut cream over the layered toppings. Use the back of a spoon to gently nudge the cream into any dry corners, but avoid pressing down on the layers. You want the cream to seep through the gaps naturally.
Bake until set. Return the pan to the oven and bake for 22 to 25 minutes. The bars are done when the edges are deeply golden, the top layer of coconut is toasted, and the center no longer jiggles when you gently shake the pan. A slight wobble is fine as it will firm up completely during chilling.
Cool and chill. Let the bars cool in the pan at room temperature for 30 minutes, then transfer to the refrigerator. Chill for at least 2 hours, or ideally overnight. The condensed coconut cream layer needs this time to firm up properly so the bars hold their shape when sliced.
Slice and store. Use the parchment overhang to lift the entire slab out of the pan. Place on a cutting board and slice into 8 bars using a sharp knife. Wipe the blade between cuts for clean edges. Store in an airtight container in the refrigerator for up to 5 days.
Nutrition per Serving
| Nutrient | Amount |
|---|---|
| Calories | ~390 kcal |
| Fat | ~37g |
| Protein | ~6g |
| Total Carbs | ~10g |
| Fiber | ~5g |
| Net Carbs | ~5g |
Nutritional values are approximate estimates based on the stated ingredients and may vary depending on specific brands used.
Tips & Variations
Let them chill fully before cutting. This is the single most important step for clean, bakery-worthy bars. If you cut too early, the condensed coconut cream layer will still be soft and the bars will crumble apart. A full 2-hour chill (overnight is even better) transforms the texture from gooey mess to perfectly sliceable. If you are in a rush, pop the pan in the freezer for 45 minutes instead.
Toast the shredded coconut first for deeper flavor. For an extra layer of nutty, caramelized flavor, spread the shredded coconut on a sheet pan and toast at 325°F for 4 to 5 minutes, stirring once, until light golden. Watch it closely because coconut burns fast. Let it cool before layering. This adds no extra carbs but makes the coconut flavor dramatically more complex.
Watch your chocolate choice for hidden carbs. Not all dark chocolate is created equal on keto. Stick with 85% cacao or higher, and read the label carefully. A standard 1.5-ounce portion of 85% dark chocolate has about 8 grams of net carbs total, which gets divided across all 8 bars. If you want even fewer carbs, use sugar-free chocolate chips sweetened with erythritol or stevia, which can drop each bar by another 1 to 2 grams of net carbs.
Swap the pecans for your favorite nut. Walnuts, macadamia nuts, or sliced almonds all work beautifully here with nearly identical macros. Macadamia nuts bump the fat content up even further and give a more buttery, tropical flavor that pairs exceptionally well with the coconut layers. Avoid cashews, which are significantly higher in carbs than other nuts.
Double the batch for serious meal prep. Use a 9x13-inch pan and multiply all ingredients by 1.5. This gives you 12 bars, enough for nearly two full weeks of weeknight desserts. The bars actually improve after a day in the fridge as the flavors continue to develop, and they stay fresh for a full 5 days without any change in texture or taste.