The role of configurational, vibrational, and electrical terms in the temperature-dependent binding energy of impurity pairs at high temperatures is considered by use of the example of boron and nitrogen in diamond. To calculate the free binding energy, we have developed a formalism for quantification of the free carrier contribution to the free binding energy. For doping concentrations of 10 18 cm −3 , N 2 is favored over isolated substitutional N for temperatures up to ϳ2600 K, and boron favors the isolated substitutional form above ϳ750 K. Comparing with typical experimental conditions for growth or heat treatment, we show that the calculations account for the different behavior observed for B and N. For boron, the electronic contribution is large at low concentrations at the temperature at which B s is able to migrate and cannot be neglected.