
This is the best gluten-free chocolate cake recipe. The cake is incredibly moist with deep chocolate flavor, and it’s topped with smooth chocolate buttercream frosting. I’ve made this cake for weddings, birthdays, and every kind of celebration in between, and nobody ever knows it’s gluten-free.
The texture is perfect. Tender and fluffy, never dry or crumbly like some gluten-free cakes can be. And if you need a dairy-free chocolate cake, this recipe works for that too. Just swap the buttermilk for almond milk with vinegar, and use dairy-free butter in the frosting.
Why You’ll Love this Recipe
Ingredients

Ingredient Notes
- Gluten-Free Flour: This recipe was tested with Bob’s Red Mill 1-to-1 Gluten-Free Baking Flour, which already contains xanthan gum. I can’t verify other brands work since I haven’t tested them myself.
- Cocoa Powder: Use regular unsweetened cocoa powder, not Dutch-process. I like Hershey’s or Ghirardelli.
- Hot coffee – You might be wondering what coffee is doing in this cake, but I promise it’s essential for enhancing the chocolate flavor. You don’t taste the coffee itself. However, if you don’t have coffee on hand or don’t want to use it, you can substitute water. If you are using coffee, it’s best that it be hot or at least warm, as it will incorporate easier into the batter.
- Buttermilk – If you don’t have buttermilk, you can substitute it by mixing 1 cup of whole milk (or almond milk for dairy-free) with 1 tablespoon of apple cider vinegar.
- Vegetable oil – Oil keeps this cake incredibly moist and makes it taller than butter would. You can substitute melted butter if you want, but the texture will be slightly different.
- Eggs – Use room temperature eggs so they mix into the batter more easily.
Why is this batter so thin?
Don’t panic when you see how thin the batter is after adding the hot coffee. This is completely normal. The thin batter is what makes the cake so moist and tender. Let it sit for 2-3 minutes to thicken slightly before dividing it between the pans.

Recipe FAQs
Coffee enhances the chocolate flavor without making the cake taste like coffee. However, it’s not strictly essential. You can substitute hot water for the coffee. The cake will still be delicious, just slightly less chocolatey.
Yes! Use almond milk mixed with 1 tablespoon apple cider vinegar instead of buttermilk. For the frosting, use a 50/50 combination of vegan butter and palm shortening.
Yes! Divide the batter between 24 muffin cups and bake for 23-25 minutes. Check out my gluten-free chocolate cupcakes post for more tips.
Expert Tips
Storage Instructions
Refrigerator: Store frosted cake covered in the refrigerator for up to 5 days. Let it sit at room temperature for 20-30 minutes before serving so the frosting softens.
Freezer (Unfrosted): Wrap cooled cake layers tightly in plastic wrap, then wrap again in foil. Freeze for up to 3 months. Thaw in the refrigerator overnight before frosting.
Freezer (Frosted): Wrap the entire frosted cake or individual slices in plastic wrap and foil. Freeze for up to 2 months. Thaw in the refrigerator overnight.
Serving Suggestions
This chocolate cake is delicious with the chocolate buttercream in the recipe, but you can easily switch it up. For a chocolate and peanut butter combo, use peanut butter frosting instead. Or if you want something even richer, try chocolate cream cheese frosting.
If you want to serve it with something cold, a scoop of fresh strawberry ice cream with strawberry coulis drizzled over the top is amazing. The fruity strawberry flavor with the rich chocolate cake is such a good pairing.


