Nitrogen-coordinated metal sites (MN x ) in metal- and nitrogen-codoped carbon (M-N-C) catalysts offer promising electrocatalytic activity, but selective synthetic design of MN x sites with specific coordination environments remains challenging. Here, we manipulate the formation statistics of MN x sites by using sacrifice alkali metals (AM = Li, Na, and K) to form metal vacancy-N x carbon (AM-MVN x -C) templates, which are used to direct the solution-phase formation of CoN 4 sites in Co-N-C catalysts. We build a probability weight function based on the embedding energy of M in MN x sites as the descriptor for MN x formation statistics, and we predict that the alkali metals are prone to induce the formation of MVN 4 sites. By coordinating Co 2+ ions with AM-MVN x -C templates, we synthesize Co-N-C with CoN 4 sites, demonstrating remarkable oxygen reduction activity in anion exchange membrane fuel cells. These results highlight the statistical thermodynamics of MN x formation and open up the possibility for the rational design of complex M-N-C electrocatalysts with well-defined MN x sites.