Preheat your oven to 350°F and line a muffin pan with cupcake liners.
In a large bowl, whisk together the flour, sugar, cocoa powder, baking soda, and salt until combined. Just make sure there aren’t any big cocoa clumps.
Add the buttermilk, oil, egg, and vanilla to the dry ingredients. Stir until just combined and smooth. The batter will be a little loose, that’s exactly what you want.
Divide the batter evenly between the cupcake liners, filling each about 2/3 full.
Bake for 18–22 minutes, or until the tops spring back lightly when touched and a toothpick inserted in the center comes out mostly clean.
Let the cupcakes cool in the pan for a few minutes, then transfer to a wire rack to cool completely before frosting.