Start by preheating your oven to 350°F (175°C) so it’s nice and ready when your batter’s done. Line a 12-cup muffin pan with paper liners.
In a large bowl, whisk together the flour, both sugars, cocoa powder, baking powder, baking soda, and salt. Make sure the cocoa is lump-free for a smooth mix.
In a separate bowl, mix the egg, milk, oil, and vanilla until it all comes together.
Pour the wet stuff into the dry and stir until it’s nice and smooth. The batter will be thick and look a little stubborn at first, but that’s totally normal.
Dissolve the espresso powder in boiling water (optional but a flavor game-changer). Slowly whisk this into your batter until it becomes silky and smooth.
Fill each cupcake liner about two-thirds full, enough to rise without spilling, and bake for 15–18 minutes. Check at 16 minutes with a toothpick; it should come out clean.
Let cupcakes cool for 15 minutes in the pan, then transfer to a wire rack.
For the frosting, beat your softened salted butter until creamy. Add cocoa powder, vanilla, and 2 cups powdered sugar on low to avoid a sugar storm.
Gradually mix in the remaining powdered sugar and milk, one tablespoon at a time, until you get your perfect texture.
Once cupcakes are fully cooled, decorate with your favorite swirl or simple spread. Enjoy!