This post may contain affiliate links. Please read our disclosure policy.

Make this decadent gluten free dairy free chocolate cake without any dairy-free butter or milk substitutes for a cake that's designed to be made without dairy. It's rich in chocolate flavor, stays fresh at room temperature for days, and is even tender when chilled.

A square slice of gluten free dairy free chocolate cake with chocolate frosting and colorful sprinkles on a white plate with a small bite taken still on a fork, with sprinkles scattered in the background.
Want to save this recipe?
Enter your email and we’ll send it to you! Plus, get new recipes every week.

Why this recipe works

This rich chocolate cake doesn't call for any nondairy substitutes that you may not already have, so you can bake it for a dairy free friend without having to buy something special at the store. Plus, the flavor of vegan butter can have an artificial taste due to added culturing agents.

Since this cake was originally made with mayonnaise instead of a combination of an egg and oil, it's easily adapted to being made with vegan mayonnaise for an egg-free, dairy-free cake with deep cocoa flavor.

Recipe ingredients

Here are a few things to keep in mind about each of the ingredients in this cake and what role they play in a successful result:

Overhead view of labeled ingredients including gluten free flour, cocoa powder, salt, baking soda, water, egg, coffee, oil, sugar, chocolate, and vanilla bean paste in a jar.
  • Boiling water: Water of course adds moisture to bring the cake together. We use boiling water to dissolve the cocoa in boiling water in a process called “blooming,” which deepens the chocolate flavor.
  • Cocoa powder: Adds lots of rich chocolate flavor. Since this cake has baking soda in it to neutralize any acid in your natural cocoa powder, you can use natural cocoa powder or Dutch-processed, or even Hershey's Special Dark cocoa powder, which is a blend of the two.
  • Brewed coffee: Deepens the chocolate flavor without adding any noticeable coffee taste. You can use decaf or caffeinated coffee, or replace it with more water.
  • Dairy free chocolate: Adds more chocolate flavor and creates a fudgier, more dense and rich texture. You can use vegan chocolate disks or chopped chocolate. Be sure to use melting chocolate that is made for baking, and avoid chocolate chips which contain added wax to prevent them from melting in the oven.
  • Egg: Adds structure, some lift and keeps the cake from falling as it cools.
  • Oil: Adds fat for richness and mouthfeel, and keeps the cake moist for longer at room temperature and even when chilled.
  • Sugar: Adds sweetness and tenderizes the cake's crumb by locking in moisture.
  • Salt: Enhances the other flavors.
  • Vanilla extract: Vanilla extract is as delicious in chocolate cake as it is in our gluten free vanilla cake, deepening all the other flavors. Use vanilla bean paste for extra flavor.
  • Gluten free flour blend: Any well-balanced gluten free flour blend that is designed to work well to make cakes should work, as long as it has finely ground rice flour or the cake will be gritty. I like Better Batter's classic blend, Bob's Red Mill's 1-to-1 blend with an additional 1/8 teaspoon xanthan gum (the blend has some gum but not enough), or Vitacost's Multi-Blend gluten free flour with added xanthan gum as listed in the recipe. Avoid Nicole's Best here, since it contains dairy.
  • Baking soda – Helps give the cake lift, and neutralizes acidic ingredients like natural cocoa powder, if you're using it.
Overhead view of a frosted square chocolate cake with colorful sprinkles on parchment paper, with a knife and a small bowl of sprinkles nearby.

How to make gluten free dairy free chocolate cake (step by step photos)

This visual guide demonstrates how to make this cake in your own kitchen and includes an explanation for each step. For the exact ingredient amounts and instruction, please see the recipe card below.

Make the hot chocolate mixture
In a 4 cup/950 ml heat-safe measuring cup or medium-size bowl, whisk boiling water, hot brewed coffee and 1/2 cup cocoa powder. The cocoa powder will resist combining so keep whisking until it's smooth.

Add chopped dairy free chocolate to the hot mixture and whisk it in so it melts, then let the mixture sit for 5 minutes so the cocoa powder blooms, or develops its full flavor potential.

Add the remaining wet ingredients
The chocolate mixture should be warm, but no longer hot, so it's cool enough enough that it won't cook the egg when you add it. Add an egg, oil, sugar and vanilla. Whisk vigorously to emulsify the egg, oil and water together into a stable mixture that ensures even moisture distribution in the cake. This creates a glossy mixture that won't turn greasy.

Whisk the dry ingredients
In a large separate mixing bowl, whisk together gluten free flour, xanthan gum, salt and baking soda to avoid any pockets of leaveners.

