Prep the pan and oven: Heat the oven to 350°F (175°C).
Grease a 9x13-inch pan or two 8-inch round pans. Line with parchment for easy release.
Grate the zucchini: Use the small holes of a box grater for fine shreds. You’ll need about 2 packed cups. Do not squeeze the liquid out unless your zucchini is extremely watery; the moisture keeps the cake tender.
Mix dry ingredients: In a large bowl, whisk 2 cups flour, 3/4 cup cocoa powder, 1 teaspoon baking soda, 1/2 teaspoon baking powder, 1 teaspoon kosher salt, and 1 teaspoon cinnamon.
If using espresso powder, whisk in 1 teaspoon.
Mix wet ingredients: In another bowl, whisk 2 large eggs, 3/4 cup granulated sugar, 3/4 cup light brown sugar, 1 cup oil, 1 cup milk (or buttermilk), and 2 teaspoons vanilla until smooth.
Combine: Pour the wet mixture into the dry. Stir gently until you see just a few streaks of flour. Fold in the grated zucchini and 1 cup chocolate chips.
The batter will be thick—this is right.
Fill the pan: Spread the batter evenly. If using round pans, divide it evenly and smooth the tops.
Bake: For a 9x13-inch pan, bake 30–35 minutes. For two 8-inch rounds, bake 25–30 minutes.
The cake is done when a toothpick comes out with a few moist crumbs but no wet batter.
Cool: Let the cake cool in the pan for 15 minutes, then turn out onto a rack if you used parchment. Cool completely before frosting or dusting with powdered sugar.
Finish: Top with a light layer of chocolate frosting, a dusting of powdered sugar, or leave it plain. It’s great warm with a scoop of vanilla ice cream.