If you’ve been wanting to learn how to make chocolate cake from scratch, I am here to tell you that it’s so much easier than you think! Whether this is your first time or you’re a seasoned baker, it takes very little time and effort to make a moist, rich chocolate cake that will wow your friends and family.
You simply whisk all of the ingredients together, and bake! Yes, it’s that easy. Plus, there’s one secret ingredient that will take your chocolate cake to the next level: Coffee. I have tested this recipe using both hot water and hot coffee, and found the brewed coffee amplifies the flavor of the chocolate for the richest cake. I highly recommend it if you are serious about chocolate! More on that below, plus my secret to keeping your chocolate cake moist for days if you plan on making it in advance!
A reader, Madison, says: “There is truly not a better chocolate cake recipe out there. I develop my own recipes for bakes all the time, but I keep coming back to this one. It comes together so quickly, it’s insanely moist, and the flavor is unparalleled. I do the sour cream swap and add espresso powder and I wouldn’t change a thing.” ★★★★★
Key Ingredients And Substitutions

These are the main ingredients you need to make a homemade chocolate cake. You can find the full list of ingredients and measurements in the recipe card below.
All-purpose flour — all-purpose flour gives you a moist crumb while also giving the chocolate cake structure.
Sugar — you need 2 cups of granulated sugar for the cake batter and powdered sugar for the frosting. The powdered sugar dissolves easily into the butter and not only sweetens it, but it also helps to thicken the frosting for a perfectly fluffy chocolate buttercream.
Cocoa powder — as there is plenty of sugar in this cake recipe, be sure to use unsweetened cocoa powder. You need cocoa powder for the cake batter and the creamy buttercream frosting. You can use either a natural cocoa powder or a Dutch process cocoa powder for a dark chocolate flavor.
Leavening agents — you need baking soda and baking powder to help the cake rise well. Check the expiration date on these items before using them. They become less effective as time goes on.
Milk — I recommend using whole milk for a rich, moist chocolate cake and extra creamy buttercream.
Eggs — bring the eggs to room temperature before using them. Simply set them out 30 minutes to an hour before you intend to start baking.
Vegetable oil — A vegetable oil, like canola oil, adds moisture to the cake.
Boiling water — the water must be hot! Hot water helps to bring out more of that incredible chocolate flavor, as well as adding to the moisture of the cake. Or, use hot brewed coffee instead (more on that below).
Why Do You Add Hot Liquid To The Batter?
This is a very common reader question that I receive! The hot liquid does two important things: it quickly hydrates the flour for a super moist cake, and it blooms the cocoa powder, enhancing its flavor for a richer chocolate taste.
Amplify the chocolate flavor with hot coffee. To take the chocolatey-ness to the next level, use hot brewed coffee instead of boiling water. Or add 1 tablespoon of espresso powder to the boiling water and dissolve it before mixing it into the batter. The cake will not taste like coffee, I promise! Coffee simply amplifies the flavor of the chocolate for a richer, more decadent cake. (I use this same trick for my Devil’s food cake and German chocolate cupcakes recipe, too.)

My Secret For A Super Moist Chocolate Cake
For a chocolate cake that will stay moist for several days after baking, substitute ½ cup (120ml) of the whole milk for ½ cup (120g) of full-fat sour cream. This dairy swap helps the cake layers hold onto moisture for longer, thanks to the added fat in the sour cream. As an added bonus, the acid in the sour cream will also tenderize the cake, resulting in a softer crumb texture.
Cake layers made with sour cream will stay moist for up to 5 days when stored properly. This is a helpful swap if you plan to make your cake a day or two in advance of serving it or if you know you’ll have leftovers for a few days after baking. (Note that the batter will be a bit thicker than if you only used milk.)
Can I Use Other Pan Sizes?
Absolutely! My recipe makes 2 9-inch round cake layers. You can divide the batter among other cake pan sizes with adjusted bake times. Here’s how:
- Two, 8-inch round cake pans: increase the bake time by about 5 minutes.
- Three 8-inch or 9-inch round cake pans: decrease the bake time by about 10 minutes (these layers will be thin).
- One, 9×13-inch sheet cake: increase the bake time by 10 to 15 minutes.
- Cupcakes: add batter to each cupcake liner until they are about two-thirds full, and bake for about 20 minutes. You can also reference my chocolate cupcakes recipe for more details!

