Moist and Fluffy Yellow Cake with Chocolate Frosting
This yellow cake with chocolate frosting is the kind of homemade dessert that makes any day feel a little more special. It is a simple butter cake with a soft crumb and a thick layer of glossy chocolate frosting on top.

No mixers are hiding in the background, no shortcuts, just a reliable recipe that turns out the first time. You probably have everything you need in the kitchen right now.
What Makes This Yellow Cake So Good
The cake stays moist for days thanks to the butter and whole milk, and the crumb is fine but still sturdy enough to hold a generous swipe of frosting. It does not dry out overnight the way some butter cakes do.
The chocolate frosting is the real star: it is deeply chocolaty, smooth, and sets up just enough to slice cleanly. You get a little snap from the frosting and then that tender, vanilla-scented cake underneath.
Ingredients

- 2 1/2 cups all-purpose flour: spooned and leveled for accuracy
- 2 tsp baking powder: gives the cake its lift
- 1/2 tsp salt: balances the sweetness
- 3/4 cup unsalted butter, softened: leave it out for about an hour before you start
- 1 1/2 cups granulated sugar: keeps the crumb tender
- 4 large eggs: at room temperature if you have the time
- 2 tsp vanilla extract: use the real stuff if you can
- 1 cup whole milk: 2% works in a pinch, but whole milk adds richness
For the Frosting
- 1/2 cup unsalted butter, softened
- 3 cups powdered sugar
- 1/2 cup unsweetened cocoa powder: natural or Dutch-process both work
- 1/4 cup whole milk, plus more if needed
- 1 tsp vanilla extract
- Pinch of salt
Variations / Substitutions
- Buttermilk instead of regular milk: Replace the 1 cup milk with an equal amount of buttermilk, reduce the baking powder to 1 1/2 teaspoons, and add 1/2 teaspoon baking soda. The cake will have a slight tang and an even softer crumb.
- Add espresso powder to the frosting: Whisk 1/2 teaspoon instant espresso powder into the cocoa. It does not make the frosting taste like coffee, it just deepens the chocolate flavor.
- Cream cheese frosting: Swap the chocolate frosting for a tangy cream cheese version if you want something less sweet.
- Dairy-free version: Use a stick-style plant-based butter and oat milk. The cake will be a little less rich, but still tender.
If you love a classic layer cake, try my vanilla birthday cake next time.
How to Make Yellow Cake With Chocolate Frosting
Step 1: Cream the Butter and Sugar

Preheat the oven to 350°F (175°C) and grease a 9×13-inch baking pan with butter or cooking spray. In a large bowl, beat the 3/4 cup softened butter and 1 1/2 cups sugar together with a hand mixer on medium speed until the mixture looks pale and fluffy, about 3 minutes.
You will see the color change from yellow to almost white and the volume will increase noticeably. Stop and scrape down the sides of the bowl once to catch any butter clinging to the edge.
Step 2: Add the Eggs and Vanilla

Crack the 4 eggs into the bowl one at a time, mixing well after each addition. Then pour in the 2 teaspoons vanilla extract and beat just until the mixture looks smooth and a little thicker.
If the batter seems curdled or separated at first, do not worry. Keep the mixer going for another 30 seconds and it will come together into a glossy, creamy base.
Step 3: Alternate the Dry and Wet Ingredients

In a separate medium bowl, whisk together the 2 1/2 cups flour, 2 teaspoons baking powder, and 1/2 teaspoon salt. Add half of that flour mixture to the butter mixture and mix on low just until the white streaks disappear. Pour in the 1 cup milk, mix until smooth, then add the rest of the flour mixture. Mix on low only until no more dry pockets remain.
Try to stop mixing the moment the flour gets absorbed. Overworking the batter now can make the cake dense instead of fluffy, so a few seconds of low mixing is plenty.
Step 4: Bake the Cake