Combine wet and dry ingredients
Create a well in the center of the dry ingredients and pour in the wet ingredient mixture so you can incorporate them together gradually, decreasing mess and creating a more uniform batter quickly and easily.

Finish the cake batter
Whisk together the dry and wet ingredients. As you mix, it will turn smooth and glossy. Make sure to scrape the bottom of mixing bowl to incorporate any dry patches into the batter.

If you'd like to add chocolate chips, you can mix in up to 4 ounces of dairy free chocolate chips now using a spatula. You can also scatter up to 1 ounce more on top of the raw cake after transferring it to the pan.

Transfer the batter
Scrape the batter into a lined baking pan, and smooth it into an even layer with a small spatula. The batter will be thick enough to spread, but not so thick that spreading is difficult.

Bake the cake
Bake at 350°F until the cake is rounded at the edges, and a tester inserted in the center comes out with moist crumbs attached, at most. If the tester comes out wet but you're concerned you may overbake the cake, reduce the oven temperature to 325°F or even lower until done.

Cool in the pan
Let the cake cool completely in the pan while it rests on a wire rack. The cake is so moist that, if you try to turn the cake over onto a wire rack and remove the pan before it's completely cool, it will stick to the rack.

Expert tips

Avoid olive oil

Olive oil has a distinct fruity and earthy flavor that will compete with the chocolate flavor of this cake. Any neutral oil without any flavor of its own will work though. Try canola, vegetable, grapeseed, avocado, or peanut oil.

Try canned dairy free frosting

I love the taste of shelf stable frosting in the can, and many of them are gluten free and dairy free. Miss Jones brand canned frostings are gluten free and dairy free; so are many Pillsbury and Duncan Hines frostings, but always read labels to be sure. To give canned frosting more of a homemade consistency, attach one beater to a handheld mixer, insert it in the can, and beat until smooth before using to frost the cooled cake.

Don't skip the coffee

Brewed coffee deepens the chocolate flavor and we use so little that you really don't taste it, so I recommend using it even if you don't like the taste of coffee. You can also double down on the coffee and replace some more or all of the hot water with more coffee. Espresso granules dissolved in the boiling water should also work well.

Ingredient substitutions

Egg free

You can try using a 150 grams of a vegan mayonnaise in place of the egg and oil, or try an egg replacer like Bob's Red Mill Egg Replacer, a chia or flax egg, or JustEgg liquid egg replacer (in the refrigerated case).

Oil

This recipe was originally developed to use mayonnaise in place of oil and eggs. I found that the crumb of the cake was too fragile, so I reworked it for a cake made with 2/3 cup of oil and 1 egg. The result is a more tender cake with a crumb that's still very moist but less fragile. If you'd like to avoid using oil as an individual ingredient, though, you can replace the oil and the egg with 2/3 cup (150 grams) full-fat mayonnaise at room temperature.

Coffee

If you want to avoid coffee altogether, you can use more boiling water in its place. Decaffeinated coffee works just as well. Keep in mind that chocolate and cocoa powder also add some caffeine.

Chocolate

You can't leave out the cocoa powder and chocolate to make this into a vanilla cake, but if you'd like, you can leave out the chocolate as a separate ingredient. The cake will have a more mild chocolate flavor and will be overall less rich. For a vanilla version, try our vanilla-flavored gluten free dairy free cake.

A square slice of chocolate cake with chocolate frosting and colorful sprinkles on a white plate with a fork beside it and a small bowl of sprinkles nearby.

Storage instructions

This cake is moist enough that it will stay fresh on the counter, covered well, for a couple of days. Wrap the cooled and unfrosted cake tightly in plastic wrap, and store it at room temperature for 3 to 5 days. Once you frost the cake, it's really hard to wrap it tightly, so it's best to serve it the same day after frosting.

For longer storage, wrap this cake tightly in freezer-safe wrap like Glad Press ‘n' Seal. You can freeze it frosted or unfrosted, but it's easiest to store the uncut cake unfrosted.

If you have leftover cake that's already been frosted, slice it into squares and wrap each frosted square tightly on its own, then freeze. Defrost at room temperature, or in the refrigerator.

Go Ad-Free

Gluten Free Dairy Free Chocolate Cake Recipe

5 from 51 votes
Prep Time: 20 minutes
Cook Time: 35 minutes
Setting time for frosting: 20 minutes
Yield: 9 slices
This gluten free dairy free chocolate cake is rich in chocolate flavor with a soft, tender crumb and a rich chocolate frosting.
Save this recipe!
Get this sent to your inbox, plus get new recipes from us every week!

Ingredients 

For the cake

  • ¾ cup (6 fluid ounces) boiling water
  • ¼ cup (2 fluid ounces) strong brewed coffee, hot (See Recipe Notes)
  • ½ cup (40 g) unsweetened cocoa powder, (natural or Dutch-processed)
  • 2 ounces dairy-free chocolate, discs, or chopped
  • 1 (50 g out of shell) egg, at room temperature (See Recipe Notes)
  • cup (150 g) neutral oil, vegetable, canola, peanut, grapeseed, and avocado all work (See Recipe Notes)
  • ¾ cup (150 g) granulated sugar
  • 1 teaspoon pure vanilla extract, or vanilla bean paste
  • 1 ¼ cups (175 g) all purpose gluten free flour blend, (See Recipe Notes)
  • ½ teaspoon xanthan gum, omit if your blend already contains it
  • 1 /4 teaspoon kosher salt
  • 1 teaspoon baking soda

For chocolate frosting (optional)

  • 10 ounces dairy-free dark chocolate, chopped
  • ¾ cup (6 fluid ounces) canned coconut cream, (See Recipe Notes)

Instructions 

For the cake.

  • Preheat your oven to 350°F. Grease and line an 8-inch square or 9-inch round baking pan. Set the pan aside.
  • In a medium-size, heat-safe mixing bowl or measuring cup, place the boiling water and brewed coffee and the cocoa powder, and whisk until well-combined. The cocoa powder will resist combining, so just keep whisking.
  • Add the chocolate discs or pieces to the hot mixture and whisk until melted and smooth. Let the mixture sit for 5 minutes to deepen the chocolate flavor.
  • To the chocolate mixture, add the egg, oil, sugar, and vanilla, and whisk until smooth and well-combined.
  • In a separate large mixing bowl, place the flour blend, xanthan gum, salt, and baking soda, and whisk to combine well.
  • Create a well in the center of the dry ingredients, and add the wet mixture.
  • Whisk until very smooth and well-combined. Keep whisking until the batter begins to thicken.
  • Transfer the cake batter to the prepared pan, and smooth into an even layer using a spatula or broad, flat knife.
  • Place the pan in the center of the preheated oven and bake for about 30 minutes, or until done.
  • Doneness should be determined by a few things: the cake should be puffed and rounded at the edges. It also shouldn’t jiggle when moved back and forth, and a toothpick inserted in the center should come out mostly clean (and certainly not wet).
  • Place the cake pan on a wire rack and allow it to cool completely in the pan. If you've used mayonnaise instead of an egg and oil, chill the cake pan in the refrigerator for about 30 minutes for cleaner slices.

For the topping

  • Place the chopped dark chocolate in a small, heat-safe bowl.
  • Place the coconut cream in a small, heavy-bottom saucepan and over a low flame just until melted and then simmering. Pour the hot cream over the chopped chocolate.
  • Allow the chocolate and hot cream to sit, undisturbed, for about 5 minutes before whisking until completely smooth.
  • Pour the glaze directly over the cooled cake, and allow it to set at room temperature.
  • To whip the chocolate ganache into frosting, allow it to cool at room temperature, then cover and refrigerate it until beginning to set (about 20 minutes).
  • Using a handheld mixer or a stand mixer fitted with the whisk attachment, whip the frosting until lighter in color and relatively fluffy (about 3 minutes).
  • Frost the cakes as desired, then slice into 9 equal pieces and serve.

Notes

Flour blend notes
I recommend Better Batter's original all purpose blend, Bob's Red Mill 1-to-1 (in the blue bag) with an additional 1/8 teaspoon xanthan gum (it contains gum but not enough), or Vitacost's Multi-Blend Gluten Free Flour with added xanthan gum. Nicole's Best doesn't work here because it contains dairy. 
If you'd like to make your own blend, please see my all purpose gluten free flour blends page. 
About the brewed coffee 
You can use decaffeinated coffee. You can also replace the brewed coffee with more water.
Egg and oil
In place of the egg and oil, you can use 2/3 cup (150 grams) regular, full fat mayonnaise. I can only recommend Hellmann's brand regular mayonnaise. Avoid anything flavored, any sort of light mayo, or mayo made using olive oil (which is really just light mayo by another name). The cake will rise a bit less and be a bit more fragile. 

Nutrition

Serving: 1slice | Calories: 586kcal | Carbohydrates: 55g | Protein: 6g | Fat: 40g | Saturated Fat: 17g | Polyunsaturated Fat: 5g | Monounsaturated Fat: 15g | Trans Fat: 0.1g | Cholesterol: 19mg | Sodium: 412mg | Potassium: 374mg | Fiber: 7g | Sugar: 27g | Vitamin A: 39IU | Vitamin C: 1mg | Calcium: 43mg | Iron: 5mg

