Cakes

Best Chocolate Cake Recipe for Every Occasion

Updated · By Stir & Share

Total timeincludes chilling, rising or resting
1 hr 10 min
Prep
25 min
hands-on
Cook
35 min
oven or stovetop
Serves
12
as written

Jump to recipe Save

Best Chocolate Cake Recipe for Every Occasion

Ingredients

  • 1 ¾ cups (220 g) all-purpose flour
  • ¾ cup (65 g) unsweetened cocoa powder (natural or Dutch-process)
  • 1 ½ tsp baking powder
  • 1 ½ tsp baking soda
  • 1 tsp salt
  • 2 cups (400 g) granulated sugar
  • 2 large eggs, room temperature
  • 1 cup (240 ml) whole milk, room temperature
  • ½ cup (120 ml) vegetable oil (or melted coconut oil)
  • 2 tsp vanilla extract
  • 1 cup (240 ml) hot coffee or hot water
  • For the frosting: 1 cup (226 g) unsalted butter, softened
  • 3 ½ cups (420 g) powdered sugar
  • ½ cup (50 g) unsweetened cocoa powder
  • ¼ cup (60 ml) heavy cream (or milk)
  • 2 tsp vanilla extract
  • Pinch of salt

Instructions

  1. Preheat the oven to 350°F (175°C). Grease two 9-inch (23 cm) round cake pans and line the bottoms with parchment paper.
  2. In a large bowl, whisk together the flour, cocoa powder, baking powder, baking soda, salt, and sugar.
  3. Add the eggs, milk, oil, and vanilla. Beat with an electric mixer on medium speed for 2 minutes, scraping the sides as needed.
  4. Carefully stir in the hot coffee or hot water. The batter will be thin; that is correct.
  5. Divide the batter evenly between the prepared pans.
  6. Bake for 30–35 minutes, until a toothpick inserted in the center comes out with a few moist crumbs. The cakes should pull away from the sides of the pans.
  7. Cool in the pans for 10 minutes, then turn out onto a wire rack to cool completely before frosting.
  8. For the frosting: Beat the butter until creamy. Add the powdered sugar, cocoa powder, cream, vanilla, and salt. Beat on low until combined, then increase to medium-high and beat for 2–3 minutes until fluffy. Add more cream if needed for spreading consistency.
  9. Frost the cooled cakes: place one layer on a plate, spread with about 1 cup of frosting, top with the second layer, and frost the top and sides.

How to Tell It’s Done

The cake is done when a toothpick inserted into the center comes out with a few moist crumbs, not wet batter. The top will spring back when lightly pressed. The internal temperature should read about 200°F (93°C) on an instant-read thermometer if you use one. Cool completely before frosting; a warm cake will melt the frosting.

Storage and Freezing

Frosted cake keeps at room temperature for up to 3 days, covered. Refrigerate for up to 5 days; bring to room temperature before serving. The unfrosted cake layers can be wrapped tightly in plastic wrap and frozen for up to 3 months. Thaw overnight in the refrigerator before frosting. Frosted cake can also be frozen for up to 3 months; thaw in the refrigerator overnight.

Scaling the Recipe

Batch Flour Sugar Eggs Baking Time
Half (9-inch round, 1 layer) ¾ cup + 2 tbsp (110 g) 1 cup (200 g) 1 25–30 min
Full (two 9-inch rounds) 1 ¾ cups (220 g) 2 cups (400 g) 2 30–35 min
Double (four 9-inch rounds) 3 ½ cups (440 g) 4 cups (800 g) 4 35–40 min

For half batches, use one 9-inch (23 cm) pan or a 9×13-inch (23×33 cm) pan; adjust baking time. For double batches, bake in two batches or use four pans, rotating halfway through.

Equipment That Matters

Use 9-inch (23 cm) round pans for the classic two-layer look. A 9×13-inch (23×33 cm) pan works for a single layer; bake for 35–40 minutes. If you don’t have an electric mixer, beat the batter by hand with a whisk for about 3 minutes; the cake will be slightly denser but still moist. A kitchen scale gives the most accurate measurements, but spoon-and-level the flour if using cups.

Variations

Chocolate Coffee Cake

Use hot coffee instead of water for a deeper, mocha-like flavor. The coffee does not make the cake taste like coffee; it enhances the chocolate.

Peanut Butter Frosting

Swap the chocolate frosting for a peanut butter frosting: beat 1 cup (226 g) butter with 1 cup (260 g) creamy peanut butter, then add 3 cups (360 g) powdered sugar and ¼ cup (60 ml) milk. This makes a sweeter, nuttier cake.

Gluten-Free Option

Replace the all-purpose flour with a 1:1 gluten-free baking flour blend. Add ¼ tsp xanthan gum if your blend doesn’t include it. The texture will be slightly more tender and crumbly.

Why This Recipe Works

Hot liquid (coffee or water) blooms the cocoa powder, deepening the chocolate flavor and making the crumb tender. Oil keeps the cake moist for days, unlike butter-only cakes. The combination of baking powder and baking soda gives a fine, even rise. This cake is sturdy enough for a layered birthday cake, yet simple enough for a weeknight dessert.

Frosting and Filling Ideas

This cake pairs well with any buttercream, ganache, or whipped cream. For a lighter option, use a whipped cream frosting: beat 2 cups (480 ml) heavy cream with ½ cup (60 g) powdered sugar and 1 tsp vanilla until stiff peaks. For a ganache, heat 1 cup (240 ml) heavy cream until simmering, pour over 8 oz (225 g) chopped semisweet chocolate, let sit 5 minutes, then stir until smooth. Let ganache cool and thicken before spreading.

Make-Ahead and Serving

Bake the cake layers up to 2 days ahead and store unfrosted, wrapped, at room temperature. Frost the cake the day you plan to serve it for the freshest appearance. Serve at room temperature with vanilla ice cream or lightly sweetened whipped cream. This cake suits birthdays, potlucks, or a simple Sunday dessert.

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).