Pro Tips For Making The Best Chocolate Cake
Ingredient temperature matters. For the cake batter, using room temperature eggs ensures they whisk together and fully incorporate with the other wet ingredients, so you don’t end up with globs of raw egg in the batter. Hot water or coffee, as mentioned above, blooms the cocoa. For the frosting, softened butter beats smoothly but also holds air better, for a feather-light buttercream frosting.
Measure the flour correctly. One of the top complaints when it comes to baking cakes is that the cake turns out “floury” or dry, and this is due to using too much flour. The best way to get the right amount of flour is to measure it using a kitchen scale. Alternatively, you can spoon flour into a cup and then scrape a knife across to level it out. Scooping directly from the flour bag or container will inevitably lead to using too much of it.
Get perfectly flat layers every time. Cake strips are a must for flat, evenly baked, professional-looking cakes. Chocolate cake batter is runny and is prone to forming a crisp, raised edge during baking. You can avoid this by using the soaked fabric cake strips to insulate the sides of the cake pans. If you don’t have any on hand, they’re really easy to make with some aluminum foil and paper towels. Check out my post on how to bake flat cake layers for more details!
How To Make Chocolate Cake
Below, I’ve highlighted portions of the recipe in step-by-step process images along with instructions for making this easy chocolate cake recipe. You can find the full set of instructions in the recipe card below.

1. Sift the dry ingredients (flour, granulated sugar, cocoa, baking soda, baking powder, and salt) into a large bowl. Whisk to combine.
2. In a smaller bowl, whisk together the wet ingredients (milk, egg, oil, and vanilla). Add the wet ingredients to the bowl with the dry ingredients and whisk it all until well incorporated.

3. Pour in the boiling water and whisk again. You will end up with a runny cake batter. (It will be runnier than you expect, but don’t be tempted to add more flour.)
4. Grease 2 round 9-inch cake pans and line the bottom of each with parchment paper to make removing the chocolate cake easier. If you have them, use cake strips to help the cakes bake more evenly. Once the cake pans are prepared, divide the cake batter evenly between them. Bake the cakes for 35 minutes at 350°F or until a toothpick inserted in the center of the cake comes out clean. Keep the cakes in the baking pans on a wire cooling rack for 15 minutes. Then carefully invert them onto the wire racks. Let them cool completely.

5. While the cakes are cooling, you can prepare the decadent chocolate buttercream frosting. You’ll need a stand mixer fitted with the paddle attachment for this part. In the bowl of the stand mixer, beat the butter on medium speed for about 2 minutes. Add the cocoa powder and salt and mix on low to incorporate them. Scrape the bowl.
6. Keep the speed on low and add a little powdered sugar at a time, alternating with small amounts of milk (up to 4 tablespoons total of whole milk). Once you’ve added all the sugar, add the vanilla extract and beat on medium-low speed for approximately 1 minute, until you have a fluffy buttercream.

7. Once the cakes have cooled completely, it’s time to assemble your chocolate cake! Place one layer on a cake stand and top it with 1 cup of frosting. Spread the frosting right to the edges before carefully placing the other cake layer on top.
8. Spread the rest of the frosting on top and around the sides of the cake. If you’re feeling fancy, you can save some of the buttercream frosting to pipe decorations. If decorating a cake is overwhelming for you, get some ideas from my tutorial about how to decorate a cake! Or just serve a simple frosted chocolate cake: It will get devoured regardless!

