Chocolate Zucchini Cake Recipe

Chocolate Zucchini Cake slices on plates

The Spruce Eats / Diana Chistruga

Prep: 15 mins
Cook: 38 mins
Cooling Time: 45 mins
Total: 98 mins
Servings: 15 to 20 servings
Yield: 1 9x13 cake
Nutrition Facts (per serving)
347 Calories
17g Fat
47g Carbs
4g Protein
Show Full Nutrition Label Hide Full Nutrition Label
Nutrition Facts
Servings: 15 to 20
Amount per serving
Calories 347
% Daily Value*
Total Fat 17g 21%
Saturated Fat 7g 34%
Cholesterol 39mg 13%
Sodium 179mg 8%
Total Carbohydrate 47g 17%
Dietary Fiber 2g 7%
Total Sugars 33g
Protein 4g
Vitamin C 4mg 21%
Calcium 35mg 3%
Iron 2mg 13%
Potassium 157mg 3%
*The % Daily Value (DV) tells you how much a nutrient in a food serving contributes to a daily diet. 2,000 calories a day is used for general nutrition advice.
(Nutrition information is calculated using an ingredient database and should be considered an estimate.)

You might wonder why anyone would add zucchini to a cake, but just one taste will give you the answer. Zucchini provides the cake with exceptional moistness without adding any odd or off-putting flavor, odor, or texture. The combination of chocolate and zucchini makes a surprisingly decadent cake! The only way you would know there was zucchini in the cake is if someone told you!

The one-layer chocolate zucchini cake is easy, too, with no layers to fuss with and assemble. You can whip it up and have it in the oven within about 10 to 12 minutes, and the easy chocolate frosting takes only about 3 or 4 minutes to fix. Feel free to frost the cake with another flavor. A simple glaze or a cream cheese frosting would be fabulous on this cake. Or serve individual slices with sweetened whipped cream or thawed frozen whipped topping.

Zucchini shreds easily and quickly with a box grater or food processor shredding disk, and you can do it a day in advance. Just refrigerate the shredded zucchini in an airtight container until you are ready to add it to the cake batter.

“I know you may think of zucchini as a vegetable, but it is totally an unsung hero in desserts. It is deliciously moist and pairs perfectly in the chocolate cake. The frosting is also super easy, which makes this cake an extra sweet treat.” —Tracy Wilk 

chocolate zucchini cake/tester image
A Note From Our Recipe Tester


For the Cake

  • 1/2 cup unsalted butter, room temperature, more for the pan

  • 2 1/2 (298 grams) cups all-purpose flour, more as needed

  • 3/4 cup (65 grams) unsweetened cocoa powder

  • 1 teaspoon baking soda

  • 1/2 teaspoon baking powder

  • 3/4 teaspoon salt

  • 1/2 cup vegetable oil

  • 1 2/3 cups (340 grams) granulated sugar

  • 2 large eggs, room temperature

  • 2 teaspoons pure vanilla extract

  • 1/2 cup buttermilk, well shaken

  • 3 cups shredded raw zucchini, about 2 medium

For Frosting

  • 1/3 cup milk

  • 5 tablespoons unsalted butter

  • 1 cup (198 grams) granulated sugar

  • 1 cup chocolate chips, semisweet or milk chocolate

  • 1 teaspoon pure vanilla extract

Steps to Make It

  1. Gather the cake ingredients.

    Chocolate Zucchini Cake ingredients in bowls

    The Spruce Eats / Diana Chistruga

  2. Position a rack in the center of the oven and heat to 350 F. Grease and flour a 9-by-13-inch baking pan. Set aside.

    Greased and floured baking pan

    The Spruce Eats / Diana Chistruga

  3. Sift together the flour, cocoa, baking soda, baking powder, and salt. Set aside.

    Flour, cocoa, baking soda, baking powder, and salt sifted into a bowl

    The Spruce Eats / Diana Chistruga

  4. In a bowl with an electric mixer on medium speed, beat the oil, 1/2 cup of butter, and the sugar together until creamy, about 2 minutes. 

    Oil, butter and sugar mixture in a bowl, with a hand mixer

    The Spruce Eats / Diana Chistruga

  5. Add the eggs, one at a time, beating well after each addition. Add the vanilla and beat until blended.

    Egg and vanilla added to the butter mixture in the bowl, with a hand mixer

    The Spruce Eats / Diana Chistruga

  6. Add about one-third of the dry ingredients to the wet ingredients and beat on medium-low speed until just combined. Beat in half of the buttermilk until combined. Repeat with another one-third of the dry ingredients and the remaining buttermilk. Add the remaining dry mixture and beat until just combined.

    Cake batter in a bowl with a hand mixer

    The Spruce Eats / Diana Chistruga

  7. Using a spatula, fold the shredded zucchini into the batter.

    Zucchini and cake batter in a bowl, with a spatula

    The Spruce Eats / Diana Chistruga

  8. Spread the batter in the prepared baking pan and bake until a toothpick inserted into the center comes out clean, 32 to 38 minutes.

    Cake batter in a prepared baking pan

    The Spruce Eats / Diana Chistruga

  9. Remove the cake to a rack and cool it completely before preparing the frosting.

    Chocolate cake in a baking pan on a cooling rack

    The Spruce Eats / Diana Chistruga

Make the Frosting

  1. Gather the frosting ingredients.

    Frosting ingredients in bowls

    The Spruce Eats / Diana Chistruga

  2. In a small saucepan over medium-high heat, combine the milk, butter, and sugar. Bring the mixture to a boil. Continue boiling for 1 full minute.

    Milk, butter and sugar mixture in a saucepan on a burner

    The Spruce Eats / Diana Chistruga

  3. Remove the saucepan from the heat and add the chocolate chips and vanilla. Stir until the chocolate has melted.

    Frosting in a saucepan with a spatula

    The Spruce Eats / Diana Chistruga

  4. Immediately pour the frosting over the cooled cake. It will harden to a soft, fudgy consistency within 4 to 5 minutes.

    Chocolate Zucchini Cake with frosting in a baking pan

    The Spruce Eats / Diana Chistruga


    • Choose small to medium zucchini for chocolate zucchini cake. The smaller, younger zucchini are sweeter and moister than the larger, older zucchini.
    • You don't have to peel the zucchini, but make sure to wash it and cut off the stem and blossom ends before shredding.
    • If your zucchini is somewhat large and has large seeds, scoop them out with a spoon before shredding.

    Recipe Variations

    • Instead of frosting the cake, serve individual portions with a dollop of sweetened whipped cream.
    • Replace the cooked frosting with this easy sour cream frosting.
    • Just before baking the cake, top it with 1 cup of chocolate chips and 1 cup of chopped walnuts or pecans. Omit the frosting and serve with ice cream or whipped topping.

    How to Store and Freeze Zucchini Cake

    • Store the zucchini cake, covered, at room temperature for 3 to 4 days or refrigerate it for up to 1 week.
    • You may freeze the cake, frosted or unfrosted, for up to 2 months. Freeze portions or sections on a baking sheet until frozen solid. Wrap the frozen slices in plastic wrap and foil, label with the name and date, and place in resealable freezer bags. Defrost at room temperature.

    Why is my zucchini cake dry?

    Zucchini cake can turn out dry if you squeeze out excess moisture when the recipe does not instruct it. Also, large zucchini tend to be drier than smaller, younger zucchini. Choose small to medium zucchini, about 8 to 10 inches in length.

    Do I have to peel zucchini for cake?

    There's no need to peel the zucchini. The peel is soft and doesn't affect the flavor or texture, but feel free to peel if you like.