Dairy-Free Classic Yellow Cake

Layered dairy-free yellow cake with white frosting and filling

The Spruce Eats

Prep: 10 mins
Cook: 50 mins
Cool:: 10 mins
Total: 70 mins
Servings: 10 to 12 servings
Yield: 1 layer cake

Yellow cake is an essential recipe in any baker's kitchen. Totally dairy-free, this take on the classic yellow cake recipe is perfect for those who avoid dairy products. Try this go-to classic recipe where dietary restrictions, allergies, or other food intolerances aren't easy to gauge, such as school bake sales, children's birthday parties, graduation parties, and weddings.

This easy cake recipe swaps the usual butter for dairy-free margarine. Look for vegan margarine in stick form next to regular butter or in the vegan section along with vegan cheeses. Vegetable shortening will also work but will lack the buttery flavor of a yellow cake. Instead of milk, use non-dairy milk like almond, soy, rice, or oat milk.

Served either as two single-layer cakes or as a layer cake with a dairy-free frosting of your choice, this bright dessert screams celebration.

"You won't miss the dairy in this moist, flavorful cake. The cake was an easy preparation and it baked to perfection. You can frost the cake or fill it with strawberries and make a strawberry shortcake with dairy-free whipped cream." —Diana Rattray

Dairy-Free Yellow Cake/Tester Image
A Note From Our Recipe Tester

Ingredients

  • 1 cup (227 grams) dairy-free soy margarine, slightly cooler than room temperature, more for the pans

  • 2 2/3 cups (340 grams) cake flour, more for the pans

  • 2 teaspoons baking powder

  • 1/8 teaspoon fine salt

  • 2 cups plus 2 tablespoons (424 grams) granulated sugar

  • 1 1/2 teaspoons vanilla extract

  • 4 large eggs

  • 1 cup (227 grams) unsweetened almond milk (or soy milk or rice milk)

  • Dairy-free frosting, optional

Steps to Make It

  1. Gather the ingredients. Position a rack in the center of the oven and heat to 325 F.

    Ingredients for dairy-free yellow cake recipe gathered

    The Spruce Eats

  2. Grease and flour two 8-inch round cake pans or line with greased parchment rounds. Set aside.

    Two greased and floured baking pans of the same size

    The Spruce Eats

  3. In a medium bowl, sift together the flour, baking powder, and salt. Set aside.

    Flour being sifted into a bowl with a wire mesh sieve

    The Spruce Eats

  4. In a large bowl, use an electric hand mixer or stand mixer to beat together the soy margarine and sugar until fluffy, about 4 minutes.

    Fluffy beaten margarine and sugar mixture in a bowl

    The Spruce Eats

  5. Add the vanilla, beating until well combined.

    Vanilla being added to the margarine mixture

    The Spruce Eats

  6. Add the eggs, one at a time, beating well between additions.

    Eggs incorporated into the cake batter

    The Spruce Eats

  7. Add 1/3 of the flour mixture to the margarine mixture and beat until combined. Add 1/2 cup of the almond milk and beat until combined. Repeat with the remaining ingredients, ending with the remaining 1/3 flour mixture.

    Smooth cake batter in a bowl

    The Spruce Eats

  8. Pour equal amounts of batter into the prepared pans, smoothing the tops with an offset spatula. Bake until a toothpick inserted into the center of the cake comes out clean, about 50 minutes.

    Cake batter poured into the prepared pans

    The Spruce Eats

  9. Cool for 10 minutes in the pans before transferring to a wire rack to cool completely. Frost with dairy-free frosting of your choice and serve either as two single cakes or one layer cake.

    Browned cakes cooling on a wire rack

    The Spruce Eats

How to Use Dairy-Free Classic Yellow Cake

  • These cake layers can be served as two single layers or as a two-layer cake. You'll need about 1 1/2 cups per single cake layer, or between 2 and 3 cups of frosting total to frost a 2-layer cake (depending on how generous you like your frosting).
  • Yellow cake pairs well with a variety of frostings. Try dairy-free vanilla buttercream, chocolate, or cream cheese.
  • Or layer the cakes with vegan whipped cream and raspberry or strawberry jam or dairy-free lemon curd.
  • Make a British Victoria-style cake with a filling of dairy-free whipped cream and strawberry jam. Top the cake with a dusting of powdered sugar.

Recipe Variations

  • Confetti Cake - Fold 1/2 cup of rainbow sprinkles (make sure they're dairy-free) into the batter before baking. 
  • Lemon Cake - Add 2 tablespoons of finely grated lemon zest and replace 2 tablespoons of the liquid with fresh lemon juice.
  • Spiced Cake - Add flavor to the cake with warm spices, such as cinnamon, nutmeg, and cardamom.
  • Simple Syrup - Add to the cake's moistness and flavor by brushing layers with a plain or flavored simple syrup before frosting. 

How to Store and Freeze

  • The cakes can be made ahead of time and tightly wrapped and stored for up to a day before frosting. Before storing, make sure the cakes are completely cooled. If you wrap them while they're still warm, the extra humidity and heat could actually make the cake spoil faster.
  • Whether kept at room temperature or in the fridge, the cake must be completely sealed from other foods and will keep for two to three days. They will keep in the freezer for up to a month.
  • If freezing these cakes, be sure to thaw them gradually. Frozen cakes should be thawed in the fridge and then set out in a cool room to reach room temperature.
  • After the cake has been frosted, it still must be covered, but it will keep a little longer as frosting helps lock in moisture. Cake that has vegan buttercream or fondant icing will keep for three to four days in the fridge.