Chocolate Cake Recipe
Video
Equipment
- 9" round baking pans
- Mixing Bowls
- Electric mixer
- Wire cooling rack
Ingredients
For the Cake:
- 2 cups all-purpose flour (240g)
- 2 cups granulated sugar (400g)
- ½ cup unsweetened cocoa powder (50g)
- 1½ teaspoons baking powder
- 1½ teaspoons baking soda
- ½ teaspoon kosher salt
- 1 cup whole milk (240mL)
- 2 large eggs
- ½ cup vegetable oil (120mL)
- 1 tablespoon vanilla extract
- 1 cup boiling water or hot coffee (240ml)
For the Chocolate Buttercream:
- 1½ cups unsalted butter room temperature (338g)
- ¼ cup unsweetened cocoa powder (25g)
- ¼ teaspoon salt
- 1 teaspoon vanilla
- 6 cups powdered sugar (680g)
- 3 to 4 tablespoons whole milk (45-60mL)
Instructions
For the Cake:
- Preheat the oven to 350°F. Grease 2 (9-inch) round cake pans with butter or baking spray and line the bottom of each pan with parchment paper. (I highly recommend using cake strips for a more even bake.)
- Sift the flour, sugar, cocoa, baking soda, baking powder, and salt into a large mixing bowl and whisk to combine.
- In a medium mixing bowl, whisk together the milk, egg, oil, and vanilla. Add to the flour mixture and whisk together until well combined. Pour in the boiling water or coffee and whisk until well combined. (The batter will be runny.)
- Divide the batter between the prepared cake pans.
- Bake for 35 minutes or until a toothpick inserted in the center comes out clean. Let the cakes cool in the pans on a wire cooling rack for 15 minutes. Carefully invert the cake layers onto the wire rack, remove the parchment paper, and let cool completely.
For the Chocolate Buttercream:
- In the bowl of a stand mixer fitted with the paddle attachment, beat the butter on medium speed until soft and creamy, about 2 minutes. Add the cocoa powder and salt and mix on low speed until combined. Scrape the bowl down.
- While mixing on low speed, gradually add in the powdered sugar alternating with a little bit of milk on occasion up to 4 tablespoons. Once the sugar is added, beat in the vanilla. Scrape down the bowl and beat on medium-low speed until light and fluffy, about 1 minute.
For the Assembly:
- Place a cooled cake layer on a cake stand. Top with 1 cup of frosting and spread it out the edges in an even layer. Place the remaining cake layer on top and spread the rest of the frosting all over the outside of the cake. You can reserve some of the frosting to pipe decorations if desired.
Notes
- Make sure the cake layers are cooled before frosting. A warm cake will melt the butter-based frosting, causing the frosting to slide off the cake or the layers to slide around when frosting the outside of the cake.
- Once the cake is frosted, you can chill it for 30 minutes to quickly set the frosting if you plan on slicing and serving it soon. Otherwise, the cake can be held at room temperature until you are ready to serve.
Nutrition
How To Make Ahead And Freeze
This is an ideal make-ahead recipe! Since cooling the chocolate cake layers can take a while, I often bake the cakes a night in advance, and then frost them the next day. Leave the layers at room temperature and be sure to loosely tent the cake layers with foil overnight so they don’t dry out. (and as mentioned above, you can add sour cream for extra moistness!)
To freeze the cake layers: Once the cakes are cooled, wrap each layer separately in plastic wrap. Then place them into freezer-safe bags and store them in the freezer for up to 3 months. Thaw on the counter overnight before unwrapping.
To freeze the frosting: Spoon the buttercream frosting into a freezer bag or freezer-safe container and freeze for up to 3 months. Thaw the frosting overnight in the refrigerator, then bring it to room temperature before beating it at medium speed until it is light and fluffy again. Frost the cake as desired!

Frequently Asked Questions
Improperly measuring your dry ingredients can lead to a dry, crumbly chocolate cake. Too much flour or cocoa powder, which are very absorbent and need moisture to make a proper cake batter, can dry out the batter if you add more than the recipe calls for. The proper amount of these dry goods in this chocolate cake recipe allows the oil, milk, and hot water (or hot coffee) to produce a moist, velvety crumb.
You can store homemade chocolate cake at room temperature or in the refrigerator. If you plan on eating it within 2 or 3 days, simply keep it on your kitchen counter under a cake dome. To store it for a little longer, refrigerate it instead.
Chocolate buttercream frosting is an easy, classic choice for a chocolate cake, but you have a bunch of different options! If you’re looking for something a little different, try chocolate ganache, vanilla buttercream, cream cheese frosting or chocolate cream cheese frosting, strawberry buttercream, or even mocha frosting!
More Chocolate Cake Recipes To Try
Here are some other chocolate cake recipes you’ll love!
My decadent flourless chocolate cake is super fudgy and simply stirs together with melted chocolate, cocoa powder, and a few simple ingredients.
German chocolate cake is a towering, three-layered, rich and tender chocolate cake with gooey coconut and pecan frosting between each layer. It’s a show-stopper that’s easy to put together!
Individual chocolate lava cakes are an impressive dessert that are ready in less than 30 minutes! Plus, the batter simply stirs together with only a handful of staple baking ingredients.
My easy chocolate bundt cake is soft and fudgy. It’s topped with a glossy ganache and is perfect for chocolate lovers!
If you’ve tried this chocolate cake recipe, then don’t forget to rate it and let me know how you got on in the comments below. I love hearing from you!









