Chocolate Zucchini Cake Recipe — Moist Homemade Layer Cake
This chocolate zucchini cake is proof that a vegetable can disappear completely into a dessert while making it even better. Two soft, deeply chocolatey layers get their incredible moisture from shredded zucchini, and nobody will ever guess it is in there.
It is finished with a rich chocolate buttercream frosting that is smooth, fluffy, and easy to spread between the layers and around the sides. The espresso powder in the batter is optional, but it deepens the chocolate flavor beautifully without adding any coffee taste.
If you are looking for a way to use up garden zucchini or just want an exceptionally moist chocolate cake, this one checks every box.
Looking for more chocolate cake inspiration? Check out this roundup of the best chocolate cake recipes for even more ideas.

Why You Will Love This Recipe

- Shredded zucchini keeps the crumb incredibly moist without any noticeable vegetable taste
- Two full layers of deep chocolate cake with a rich buttercream frosting
- Chocolate chips folded into the batter for extra pockets of chocolate
- A great way to use up extra zucchini from the garden or market
- Can be made as a layer cake, sheet cake, or cupcakes
- Stores well, making it a good make-ahead dessert
Ingredients

For the Cake
- 2 cups (250 g) all-purpose flour
- ¾ cup (62 g) unsweetened natural cocoa powder
- 2 tsp baking soda
- ½ tsp baking powder
- 1 tsp espresso powder (optional)
- ½ tsp salt
- 1 cup (240 ml) canola or vegetable oil
- 1 cup (200 g) granulated sugar
- ¾ cup (150 g) packed brown sugar
- 4 large eggs, room temperature
- ⅓ cup (80 g) sour cream or plain yoghurt, room temperature
- 2 tsp pure vanilla extract
- 3 cups (360 g) shredded zucchini, lightly blotted
- 1 cup (180 g) semi-sweet chocolate chips
For the Chocolate Buttercream Frosting
- 1¼ cups (282 g) unsalted butter, softened
- 3½ cups (420 g) confectioners’ sugar
- ¾ cup (62 g) unsweetened cocoa powder
- 3–5 tbsp (45–75 ml) heavy cream, room temperature
- ¼ tsp salt
- 1 tsp pure vanilla extract
Ingredient Notes and Substitutions

- Give the shredded zucchini a light blotting with a towel before adding it. Do not squeeze out too much moisture, since that moisture is what keeps the cake so tender.
- Espresso powder is optional but strongly recommended. It deepens the chocolate flavor without adding any coffee taste of its own.
- Sour cream or plain yoghurt both work well and keep the crumb soft.
Step-by-Step Instructions
Preheat and Prepare the Pans
Preheat the oven to 350°F (177°C). Grease two 9-inch round cake pans, line with parchment rounds, then grease the parchment as well.
Mix the Dry Ingredients

Whisk together the flour, cocoa powder, baking soda, baking powder, espresso powder, and salt in a bowl. Set aside.
Mix the Wet Ingredients

In a separate large bowl, beat the oil, granulated sugar, brown sugar, eggs, sour cream, and vanilla extract until combined.
Add the Zucchini

Add the shredded zucchini to the wet ingredients and mix until evenly incorporated.
Combine and Fold in Chocolate Chips

Add the dry ingredients to the wet ingredients and mix on medium speed until just combined. Fold in the chocolate chips.
Bake the Layers

Divide the batter evenly between the prepared pans. Bake for 28–32 minutes, until a toothpick inserted into the center comes out clean.
Cool the Layers

Cool the cakes in their pans for 1 hour, then transfer to a wire rack to cool completely before frosting.
Make the Chocolate Buttercream

Beat the softened butter on its own for about 2 minutes until smooth. Add the confectioners’ sugar, cocoa powder, 3 tablespoons of heavy cream, salt, and vanilla extract.

Finish the Frosting
Beat on low speed for 30 seconds, then increase to high speed until light and fluffy. Add more cream, a tablespoon at a time, if needed to reach a smooth, spreadable consistency.
Assemble the Cake

Level the tops of both cake layers if needed. Place the first layer on a cake stand and spread about 1 cup of frosting evenly over the top. Add the second layer, then frost the top and sides of the cake.
Tips for the Best Results

- Blot the shredded zucchini lightly, but do not wring it out completely, to keep the cake moist.
- Let the cake layers cool completely before frosting, or the buttercream will melt and slide.
- Level the cake layers with a serrated knife for clean, even stacking.
- Bring the buttercream to room temperature before spreading if it has been chilled.
Variations and Add-ins

- Bake in a 9×13-inch pan as a sheet cake, extending the bake time to at least 45 minutes.
- Make it into 24–30 cupcakes, baking for 18–22 minutes.
- Add chopped walnuts or pecans to the batter for extra crunch.
- Swap the buttercream for a simple chocolate ganache if you prefer a glossier finish.
What to Serve With It
- A glass of cold milk
- A scoop of vanilla ice cream
- Fresh berries on the side
- A hot cup of coffee

Chocolate Zucchini Cake
Ingredients
Method
- Preheat the oven to 350°F (177°C). Grease two 9-inch round cake pans, line with parchment rounds, then grease the parchment.
- Whisk together the flour, cocoa powder, baking soda, baking powder, espresso powder, and salt in a bowl. Set aside.
- In a separate large bowl, beat the oil, granulated sugar, brown sugar, eggs, sour cream, and vanilla extract until combined.
- Add the shredded zucchini to the wet ingredients and mix until evenly incorporated.
- Add the dry ingredients to the wet ingredients and mix on medium speed until just combined.
- Fold in the chocolate chips.
- Divide the batter evenly between the prepared pans.
- Bake for 28–32 minutes, until a toothpick inserted into the center comes out clean.
- Cool the cakes in their pans for 1 hour, then transfer to a wire rack to cool completely.
- For the frosting, beat the softened butter on its own for about 2 minutes until smooth.
- Add the confectioners’ sugar, cocoa powder, 3 tablespoons of heavy cream, salt, and vanilla extract.
- Beat on low speed for 30 seconds, then increase to high speed until light and fluffy. Add more cream as needed for a smooth, spreadable consistency.
- Level the tops of both cake layers if needed. Place the first layer on a cake stand and spread about 1 cup of frosting evenly over the top.
- Add the second layer, then frost the top and sides of the cake.
Notes
- Blot the shredded zucchini lightly with a towel; do not squeeze out too much moisture, since it is what keeps the cake so tender.
- Store covered at room temperature up to 2 days, or refrigerated up to 5 days.
- Can be baked as a sheet cake in a 9×13-inch pan (45+ minutes) or as 24–30 cupcakes (18–22 minutes).
- Bring refrigerated cake to room temperature before serving for the best texture.
This chocolate zucchini cake is one of those recipes that surprises everyone who tries it, since the zucchini disappears completely into a rich, tender crumb. Between the deep cocoa flavor and the fluffy chocolate buttercream, it tastes like an indulgent treat rather than a way to sneak in vegetables.
It is a wonderful recipe for using up extra garden zucchini, and it stores well enough to make ahead for a gathering. Once you try how moist this cake turns out, it may just become your go-to chocolate cake recipe year round.
For more chocolate recipes you will love:
