This post may contain affiliate links. Read our disclosure policy here.
Say hello to your new best friend for birthday parties, special occasions, or anytime you need a chocolate fix: this allergy-friendly chocolate cake! A gluten, egg, and dairy free-recipe that everyone can enjoy!

There is no denying that special occasions call for a slice of chocolate cake (or cupcakes!) but when you need an allergy-friendly recipe, things can easily get complicated -or worse, not turn out the way you hoped.
How to Make Gluten-Free Dairy-Free Chocolate Cake
This allergy-friendly chocolate cake is to-die-for. It’s one of those recipes you can make for a party or gathering, and no one will guess that you just served up gluten and dairy-free dessert!
If allergy-friendly baking sounds intimidating, don’t worry! I’ll walk you through every step of the way in the recipe video below, and then you can print the instructions and follow along from your own kitchen!
Trust me, if you can mix cake batter you can make this recipe. It’s that easy. Check it with your own eyes in this video:
Can You Freeze Cake?
Of course, nobody bakes a cake the day of the party, so I’m sure you are wondering, can this allergy-friendly cake be frozen? The short answer is yes! You can bake the layers and freeze them, take the cake out of the freezer the day of the party, make the dairy-free frosting, and assemble it.
Want to save more time? Make the entire cake and freeze it, whole, and take it out the night of the party. If you have room in your freezer, then why not? Thawing out this cake does not affect its delicious texture and flavor, and you’ll save yourself a lot of time.
I know that making an allergy-friendly cake from scratch can seem overwhelming -where do you even find the ingredients? Well, for starters, you are probably using most of them already so know that they are often easy to swap for another brand. This recipe is not brand-specific.
For most people with severe food allergies, using a mix out of the box isn’t an option, so this version allows you to select your favorite gluten-free flour.
You’ll also find that the use of chocolate non-dairy milk gives this cake a moist, rich texture that will bring everyone back for seconds. You can find this dairy-free option in the refrigerated section of your grocery.
For more clean desserts that have no gluten or nuts and focus on clean sugars check out my latest cookbook, Clean Treats for Everyone.
Hold on, did I mention the frosting? We can’t forget about a homemade allergy-friendly frosting for this cake! Let’s just say it takes the cake… to the next level.
I recommend using vegetable shortening, to keep the frosting thick and easily spreadable. You might need to double the batch since half of it seems to disappear before I can even get the cake cooled for frosting.
So let’s look through a few recipe notes before you get started on making this chocolate cake:
- Apple cider vinegar or white vinegar is essential since it will react with the baking soda and allow the cake to rise. If you hear a fizzing sound when you pour the milk/vinegar mixture into your dry ingredients, don’t be alarmed, this is good! It means it’s working! If you don’t hear fizzing, then it’s time to buy more baking soda
- The batter will be quite runny but not liquid. It should still have a bit of volume to it.
- Make sure to butter, grease, or line your cake pan with parchment paper so that you can lift it out after baking; it tends to stick a bit.

Ingredient Replacements
Through the years, I’ve gotten a lot of questions about possible ingredient swaps for this recipe. While the specific ingredients and measurements below are tried and true, I’m also sharing a couple of other options that can work if you simply must trade out an ingredient or two.
Sugar Replacements
Stevia
You cannot substitute the sugar for Stevia in this recipe as there would be a large volume difference to make up for.
Coconut Sugar
While I’ve not tested this recipe using coconut sugar, many of my readers have and report great results!
Maple Syrup or Honey
Any liquid sweeteners will change the consistency of the batter and you’ll end up with a very different cake. I do not recommend using liquid sweeteners for this recipe.
Flour Replacements
Almond Flour
While I love baking with almond flour it is not the right choice for this recipe. The liquid measurements would need to change if using almond flour and I have not tested the needed changes.
All-Purpose Flour
I have not tested this with All-purpose flour and this recipe was specifically created for gluten-free mixes. If hoping to use an all-purpose flour you would need a smaller amount of flour than listed below and could eliminate the xanthan gum.
Non-Dairy Milk Options
I used non-dairy milk, in this recipe but you can use rice milk, almond milk or coconut milk depending on what you have and what your family prefers.
Xanthan Gum
Xanthan Gum is a must-have for this recipe and for all gluten-free baking recipes. X-gum is what binds your flours together when there is no gluten in the recipe. This recipe won’t work without X-gum.
Be sure to double-check the flour you are using that it’s not already included in the mix. Some Gluten-Free Flour mixes already include xantham gum, and you wouldn’t need to add additional x-gum if your flour mix includes it.
Other Pan Sizes
Cupcakes
If using a cupcake pan adjust the cooking time to 18-22 minutes and check around minute 16.
13 x 9-inch pan
You can use a rectangle pan for this cake recipe but keep a close eye on the baking time as it will vary by a few minutes from the original recipe cooking time below.

