
Magic bars have been a beloved dessert for generations, and for good reason. These incredible bars get their name from the seemingly magical way that simple layered ingredients transform into a cohesive, decadent treat during baking. This Raspberry Coconut version takes the classic concept and elevates it with tart-sweet raspberries that cut through the richness, toasted coconut that adds tropical flavor and texture, and sweetened condensed milk that binds everything together into pure bliss. Each layer contributes something special: a buttery graham cracker crust, sweet white chocolate chips, chewy coconut flakes, fresh raspberries that burst with flavor, and that signature condensed milk that caramelizes slightly as it bakes. The result is a bar cookie that’s crispy on the edges, gooey in the middle, and so rich that small squares are perfectly satisfying. They’re called magic bars for a reason, these truly do melt in your mouth.
This recipe makes 16 generous bars and takes about one hour from start to finish including baking and cooling time, making them perfect for potlucks, bake sales, or anytime you need an impressive dessert with minimal effort. Each bar contains approximately 320 calories, giving you a rich, indulgent treat that’s meant to be savored slowly.
1. Ingredients for the Crust
- Graham cracker crumbs – 2 cups (about 14 full crackers)
- Granulated sugar – 2 tablespoons
- Melted butter – 1/2 cup (1 stick)
- Salt – 1/4 teaspoon
2. Ingredients for the Layers
- Sweetened condensed milk – 1 can (14 ounces)
- White chocolate chips – 1 and 1/2 cups
- Sweetened shredded coconut – 1 and 1/2 cups
- Fresh raspberries – 1 and 1/2 cups
- Freeze-dried raspberries – 1/2 cup (crushed, optional but wonderful)
- Sliced almonds – 1/2 cup (optional, for extra crunch)
- Vanilla extract – 1 teaspoon
3. Prepare Your Pan
Preheat your oven to 350 degrees and position a rack in the center. Line a 9 by 9 inch square baking pan with parchment paper, leaving an overhang on two opposite sides. This overhang creates handles that make lifting the finished bars out of the pan much easier for clean cutting. You can also use a 9 by 13 inch pan if you prefer thinner bars, though the baking time will be slightly shorter. Spray the parchment lightly with cooking spray or brush it with a bit of butter to prevent any sticking, though the butter in the crust usually prevents this.
4. Make the Graham Cracker Crust
If you’re starting with whole graham crackers, place them in a food processor and pulse until you have fine, uniform crumbs. You can also put them in a sealed plastic bag and crush them with a rolling pin, which is therapeutic and works perfectly. In a medium bowl, combine the graham cracker crumbs, sugar, and salt. Pour in the melted butter and stir with a fork or your hands until all the crumbs are evenly moistened. The mixture should look like wet sand and hold together when squeezed. If it seems too dry and won’t hold together, add another tablespoon of melted butter.
5. Press the Crust
Dump the graham cracker mixture into your prepared pan. Using your hands or the bottom of a measuring cup, press the mixture firmly and evenly across the bottom of the pan. Make sure to get into the corners and create an even layer with no thin spots. Press down hard enough that the crust is compact and will hold together when cut, but don’t mash it so hard that it becomes rock-solid. A firm, even layer is what you’re after. The crust should come up the sides of the pan very slightly, maybe a quarter inch, but most of it should cover the bottom.
6. Pre-Bake the Crust
Place the pan in the preheated oven and bake for 8 to 10 minutes until the crust is lightly golden and smells toasty. This pre-baking step is important because it sets the crust and prevents it from becoming soggy when you add the wet toppings. The crust should be firm to the touch but not hard. Remove it from the oven and place the pan on a wire rack. Leave the oven on because you’ll be putting the pan back in shortly.
7. Add the White Chocolate Layer
While the crust is still hot, immediately sprinkle the white chocolate chips evenly over the surface. The heat from the crust will start to soften them slightly. White chocolate adds creamy sweetness that pairs beautifully with tart raspberries. If you prefer, you can use a combination of white and dark chocolate chips, or substitute with butterscotch chips for a different flavor profile. Distribute the chips as evenly as possible so every bite gets some chocolate.
8. Add the Coconut Layer
Sprinkle the sweetened shredded coconut evenly over the white chocolate chips. Make sure the coconut is distributed uniformly across the entire surface. The coconut provides chewy texture and tropical flavor that complements the raspberries perfectly. If you can find it, use the larger coconut flakes rather than finely shredded coconut because they provide better texture and don’t disappear into the bars. You can even toast the coconut first for deeper flavor, though the bars will toast it somewhat during baking.
9. Arrange the Raspberries
Gently place the fresh raspberries over the coconut layer, distributing them evenly across the pan. Try to space them out so every square will have some raspberry pieces. Press them down very gently into the coconut layer so they nestle in but don’t smash them or they’ll release too much juice. Fresh raspberries work best because they maintain some structure during baking, but you can use frozen raspberries if you thaw and drain them very well first, patting them completely dry with paper towels. If using freeze-dried raspberries, crush them into small pieces and sprinkle them over the fresh berries for concentrated raspberry flavor.
10. Add Optional Almonds
If you’re using sliced almonds, sprinkle them over the raspberry layer now. The almonds add a wonderful nutty crunch that contrasts nicely with the soft, gooey texture of the other ingredients. Toasting the almonds beforehand in a dry skillet for a few minutes intensifies their flavor, though this is optional. You can substitute with chopped pecans, walnuts, or macadamia nuts if you prefer different flavors.
11. Pour the Sweetened Condensed Milk
Open the can of sweetened condensed milk and stir in the vanilla extract. Starting from one corner, slowly drizzle the sweetened condensed milk over the entire surface of the bars, moving back and forth to cover as much area as possible. The milk will seep down through all the layers, binding everything together. Use a spoon or offset spatula to gently spread any thick puddles so the milk is distributed relatively evenly, though it doesn’t need to be perfect. Some spots will naturally have more than others. Try to make sure every area gets at least some milk. You want the milk to reach down to the crust layer.
12. Bake Until Golden
Place the pan back in the oven and bake for 25 to 30 minutes. The bars are done when the edges are golden brown and bubbling, the coconut on top is toasted to a light golden color, and the center is mostly set with just a slight jiggle remaining. Don’t overbake or the bars will be dry and hard instead of gooey and magical. The condensed milk will caramelize slightly during baking, creating that signature magic bar flavor and color. If the coconut is browning too quickly on top but the bars aren’t done in the center, tent the pan loosely with aluminum foil for the last five to ten minutes of baking.
13. Cool Completely
Remove the pan from the oven and place it on a wire cooling rack. This is the hardest part because the bars smell incredible and look so tempting, but you must let them cool completely before cutting. Hot magic bars will fall apart and be impossibly messy. Let them cool at room temperature for at least one hour, but preferably two hours. For the cleanest cuts and easiest handling, you can even refrigerate them for 30 minutes after they’ve cooled to room temperature. The cold firms up the condensed milk and makes slicing much neater.
14. Lift and Cut
Once the bars are completely cool, use the parchment paper overhang to lift the entire block of bars out of the pan and onto a cutting board. If they’re sticking, run a knife around any edges that aren’t lined with parchment. Use a large, sharp knife to cut the bars into squares. Wipe the knife clean between cuts for the neatest edges. You can cut them into 16 generous squares or 24 smaller pieces depending on how rich you want each serving. The bars are very rich, so smaller pieces are often plenty satisfying.
15. Storage and Serving
Store the bars in an airtight container at room temperature for up to three days, or in the refrigerator for up to one week. Layer them between sheets of parchment or wax paper to prevent sticking. These bars are delicious at room temperature, but many people prefer them slightly chilled from the refrigerator because the texture becomes more firm and less gooey. They’re also surprisingly good frozen and eaten like a frozen candy bar. These bars are perfect on their own, but you can also serve them with a scoop of vanilla ice cream or a dollop of whipped cream for an extra-special dessert.
16. Nutritional Information Per Bar
- Calories – 320
- Protein – 4 grams
- Total fat – 17 grams
- Saturated fat – 11 grams
- Carbohydrates – 40 grams
- Fiber – 2 grams
- Sugar – 32 grams
- Cholesterol – 25 milligrams
- Sodium – 150 milligrams
17. Helpful Tips
The graham cracker crust is the foundation of these bars, so make sure it’s firmly pressed and evenly distributed. If the crust is too loose, the bars will fall apart when cut. If you don’t have graham crackers, you can substitute with vanilla wafers, digestive biscuits, or even Oreo cookies with the cream scraped out for a chocolate crust variation. Sweetened condensed milk is not the same as evaporated milk, so make sure you’re using the right product. Sweetened condensed milk is thick, sweet, and caramel-colored, while evaporated milk is thin and unsweetened. Using the wrong one will ruin your bars. One can is usually 14 ounces, which is the perfect amount for a 9 by 9 pan. For a 9 by 13 pan, you might want to use one and a half cans for extra gooeyness. Fresh raspberries are ideal but can be expensive or hard to find year-round. Frozen raspberries work if you thaw them completely and drain off all the excess liquid. Spread them on paper towels and pat them very dry before using, or they’ll make the bars soggy. You can also use other berries like blackberries, blueberries, or sliced strawberries. Freeze-dried raspberries are a wonderful optional addition because they provide intense raspberry flavor without adding moisture. Crush them into small pieces before sprinkling over the bars. They’re available in most grocery stores in the dried fruit or baking section. The white chocolate chips can be replaced with any type of chocolate chips you prefer. Dark chocolate creates a more sophisticated, less sweet bar. Milk chocolate is a middle ground. You could even use a combination of different chips. Just maintain the same total volume. Sweetened shredded coconut is different from unsweetened coconut. The sweetened version is moister and adds sweetness to the bars, which is what you want. Unsweetened coconut will work but the bars will be less sweet overall, so you might want to add a tablespoon or two more sugar to the crust. If you’re not a coconut fan, you can reduce the amount to just half a cup, or omit it entirely and use more nuts instead, though these bars are really all about the coconut. Toasting the coconut before adding it to the bars intensifies its flavor and makes it extra crispy. Spread it on a baking sheet and toast at 350 degrees for five to seven minutes, stirring once, until golden. Watch carefully because coconut burns quickly. The vanilla extract stirred into the condensed milk adds depth of flavor. You can also experiment with almond extract for a different flavor profile, or use half vanilla and half almond for complexity. These bars are extremely customizable. You can add a layer of raspberry jam spread on the crust before adding the other ingredients for even more fruit flavor. You can drizzle melted chocolate over the cooled bars for decoration. You can add a handful of mini marshmallows with the other toppings for extra gooeyness. The basic concept of crust plus toppings plus condensed milk allows for endless variations. The bars cut most cleanly when cold, so if you’re having trouble getting neat squares, pop them in the refrigerator for 30 minutes before cutting. Use a large sharp knife and wipe it clean between each cut. A thin, sharp blade works better than a thick one. For gift-giving or bake sales, wrap individual bars in plastic wrap or place them in small cellophane bags tied with ribbon. They’re sturdy enough to transport easily and always impress. These bars are rich enough that most people find a small square satisfying. They’re incredibly sweet and dense, so a little goes a long way. Don’t feel obligated to cut huge servings. The magic of magic bars really does happen during baking as the condensed milk seeps through all the layers and caramelizes, binding everything into a cohesive whole. What goes into the pan as distinct layers emerges as something unified and special. The key to success is proper cooling time, which allows everything to set properly so the bars hold together when cut and have the perfect chewy, gooey texture.