Scrape the batter into the prepared pan and spread it evenly with a spatula. Bake on the center rack for 30 to 35 minutes, until a toothpick poked into the very middle comes out with a few moist crumbs clinging to it.
The top will turn a deep golden brown and the cake will start to pull away from the sides of the pan. Let it cool completely in the pan on a wire rack before you frost it, at least 1 hour. Even a little warmth in the cake will melt the frosting, so patience pays off here.
Step 5: Frost and Slice the Cake

Beat the 1/2 cup softened butter, 3 cups powdered sugar, 1/2 cup cocoa powder, 1/4 cup milk, 1 teaspoon vanilla, and a pinch of salt in a large bowl until smooth and spreadable. If the frosting feels too stiff, add another tablespoon of milk. If it feels too thin, add a little more powdered sugar.
Spread the frosting over the completely cooled cake in an even layer, working all the way to the edges. Run a knife under hot water, wipe it dry, and slice the cake into squares right in the pan. Serve the pieces straight from there.
Tips for the Best Yellow Cake
- Bring everything to room temperature.: Cold eggs and cold butter beat differently than warm ones. Take them out of the fridge about an hour before you start and the batter will come together more evenly.
- Measure the flour correctly.: The most common mistake is scooping straight from the bag, which packs in too much flour and dries out the cake. Spoon the flour into the measuring cup and level it off with a knife.
- Add a pinch of salt to the frosting.: Even if you skip it in the cake, a tiny amount of salt cuts the sweetness and makes the chocolate pop more.
- Cool the cake upside down on the rack.: Once the pan is cool enough to handle, you can invert the cake onto a rack and then flip it back. That step is optional, but it helps the cake release cleaner when you go to slice it.
Bake times for other pan sizes:
| Pan Type | Size | Bake Time |
|---|---|---|
| 9-inch round cake pans | 2 pans | 25 to 28 mins |
| 8-inch square pan | 1 pan | 30 to 35 mins |
| Standard muffin tin | 12 cups | 18 to 22 mins |
Use the same toothpick test for all of them.
Storing Leftover Cake
- Refrigerate: Store the frosted cake in an airtight container in the fridge for up to 4 days. Bring slices to room temperature before serving so the frosting softens.
- Freeze: Wrap an unfrosted cake tightly in plastic wrap and freeze for up to 2 months. Thaw it on the counter, then frost as usual. The frosting itself can be made ahead and chilled for up to 5 days; let it come to room temperature and re-whip before spreading.
Frequently Asked Questions
Can I use buttermilk instead of regular milk?
Yes. Replace the 1 cup milk with buttermilk, reduce the baking powder to 1 1/2 teaspoons, and add 1/2 teaspoon baking soda. The crumb will be extra tender with a slight tang.
Why did my cake sink in the middle?
It probably needed a few more minutes in the oven or the oven door got opened too early. Always test the center with a toothpick before pulling the cake out, and avoid peeking during the first 25 minutes.
Can I use a different frosting?
Absolutely. A cream cheese frosting or a simple vanilla buttercream both work well. You can also add 1/2 cup of peanut butter to the chocolate frosting for a different flavor.
How do I make this into a layer cake?
Divide the batter between two greased 9-inch round pans and bake for 25 to 28 minutes. Cool the layers completely, then fill and frost with an extra half batch of frosting to coat the sides.

Yellow Cake With Chocolate Frosting Recipe
Ingredients
Method
- Preheat oven to 350°F (175°C). Grease a 9×13-inch pan. Beat 3/4 cup butter and 1 1/2 cups sugar until pale and fluffy, about 3 minutes.
- Add 4 eggs one at a time, then beat in 2 tsp vanilla until smooth.
- Whisk 2 1/2 cups flour, 2 tsp baking powder, and 1/2 tsp salt. Add half to the butter mixture, mix on low, then add 1 cup milk. Add remaining flour mix and stir just until combined.
- Spread batter into the pan. Bake 30 to 35 minutes, until a toothpick has moist crumbs. Cool completely in the pan on a rack.
- Beat 1/2 cup butter, 3 cups powdered sugar, 1/2 cup cocoa, 1/4 cup milk, 1 tsp vanilla, and a pinch of salt until smooth. Spread over the cooled cake, then slice and serve.
