Chocolate Cakes From Scratch for Birthdays
In this article
A from-scratch chocolate birthday cake is a two-layer 9-inch cake with a tender, deeply chocolatey crumb and a glossy frosting that holds up to candles and a room full of guests. This recipe uses cocoa powder and hot coffee to bloom the chocolate flavor, while buttermilk and oil keep the cake moist for days. It is straightforward enough for a first-time baker but rich enough to feel celebratory.
Ingredients
- 2 cups (240 g) all-purpose flour
- 2 cups (400 g) granulated sugar
- 3/4 cup (75 g) unsweetened cocoa powder
- 2 teaspoons baking soda
- 1 teaspoon baking powder
- 1 teaspoon fine salt
- 2 large eggs, room temperature
- 1 cup (240 ml) buttermilk, room temperature
- 1/2 cup (120 ml) neutral oil, such as canola or vegetable
- 2 teaspoons vanilla extract
- 1 cup (240 ml) hot brewed coffee (or hot water)
- For the frosting: 1 cup (226 g) unsalted butter, softened
- 3 1/2 cups (420 g) powdered sugar
- 1/2 cup (50 g) unsweetened cocoa powder
- 1/3 cup (80 ml) whole milk or cream
- 1 teaspoon vanilla extract
- Pinch of salt
Instructions
- Heat the oven to 350°F (175°C). Grease two 9-inch round cake pans, line the bottoms with parchment paper, and grease the paper.
- In a large bowl, whisk together the flour, sugar, cocoa, baking soda, baking powder, and salt until no lumps of cocoa remain.
- In a separate bowl, whisk the eggs, buttermilk, oil, and vanilla until smooth.
- Pour the wet ingredients into the dry and whisk just until combined; the batter will be thick.
- Slowly whisk in the hot coffee. The batter will become thin and glossy. Do not overmix.
- Divide the batter evenly between the prepared pans (about 2 1/2 cups each).
- Bake for 30 to 35 minutes, until a toothpick inserted in the center comes out with a few moist crumbs. Rotate the pans halfway through if your oven bakes unevenly.
- Cool the cakes in the pans for 10 minutes, then turn them out onto a wire rack, remove the parchment, and cool completely before frosting, about 1 hour.
- For the frosting, beat the softened butter until creamy. Add the powdered sugar, cocoa, milk, vanilla, and salt, and beat on low to combine, then on medium-high for 2 to 3 minutes until fluffy. Add a splash more milk if it is too stiff.
- Place one cake layer on a plate, spread about 3/4 cup frosting over it, top with the second layer, and frost the top and sides. Decorate as desired.
Tips
- Do not skip the hot coffee; it intensifies the chocolate flavor without making the cake taste like coffee. Hot water works if you prefer.
- Room-temperature eggs and buttermilk emulsify better and give a lighter crumb. If you forget to set them out, place the eggs in warm water for 10 minutes and stir a tablespoon of lemon juice into the milk and let it sit for 5 minutes.
- Weigh your flour if you can; scooping from the bag can pack in up to 20% extra and make the cake dry. If using cups, spoon the flour into the cup and level it.
- Never eat raw batter or dough containing raw flour or eggs. Raw flour can carry bacteria, and raw eggs may carry Salmonella. Wash hands, bowls, and utensils after contact with raw batter.
Serving Suggestions
Serve the cake at room temperature with a scoop of vanilla ice cream or a spoonful of lightly sweetened whipped cream. For a birthday, press candles into the top layer just before serving and keep them away from any paper decorations. A small pile of fresh raspberries or a drizzle of ganache adds color and cuts the sweetness. Slice with a long, thin knife dipped in hot water and wiped dry between cuts for clean portions.
Variations
- Chocolate chip cake: Fold 1 cup (170 g) semisweet chocolate chips into the batter after the coffee.
- Mocha cake: Use strong brewed coffee in place of the hot water and add 1 tablespoon espresso powder to the dry ingredients.
- Sheet cake: Bake in a greased 9x13-inch pan for 35 to 40 minutes; frost the top only.
- Gluten-free: Substitute a 1-to-1 gluten-free flour blend for the all-purpose flour; add 1/2 teaspoon xanthan gum if the blend does not contain it.
Storage and Reheating
Store the frosted cake covered at room temperature for up to 3 days, or refrigerate for up to 5 days; bring to room temperature before serving for the best texture. Unfrosted cake layers can be wrapped tightly in plastic and frozen for up to 2 months; thaw overnight in the refrigerator. Frosting can be refrigerated for up to 1 week or frozen for up to 3 months; rebeat after thawing. To refresh a slightly dry slice, microwave it for 10 to 15 seconds, but do not overheat or the frosting will melt.
Frequently Asked Questions
Can I make the cake ahead of time?
Yes. Bake and cool the layers, wrap them tightly, and keep them at room temperature for 1 day or freeze for up to 2 months. Frost the cake the day you plan to serve it for the freshest look.
Why did my cake turn out dry?
The usual causes are overbaking or too much flour. Check the cake at the low end of the time range, and weigh the flour or spoon-and-level it rather than scooping directly from the bag.
Can I use natural cocoa instead of Dutch-process?
Yes. This recipe is formulated with natural cocoa and baking soda. If you swap in Dutch-process cocoa, the cake may rise less because Dutch cocoa is less acidic; for best results, stick with natural cocoa or use a recipe written for Dutch-process.
How do I know when the cake is done?
A toothpick inserted in the center should come out with a few moist crumbs, not wet batter. The cake should also pull slightly away from the sides of the pan and spring back when lightly pressed.
Can I freeze the frosted cake?
It is possible but not ideal; the frosting can weep or crack on thawing. Freeze unfrosted layers instead, and frost after thawing for a neater result.
Is it safe to eat the raw batter?
No. Raw flour and raw eggs can carry harmful bacteria. Only taste batter made with heat-treated flour and pasteurized eggs, or skip tasting altogether.