Chocolate Zucchini Cupcakes with Fudgy Cocoa Frosting

I’ve baked a lot of chocolate treats, and these chocolate zucchini cupcakes are now a go-to whenever the garden produces more zucchini than we can eat. After testing many batches to perfect the moisture-to-chocolate balance, I developed a version that’s rich, tender, and kid-approved—especially when finished with a swirl of silky chocolate cream cheese frosting.

a partially unwrapped chocolate zucchini cupcake topped with chocolate cream cheese frosting.

Zucchini Chocolate Cupcakes with Chocolate Cream Cheese Frosting

This cupcake recipe is loosely inspired by a chocolate zucchini bundt cake my mom used to make. The bundt cake is delicious but time-consuming, so I created a quicker cupcake version that still delivers deep chocolate flavor and exceptional moistness. These cupcakes come together quickly—about 35 minutes total—and the zucchini keeps the crumb soft for days without imparting a noticeable vegetable taste.

an unwrapped and bitten frosted chocolate zucchini cupcake with shredded zucchini on top.

Managing Moisture

Zucchini contains a lot of water, which helps baked goods stay tender. Too much liquid, however, can produce soggy cupcakes. I experimented with different approaches—from squeezing the zucchini almost dry to using it straight from the grater—and found that a light, gentle squeeze to remove excess water gives the best results. This preserves moisture for a soft crumb while keeping the batter the right consistency for proper rise and structure.

featured chocolate zucchini cupcakes
4.67 from 21 votes

Chocolate Zucchini Cupcakes Recipe

Moist chocolate cupcakes made with shredded zucchini for a tender crumb that stays soft for days. Rich chocolate flavor topped with smooth chocolate cream cheese frosting—perfect for sneaking in extra veggies.
Prep Time: 10 mins
Cook Time: 25 mins
Total Time: 35 mins

Equipment

  • Kitchen scale (optional)
  • Cupcake tin
  • Stand mixer (or hand mixer)
Serves 12 people

Ingredients

  • 1½ cups all-purpose flour
  • ¾ cup granulated sugar
  • ¼ cup unsweetened cocoa powder
  • 1 teaspoon baking soda
  • ½ teaspoon kosher salt
  • 2 zucchini, peeled and shredded (about 1 cup)
  • ⅓ cup unsalted butter, melted and cooled
  • ⅔ cup milk, room temperature
  • 1 large egg, room temperature
  • 2 teaspoons pure vanilla extract
  • Chocolate Cream Cheese Frosting (see below for how to make)

Instructions

  • Preheat the oven to 350°F (175°C). Line a 12-count cupcake tin with paper liners and set aside.
  • In a large bowl, whisk together the flour, sugar, cocoa powder, baking soda, and salt. Set aside.
  • In the bowl of a stand mixer fitted with the paddle attachment (or in a mixing bowl with a hand mixer), combine the shredded zucchini, melted butter, milk, egg, and vanilla. Mix on low to medium speed until combined.
  • Add the dry ingredients to the wet ingredients and mix just until a creamy batter forms. Avoid overmixing.
  • Scoop the batter into lined cupcake wells, filling about ⅔ full. Bake 20–25 minutes, or until a toothpick inserted in the center comes out clean. Remove from the oven and cool on a rack.
  • Once cooled, frost with chocolate cream cheese frosting and serve.

Notes

I recommend using natural unsweetened cocoa powder (not Dutch-processed) for better rise and flavor.

If your garden zucchinis are very large, remove the tough seeds before shredding to avoid bitter or crunchy bits.

Tips:

  • Measure flour using the spoon-and-level method to avoid packing too much flour into the cup.
  • For a finer texture, pulse the shredded zucchini with the milk and egg in a food processor for a few seconds.
  • If the shredded zucchini is visibly dripping, give it a very light squeeze; you want the moisture, but not excess liquid.
  • Mix until the dry ingredients are just incorporated—overmixing makes cupcakes tough.
  • Don’t open the oven before 20 minutes to avoid collapse.
  • Chill cupcakes briefly before frosting for cleaner piping if desired.

Make-Ahead: Bake up to 48 hours ahead and store unfrosted at room temperature until ready to frost.

Storage: Unfrosted cupcakes: airtight container at room temperature for up to 3 days, refrigerated up to 1 week, or frozen up to 6 months. Frosted cupcakes: store refrigerated for up to 3 days.

Nutrition Facts
Chocolate Zucchini Cupcakes Recipe
Amount Per Serving (1 cupcake)
Calories 176
Fat 6g
Carbohydrates 27g
Protein 3g
*Percent Daily Values are based on a 2000 calorie diet.
Author: Becky Hardin
Course: Dessert
Cuisine: American
Did you make this?
We love seeing your creations! Tag us on social media for a chance to be featured.

My Secret for Invisible Veggie Cupcakes

If you’re concerned picky eaters will detect green flecks, zucchini is an ideal stealth ingredient because its mild flavor disappears under cocoa and vanilla. For truly invisible zucchini, peel before shredding to remove the green skin, or pulse shredded zucchini with the milk and egg in a blender for a few seconds—this creates a smooth mixture that blends into the batter. I often leave the skin on for extra fiber, but peeling is useful when serving very picky kids.

How to Make Chocolate Zucchini Cupcakes Step-by-Step

Whisk the dry ingredients: Preheat oven to 350°F and line a 12-count cupcake tin. In a large bowl combine 1½ cups all-purpose flour, ¾ cup granulated sugar, ¼ cup unsweetened cocoa powder, 1 teaspoon baking soda, and ½ teaspoon kosher salt. Stir to combine and set aside.

dry ingredients for chocolate cupcakes in a glass bowl with a whisk.

Beat the wet ingredients: In a mixer bowl combine about 1 cup shredded zucchini (from 2 medium zucchini), ⅓ cup melted and cooled unsalted butter, ⅔ cup milk at room temperature, 1 large room-temperature egg, and 2 teaspoons vanilla. Mix on low-to-medium until combined. For a finer texture, pulse the zucchini with the milk and egg in a blender for a few seconds before mixing.

wet ingredients for zucchini cupcakes in a glass bowl.

Combine the batter: Add the dry ingredients to the wet and mix just until a creamy batter forms. Avoid overmixing to keep cupcakes tender.

chocolate zucchini cupcake batter in a glass bowl.

Bake: Fill liners about ⅔ full and bake 20–25 minutes, or until a toothpick comes out clean. Cool on a rack before frosting. To speed cooling, place cupcakes briefly in the refrigerator or freezer.

baked chocolate zucchini cupcakes in a cupcake tin.

Make the frosting: While cupcakes cool, beat 4 ounces (½ brick) slightly cool cream cheese with ½ cup room-temperature unsalted butter until creamy. On low speed, add 3 cups powdered sugar, ⅔ cup unsweetened cocoa powder, and 3 tablespoons milk. Increase speed and beat until frosting is smooth and spreadable.

chocolate cream cheese frosting in a bowl.

Frost the cupcakes: Pipe or spread the frosting on cooled cupcakes. A large star tip (Wilton 1M) makes pretty swirls, but a simple spread works wonderfully too.

overhead platter with chocolate zucchini cupcakes

How to Store and Freeze

Store leftover cupcakes in an airtight container at room temperature up to 3 days, refrigerate up to 1 week, or freeze up to 6 months. Keep frosted cupcakes refrigerated and consume within 3 days for best quality.