Hexagonal boron nitride (hBN) is a wide-band-gap semiconductor with applications including gate insulation layers in graphene transistors, far-ultraviolet light emitting devices and as hydrogen storage media. Due to its complex microstructure, defects in hBN are challenging to identify. Here, we combine x-ray absorption near edge structure (XANES) spectroscopy with ab initio theoretical modeling to identify energetically favorable defects. Following annealing of hBN samples in vacuum and oxygen, the B and N K edges exhibited angulardependent peak modifications consistent with in-plane defects. Theoretical calculations showed that the energetically favorable defects all produce signature features in XANES. Comparing these calculations with experiments, the principle defects were attributed to substitutional oxygen at the nitrogen site, substitutional carbon at the boron site, and hydrogen passivated boron vacancies. Hydrogen passivation of defects was found to significantly affect the formation energies, electronic states, and XANES. In the B K edge, multiple peaks above the major 1s to π * peak occur as a result of these defects and the hydrogen passivated boron vacancy produces the frequently observed doublet in the 1s to σ * transition. While the N K edge is less sensitive to defects, features attributable to substitutional C at the B site were observed. This defect was also calculated to have midgap states in its bandstructure that may be responsible for the 4.1-eV ultraviolet emission frequently observed from this material.