  We present a first-principles computational study of the thermodynamics of
carbon defects in hexagonal boron nitride (hBN). The defects considered are
carbon monomers, dimers, trimers, and larger carbon clusters, as well as
complexes of carbon with vacancies, antisites, and substitutional oxygen. Our
calculations show that monomers ($\text{C}_{\text{B}}$, $\text{C}_{\text{B}}$),
dimers, trimers, and $\text{C}_{\text{N}}\text{O}_{\text{N}}$ pairs are the
most prevalent species under most growth conditions. Compared to these defects,
larger carbon clusters, as well as complexes of carbon with vacancies and
antisites, occur at much smaller concentrations. Our results are discussed in
view of the relevance of carbon defects in single-photon emission in hBN.
