Prep the pan: Heat oven to 350°F (175°C). Line an 8-inch square pan with parchment, leaving a 1-inch overhang on two sides for easy lifting. Lightly grease the parchment.
Melt butter and chocolate: In a medium heatproof bowl, combine butter and chopped chocolate.
Microwave in 20–30 second bursts, stirring between each, until smooth. You can also melt over a double boiler. Let it cool for 2–3 minutes.
Whisk in sugars: Add granulated and brown sugar to the warm chocolate mixture and whisk until glossy and thick.
This helps dissolve the sugar for that shiny top.
Add eggs and vanilla: Whisk in eggs one at a time, beating well after each until the batter looks satiny. Whisk in vanilla and espresso powder, if using. The batter should look cohesive and slightly thick.
Fold in dry ingredients: In a small bowl, whisk cocoa, gluten-free flour (and xanthan if needed), and salt.
Sift if lumpy. Use a spatula to fold the dry mixture into the wet just until no dry streaks remain. Do not overmix.
Add mix-ins (optional): Fold in chocolate chips or chunks.
Keep some for the top if you like.
Pan and smooth: Scrape batter into the prepared pan and spread evenly. If using extra chips, scatter them on top.
Bake: Bake 22–28 minutes, depending on your oven and desired doneness. For fudgy brownies, remove when the center is just set and a toothpick comes out with moist crumbs but not wet batter. The edges will look slightly pulled away.
Cool completely: Place the pan on a rack and let brownies cool fully, at least 1–2 hours.
For clean slices, chill 30 minutes before cutting. Lift out using the parchment and slice with a warm, sharp knife, wiping between cuts.