Prep the pan and oven. Heat the oven to 350°F (175°C).Line an 8-inch (20 cm) square pan with parchment, leaving overhang for easy lifting. Lightly grease the parchment.
Melt the butter. In a medium saucepan or microwave-safe bowl, melt the butter until fully liquid but not bubbling. Let it sit 1–2 minutes to cool slightly.
Whisk in the sugar. Add the sugar to the warm butter and whisk for 30–60 seconds.This helps dissolve the sugar and encourages a shiny top.
Add eggs and vanilla. Whisk in the eggs one at a time, then the vanilla. Beat the mixture for another 30 seconds until glossy and slightly thick.
Mix the dry ingredients. In a separate bowl, whisk cocoa, flour, salt, and baking powder (if using) to break up lumps.
Combine wet and dry. Add the dry mix to the wet batter. Stir with a spatula just until no dry streaks remain.The batter will be thick.
Fold in extras. Gently fold in chocolate chips and nuts, if using. Don’t overmix.
Spread and smooth. Scrape the batter into the prepared pan and smooth the top. If you like, sprinkle a pinch of flaky salt.
Bake. Bake for 20–25 minutes, or until the edges are set and a toothpick inserted 2 inches from the edge comes out with a few moist crumbs.The center should look slightly underdone; it will set as it cools.
Cool and slice. Cool in the pan on a rack for at least 20–30 minutes. Lift out using the parchment and slice with a warm, clean knife for neat edges.