Hexagonal BN (h-BN) is attracting a lot of attention for two-dimensional electronics and as a host for single-photon emitters. We study the properties of native defects and impurities in h-BN using density functional theory with a hybrid functional. Native vacancy and antisite defects have high formation energies, and are unlikely to form under thermodynamic equilibrium for typical growth conditions. Self-interstitials can have low formation energies when the Fermi level is near the band edges, and may form as charge compensating centers; however, their low migration barriers render them highly mobile, and they are unlikely to be present as isolated defects. The defect chemistry of h-BN is most likely dominated by defects involving carbon, oxygen, and hydrogen impurities. Substitutional carbon and oxygen, as well as interstitial hydrogen and boron vacancy-hydrogen complexes, are low-energy defects in h-BN. Based on our results, we can rule out several proposed sources for defect-related luminescence in h-BN. In particular, we find that the frequently observed 4.1 eV emission cannot be associated with recombination at CN, as has been commonly assumed. We suggest alternative assignments for the origins of this emission, with CB as a candidate. We also discuss possible defect origins for the recently observed single-photon emission in h-BN, identifying interstitials or their complexes as plausible centers.