Gluten-Free Chocolate Cake
Ingredients
Chocolate Cake:
- 2 cups (280 g) gluten-free all purpose flour blend - I used Bob's Red Mill 1-to-1 Gluten-Free Flour Blend*
- 2 cups (400 g) granulated sugar
- ¾ cup (75 g) cocoa powder
- 2 teaspoons baking powder
- 2 teaspoons baking soda
- 1 teaspoon salt
- 1 cup (240 g) buttermilk - or 1 cup almond milk mixed with 1 tablespoon apple cider vinegar
- ½ cup (113 g) vegetable oil - or melted butter if you prefer
- 2 (100 g) large eggs
- 1 tablespoon (13 g) vanilla extract
- 1 cup (240 g) hot coffee
Chocolate Frosting:
- 2 cups (454 g) unsalted butter - softened at room temperature (or a 50/50 mix of palm oil shortening and vegan butter)
- 1 ½ cups (150 g) cocoa powder - sifted
- 5 cups (600 g) powdered sugar - sifted
- ¼ cup (60 g) whole milk - or almond milk, you may need more to thin out the frosting
- 1 tablespoon (13 g) vanilla
- ¼ teaspoon salt
**Use the toggle button above to turn the instruction photos on and off!
Instructions
Make the Cake:
- Preheat the oven to 350°F. Grease two 8-inch round cake pans with butter. Line the bottoms with parchment paper circles. Butter the parchment paper, then dust the pans with cocoa powder, tapping out any excess.
- In a large bowl, whisk together 2 cups (280 g) gluten-free all purpose flour blend, 2 cups (400 g) granulated sugar, ¾ cup (75 g) cocoa powder, 2 teaspoons baking powder, 2 teaspoons baking soda, and 1 teaspoon salt. Whisk for about 30 seconds to make sure everything is evenly distributed and there are no lumps of cocoa powder.
- Add 1 cup (240 g) buttermilk, ½ cup (113 g) vegetable oil, 2 (100 g) large eggs and 1 tablespoon (13 g) vanilla extract directly to the bowl with the dry ingredients. Mix with an electric mixer on medium speed for about 2 minutes, stopping to scrape down the sides of the bowl halfway through. The batter should look smooth and well combined.
- Reduce the mixer speed to low. Carefully and slowly pour in 1 cup (240 g) hot coffee while the mixer is running. Mix until just combined, about 30 seconds. The batter will be very thin. Let the batter sit for 2-3 minutes to thicken slightly before pouring into the pans.
- Divide the batter between the two prepared cake pans. I like to use a food scale to ensure that my layers have approximately the same amount of batter.
- Bake at 350°F for 30-35 minutes. The cakes are done when a toothpick inserted in the center comes out clean or with just a few moist crumbs. For the most accurate test, use an instant-read thermometer. The internal temperature should read 200-205°F in the center.
- Remove the pans from the oven and place them on a wire rack. Let the cakes cool in the pans for 10 minutes.
- Run a knife around the edges of the pans to loosen the cakes. Turn them out onto the wire rack, peel off the parchment paper, and let them cool completely before frosting.
Make the Frosting:
- While the cakes are cooling, make the frosting. In a large bowl, beat 2 cups (454 g) unsalted butter with an electric mixer on medium speed until creamy and smooth, about 2 minutes.
- Add 1 ½ cups (150 g) cocoa powder and mix until combined.
- Add 5 cups (600 g) powdered sugar, ¼ cup (60 g) whole milk, 1 tablespoon (13 g) vanilla, and ¼ teaspoon salt to the bowl.
- Beat on low speed for about 30 seconds until the ingredients start to come together. Then increase the speed to medium-high and beat for 3-4 minutes until the frosting is light, fluffy, and smooth. Scrape down the sides of the bowl as needed.
- If the frosting is too thick, add another tablespoon of milk. If it's too thin, add 2-3 tablespoons more powdered sugar.
Frost the Cake:
- Make sure the cakes are completely cool before frosting. If they're even slightly warm, the frosting will melt.
- Place one cake layer on a serving plate or cake stand. If the top is very domed, you can use a serrated knife to level it off for easier stacking.
- Spread about 1 cup of chocolate buttercream evenly over the top of the first layer, leaving about ¼ inch from the edges.
- Place the second cake layer on top, pressing down gently to secure it.
- Spread a thin layer of frosting over the top and sides of the entire cake. This is called a crumb coat and it helps seal in any loose crumbs. Don't worry if you can see cake through the frosting at this stage.
- Refrigerate the cake for 15-20 minutes to let the crumb coat set.
- Spread the remaining frosting over the top and sides of the cake in a thicker, final layer. Use an offset spatula or butter knife to smooth it out.
- Slice and serve. The cake is best at room temperature.
Notes
- Gluten-Free Flour: I recommend Bob’s Red Mill 1-to-1 Gluten Free Baking Flour (in the blue bag) for this recipe, which contains xanthan gum. I can’t verify other brands work since I haven’t tested them.
- Weighing Ingredients: For best results, weigh your flour and cocoa powder using a kitchen scale. This is especially important for gluten-free baking to get the right texture. Scooping with measuring cups can pack in too much flour and make the cake dense.
- Storage: Store the frosted cake covered at room temperature for up to 2 days, or in the refrigerator for up to 5 days. If you refrigerate it, let the cake sit at room temperature for 30 minutes before serving so the frosting softens and the cake tastes its best.






