More Gluten and Dairy Free Desserts
Want a fluffy Paleo Chocolate Cake version? This recipe is it. Made with coconut and almond flour, this recipe can also be frosted to celebrate any day! For a guilt-free snack, check out how these Healthy No-Bake Blondies are made.
If you crave pancakes, these Paleo Pancakes with Cassava Flour are fluffly, delicious, and easy to make. They will turn breakfast into your favorite meal of the day!
Gluten-, Egg-, and Dairy-Free Chocolate Cake

Ingredients
- 3 cups gluten-free all-purpose flour
- 1 ¾ cups granulated sugar
- 6 tablespoons unsweetened cocoa powder
- 2 teaspoons baking soda
- 2 teaspoons xanthan gum* if using
- 1 teaspoon salt
- 2 cups chocolate non-dairy milk
- ½ cup vegetable oil
- 2 tablespoons apple cider vinegar
- 1 teaspoon vanilla
Instructions
- Preheat the oven to 350F. Coat 2 9-inch cake pans with cooking spray and set aside.
- In a large bowl, combine the flour, sugar, cocoa powder, baking soda, xanthan gum (if using), and salt.
- In a medium bowl, combine the milk, oil, vinegar, and vanilla.
- Pour the wet ingredients into the dry ingredients. Stir until smooth, scraping the bottom and sides of the bowl.
- Pour into greased cake pans and place in the preheated oven.
- Bake for 25 to 30 minutes, or until a toothpick inserted into the center comes out clean.
- Remove from the oven and transfer the cakes to a wire rack to cool completely.
- While the cakes are cooling, make the frosting.
- Frost the cake by placing one base layer on your plate or cake stand, spreading about a cup of frosting on top, top it with another cake layer, and spread remaining chocolate frosting over the top and sides.








Jenny says
Great recipe! Just made half the recipe for cupcakes for someone at my husbands office. I used bobs red mill all purpose flour. Not the greatest flour I have to say. I’m not keen on the garbanzo bean in it ( I tasted the uncooked mix) but I was limited to what the store had on its shelf. Having said that, once baked they actually taste pretty good. I’m lucky enough not to have allergies but I’ll certainly use this recipe again. Might try swapping to another flour though 😉
Laura says
great to know that it worked well with BRM! my grocery carries it and I find it to give mixed results. thanks for giving your feedback!
Jeni says
O.M.G. Sinful!
My daughter is dairy free, soy free, gluten free, egg free, and CORN free.
I used 3 cups of rice in the blendtec for the GF flour, SO Delicious brand coconut chocolate milk, and coconut oil.
Since we can’t have corn, we can’t have powdered sugar. But my blendtec powdered raw turbinado and I added about 1 tablespoon of potato starch for each cup of sugar. I used SO delicious coconut creamer, and coconut butter for the frosting.
This is rich and decadent, and now my daughter can have cake!
I’ll try scaling back on the turbinado in future occasions. We don’t sweeten our foods, and this recipe was so very sweet and fudgey. I think our family could manage half the amount of sugar. Extended family? Had no idea!
I will add for readers that the texture for me was very dense and fudgey, similar to brownies or flourless cakes. This cake is undoubtedly no Duncan Hines fluffy boxed cake. But so much better!
Laura says
I’m so glad you loved this cake Jeni!
Toyin says
Hello,
I will like to follow this recipe for 6 cupcakes, is this possible or am I to look out for a different recipe.
I am making this for my daughter and some other kids in school with allergies for a cupcake sale day.
Please help!!!
Laura says
Toyin, the recipe will yield 24 cupcakes. The cupcakes taste really good so even kids without food allergies will like them. If you wish to halve the recipe, it’s up to you. I have not tried making in a smaller batch.
Toyin says
Thanks, I halved the recipe and got 14 cupcakes but it didn’t turn out nice. Today, I went for a Quarter with a little more liquid and stirring for a little longer to ensure the mixture was very smooth and it turned out really nice.
Thanks for this recipe,
how can I adapt it to make a different type of cupcake?
Laura says
Toyin, this recipe is not an “adaptable” recipe to make yellow cupcakes, etc. it was specifically developed to be a chocolate birthday cake/cupcakes.
Sangeeta says
Hey Laura,
I loved this recipe- finally I found an eggless cake which is neither dry nor oily- just perfect! Since I had no apple cider vinegar at hand, I substituted it with the same quantity of plain yoghurt. Also this quantity yields 24 cupcakes… Was loved by the kids n adults alike. Will certainly recommend to all!:)) Sangeeta
Laura says
So glad they were great for the birthday celebration!
Laura says
Alisha, I don’t see why you should have any issues getting these ingredients in Au. happy baking!
alisha says
Can I use just 1 tin instead of 2
alisha says
This cake mix is quite sticky and thick. Is it meant to be.
Keeley McGuire says
Hi Alisha, it really needs to baked in two tins. It will not cook/rise properly all in one. Thanks!