Arianna says
Came out delicious!! But when i added the wet to the dry, I had a whole lot of lumps of dry ingredients. Is that due to me not mixing it enough? I was worried about over mixing the batter
Kristi says
Hi! My buttercream turned to be grainy. I don’t have a kitchenaid with the paddle attachment, just an electric hand mixer with two beaters. Could this be the reason? Should I beat the butter longer?
Sania says
The chocolate cake recipe is amazing. So moist and fluffy I and my daughter finished a 6 inch cake as soon as it was out of the oven! The only difference was that the batter was good enough for 4, 6 inch cakes and 12 cupcakes!!! My buttercream was grainy as I don’t have a kitchen aid and I was using electric hand mixer is that the reason?
I made this cake for my first ever cake delivery to a friend ofcourse and they loved it!! This will be my go to recipe for chocolate cakes now thank you so much John for sharing the recipe 🙂
Rheanna Cline says
I need more stars to rate this cake. I had no idea I could achieve high-end bakery goodness in my own kitchen. This cake is everything you’ve mentioned about it, but seeing, err umm, tasting, is believing! So delicious. Thank you, John!
Lindsay Smith says
Amazing I LOVE this recipe So Moist. Always getting compliments on this when I make it!
Laila says
Last week was my first time baking a chocolate cake and my first time using cake strips. I baked this cake for my cousins 4th birthday and not only was it super moist, but I also got flat layers thanks to the cake strips. This recipe will definitely be my go-to chocolate cake from now on! Thanks John!
Hana Hanson says
I made this cake yesterday for my brothers birthday. It was absolutely fabulous! I only have 9” pans, so I made two, the batter was a perfect fit.
The cake was dense but oh so moist!! It is not sweet either, for having that much sugar you think it would be. But it’s not! I used coffee, I know the importance of the coffee for bringing out the flavor of the chocolate.
I shared a couple of slices with the wait staff at the restaurant we had the party, they loved it!
This is my first Preppy Kitchen recipe, definitely not my last!
Thank you!! ?
Christie C says
This is the BEST chocolate cake recipe ever! I have made it several times. I skip the espresso in the frosting, but for anyone worried about the coffee in the cake – you absolutely do not taste it at all. It truly just brings out the chocolate flavor. A few hints and tips from what I’ve learned making this cake in the land of heat and humidity (TX):
– After you make the frosting, put it in the fridge to chill for an hour or two before spreading. It firms up and was a necessary step when baking this in the summer.
– LISTEN TO JOHN ABOUT THE CAKE STRIPS. The first two times I made it, I didn’t use them. Third time, I did the homemade ones and it made such a difference in the levelness of the cakes. I’ve asked for some of the real ones for Christmas – won’t make a layered cake without those again.
– I could not find the nibs, so I used the Nestle chocolate curls. I really like them more than using mini-chocolate chips (another trial and error) – the softness of the curls is better – they have a little firmness to them but not hard like the chips (or I imagine the nibs to be).
This is now something I am requested to bake – it’s that good!
Khalid says
Deliciouce!
Can i double o triple the quantity of the ingredients? I want to make a large size cake.
Dustin says
I’m learning how to bake and this is the first cake recipe I’ve ever done. It is hands down the best chocolate cake I’ve ever had! Thanks for sharing!
Alicia D Muse says
I love this chocolate cake recipe! I made it to test it out and the family demolished it. Question: if i am wanting to make a vanilla-chocolate marble cake, would it be appropriate to use this recipe and your Vanilla Cake recipe? There is a cooking temperature variance of 10 degrees F between the two recipes, which is what gives me pause. If not, I would definitely appreciate any recommendations you may have. Thanks!!
Vicky says
I never write reviews , I feel that this ones I have to. I was asked to make a chocolate cake for my grand daughter’s 4th birthday party. This recipe appeared to be the best of all I could find and the cake came out amazingly good. The only thing that didn’t work for me were the baking strips, the layers didn’t bake flat. Received many texts with compliments .
My next attempt will be a Lemon cake.
Thank you.