Baking a gluten-free cake from scratch is no harder than a regular one once you swap the flour and add a binder. The key is using a blend with xanthan gum and measuring by weight, not cups, so the crumb stays tender instead of gritty or dry. This vanilla layer cake is the version to start with: one bowl, one whisk, and a frosting that hides no flaws.
Ingredients
- 2 cups (280 g) gluten-free all-purpose flour blend with xanthan gum (like King Arthur or Bob’s Red Mill)
- 1 ½ cups (300 g) granulated sugar
- 1 tbsp (12 g) baking powder
- ½ tsp (3 g) salt
- ½ cup (115 g) unsalted butter, softened (or ½ cup/120 ml neutral oil for dairy-free)
- 3 large eggs, room temperature
- ¾ cup (180 ml) whole milk, room temperature (or any milk alternative)
- ¼ cup (60 ml) sour cream or plain yogurt (or dairy-free yogurt)
- 2 tsp (10 ml) vanilla extract
For the vanilla buttercream
- 1 cup (225 g) unsalted butter, softened
- 3 ½ cups (420 g) powdered sugar, sifted
- 2 tbsp (30 ml) heavy cream or milk
- 2 tsp (10 ml) vanilla extract
- Pinch of salt
Instructions
- Preheat oven to 350°F (175°C). Grease two 8-inch (20 cm) round pans and line the bottoms with parchment paper.
- In a large bowl, whisk together the flour blend, sugar, baking powder, and salt. Add the softened butter and mix on low speed until the mixture looks like wet sand, about 1 minute.
- Add the eggs one at a time, beating well after each. Scrape the bowl.
- Add the milk, sour cream, and vanilla. Beat on medium speed for 2 minutes, until the batter is smooth and slightly thickened. The batter will be thinner than a regular cake batter—that’s normal.
- Divide the batter between the prepared pans. Bake for 28–32 minutes, until a toothpick inserted in the center comes out clean and the top springs back when lightly pressed. The internal temperature should read 200°F (93°C) if you use a thermometer.
- Cool in the pans on a wire rack for 10 minutes, then turn out and cool completely, at least 1 hour.
- For the frosting: beat the butter until creamy, about 2 minutes. Gradually add the powdered sugar, then the cream and vanilla. Beat on high for 3–4 minutes until light and fluffy. If too stiff, add a teaspoon more cream.
- Assemble: place one layer on a plate, spread about ¾ cup of frosting on top, then place the second layer. Frost the top and sides. Decorate as desired.
Why the Flour Blend Matters
Not all gluten-free flours behave the same. A blend with xanthan gum (usually labeled “all-purpose” or “1-to-1”) already contains the binder that replaces gluten’s elasticity. If you use a single flour like almond or rice flour alone, the cake will crumble. If your blend lacks xanthan gum, add ½ teaspoon per cup of flour. Measure by spooning into the cup and leveling, or better, weigh the flour—gluten-free blends are denser and cups can vary by 20%.
Substitutions That Work, and What Changes
- Dairy-free: Use oil instead of butter (the cake will be slightly more tender), and any milk alternative plus dairy-free yogurt. The frosting needs a dairy-free butter substitute; it will be softer, so chill the frosted cake for 30 minutes before serving.
- Egg-free: Use 3 flax eggs (3 tbsp ground flax + 9 tbsp water, rested 10 minutes). The cake will be a bit denser and less fluffy.
- Less sugar: Reduce to 1 cup (200 g) and add ¼ cup (60 ml) applesauce for moisture—the crumb will be more tender but the cake less sweet.
- Vanilla bean: Scrape the seeds of one bean into the butter instead of extract for a stronger, speckled crumb.
How to Tell It’s Done Without Overbaking
Gluten-free cakes go from done to dry quickly. Start checking at 25 minutes. The toothpick should come out with a few moist crumbs, not clean—if it’s completely clean, it’s overbaked. The top should feel set, not jiggly. If the top browns too fast, tent loosely with foil for the last 10 minutes.
Make-Ahead Timeline
Up to 3 days ahead: Bake the cake layers, cool completely, wrap tightly in plastic wrap, and refrigerate. Frost the day you serve, or up to 1 day ahead—frosted cake keeps in the fridge for 3 days.
Up to 2 months ahead: Wrap cooled layers in plastic wrap then foil, and freeze. Thaw in the refrigerator overnight, then bring to room temperature before frosting.
Same day: The cake is best assembled at least 2 hours before serving so the frosting sets. Keep at room temperature if serving within 6 hours, otherwise refrigerate and bring to room temperature 1 hour before serving.
Storing and Reheating Leftovers
Store unfrosted cake in an airtight container at room temperature for up to 2 days, or refrigerated for up to 5 days. Frosted cake refrigerates well for 3–4 days. To freeze slices, wrap individually in plastic wrap and freeze for up to 2 months; thaw at room temperature for 30 minutes. Gluten-free cake dries out faster than wheat cake, so always keep it covered. Reheat a single slice in the microwave for 10–15 seconds to revive softness, but do not reheat a whole cake.
Serving and Pairing Ideas
This vanilla cake pairs with fresh berries and whipped cream, or a scoop of dairy-free sorbet. For a birthday, use a simple chocolate frosting instead—just add ½ cup (50 g) unsweetened cocoa powder to the buttercream. Serve with coffee or cold milk. If you’re stacking more than two layers, increase the frosting by half and use a cake board for stability.
Why Did My Cake Sink in the Middle?
Likely the oven door was opened too early (before 25 minutes), or the baking powder was old. Check the date on your baking powder—it loses strength after 6 months. Also, gluten-free batters are more sensitive to under-mixing; beat the full 2 minutes to develop structure. If the cake still sinks, reduce the oven to 325°F (165°C) and bake 5 minutes longer.
Can I Make This as a Sheet Cake or Cupcakes?
Yes. For a 9×13-inch (23×33 cm) pan, bake at 350°F (175°C) for 30–35 minutes. For 12 cupcakes, bake 18–22 minutes. The same batter works; just adjust the time and check with a toothpick. Frosting amounts stay the same for the sheet cake, but you’ll have extra for cupcakes.
Related
- Thanksgiving Cookie Recipes From Scratch
- Pecan Cake From Scratch: Classic Southern Recipe
- Cake for Two From Scratch: Small-Batch Vanilla Layer Cake
Safe minimum internal temperatures follow USDA FSIS; raw-fish guidance follows the U.S. FDA. See our food safety notes.
Spotted an error? Tell us and we will correct it (corrections policy).