Preheat the oven to 350 degrees and line a muffin pan with paper liners.
Combine flour, cocoa powder, baking soda, and baking powder in a bowl and carefully whisk them together.
In another bowl, add butter and sugar and mix with a hand mixer on medium speed until completely blended. The mixture will look crumbly.
Add the vanilla and the egg. Mix well.
Add half of the flour mixture and half of the buttermilk. Mix until just combined. Repeat with the second half of the flour and buttermilk.
Spoon batter into the prepared muffin pan and bake for 15-17 minutes, or until a toothpick inserted into the center of the cupcakes comes out clean.
Let the cupcakes cool completely before frosting.