Nutrition information is automatically calculated, so should only be used as an approximation.

Like this? Leave a comment below!

FAQs

How is this cake dairy free if I use mayonnaise?

Mayonnaise is, indeed, dairy free. There is sometimes confusion about whether mayonnaise is dairy free, presumably since it's so creamy and looks like dairy. It's a stable mixture of egg and oil.

Can I make cupcakes with the same cake batter?

I haven't tried making cupcakes with this batter, but I think it would work. Fill the muffin tins 2/3 of the way full and check for doneness at about 20 minutes.

About Nicole Hunn

Hi, I’m Nicole. I create gluten free recipes that really work and taste as good as you remember. No more making separate meals when someone is GF, or buying packaged foods that aren’t good enough to justify the price. At Gluten Free on a Shoestring, “good, for gluten free” just isn’t good enough!

Leave a comment

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

Recipe Rating





53 Comments

  1. Lexi says:

    5 stars
    I made this cake yesterday for Christmas dessert. My husband loves chocolate cake and I usually make a different gluten free chocolate cake but I wanted to try something different. I did add in the chocolate chips and optional chocolate to the cake. The cake was easy to make and so was the frosting. I actually liked the frosting more than traditional buttercream frosting! I will make this recipe again!

    1. Nicole Hunn says:

      So glad you gave this cake a try, Lexi and that it went over so well for the holiday. Thank you for sharing your experience!

  2. Aravna J Clerveus says:

    Good

  3. Tricia says:

    Can you make this cake into a 2 layer cake?

    1. Nicole Hunn says:

      You should be able to do that, Tricia. The crumb is softer than my classic gluten free chocolate cake, though, so it might be a little more difficult to slice as a layer cake, though. If you don’t have to be dairy free, I’d go with that cake, which I know works beautifully as a layer cake. If you need this one, though, just chill the cake layers before you assemble and then even before you slice it. That should make it work. I hope that’s helpful!

  4. Lisa says:

    Unfortunately I need to make this cake with Grandpas Kitchen Flour. I am baking for my recently diagnosed 9 year old grandson. I’ve bought all the special ingredients and despite going to 4 different stores (including two google assured me have better batter) I can’t find it. Or the other one. No time for delivery from Amazon .I need to make the dairy free gluten free cake today. Just wondering before I start if you would lessen the amount of corn starch in the recipe since Grandpas contains cornstarch and your review of this flour says it is too starchy? Thanks for your opinion and recipe. Your directions and explanations are so nice and thorough for a first timer.

    1. Nicole Hunn says:

      I’m afraid I’m not familiar with that blend, Lisa, so I can’t begin to guess at what you might be able to do to make it a better experience. Instead of baking with a gluten free flour blend, maybe you’d prefer a flourless chocolate cake or my recipe for quinoa chocolate cake, which is made with cooked quinoa as a base, no flour. My flourless recipes are designed to be made by someone who doesn’t have time to order a good gluten free flour blend and still wants to bake something delicious.

  5. Lisa says:

    I’m getting ready to make this. Can I double the recipe and make a sheet cake (not Texas sheet), like a 8×13 pan?

    1. Nicole Hunn says:

      I haven’t tried this as a doubled recipe in a large baking pan, but my concern is that the center tends to burn before it’s baked all the way through to the ends. You can try it, but I would instead recommend doubling the batter then dividing it equally among 2 pans and baking them separately.

  6. Elaine Everitt says:

    Wondering if I can make this in a bundt pan or would I have to double the recipe.
    Thanks!

    1. Nicole Hunn says:

      I’m really not sure that this cake is firm enough to hold up to being baked in a bundt pan, Elaine. But if you’d like to try you’ll have to do some math. An 8-inch cake pan typically holds about 8 cups of batter, and a bundt pan 11 or 12 cups of batter. So you’ll have to increase the yield of the cake to 1.5 times for 12 cups of batter. But depending on the size of your pan, that might be a bit too much batter. It will take some experimentation!

      1. Elaine Everitt says:

        Thanks for your quick reply, Nicole! Looks like I’ll need to make 2 8″ rounds for this birthday cake. Also, just to let you know, I’ve been following you, buying cookbooks and recommending your recipes ever since you published your first cookbook. Kudos to you!

      2. Nicole Hunn says:

        You’re so welcome, Elaine, and I’m so grateful for your loyalty and patronage all these years. It’s been a long time since that first cookbook in 2011. We’re old friends by now!! ❤️