The presence of native defects or unwanted impurities can strongly affect semiconductor device performance. Such defects can give rise to deep levels in the band gap, acting as sources of non-radiative recombination, carrier trapping, and sub-band-gap luminescence. Although predicting the properties of deep defects in semiconductors has long been hampered by the band-gap problem of density functional theory (DFT), methodological developments now allow for quantitative predictions. Here we discuss how first-principles calculations have shed light on the role of deep-level defects and impurities in gallium nitride and related alloys.We begin by discussing computational methodologies for calculating the properties of native defects and discuss how to overcome the band-gap problem of DFT. In particular, we examine to what extent calculations performed with semilocal functionals (such as the generalized gradient approximation), combined with correction schemes, can produce accurate results. The properties of vacancy, interstitial, and antisite defects in GaN are discussed, as well as their interactions with impurities such as hydrogen and oxygen. We also discuss first-principles results in the context of experimental observations, and examine how native defects and their complexes impact the performance of nitride devices [1].We also explore how the properties of defects are affected by presence of alloying elements such as indium [2]. With explicit alloy calculations we monitor how defect levels depend on indium content and the distribution of In atoms. The relative shifts of the charge‐state transition levels of different defects are explained by the atomic character of the defect state. Such shifts depend on whether the defect state is composed of valence‐band or conduction‐band states of the host material, or whether it acts as an atomic‐like impurity. Various possible atomic configurations of In and Ga cations in InGaN alloys of given compositions lead to a distribution of charge‐state transition levels. Defects on the nitrogen site lead to a larger spread of defect levels, while defects on the cation site lead to a smaller spread.Finally, we also investigate the properties of heavily C-doped GaN using both optical experiments and hybrid DFT calculations. Previous calculations had established that carbon acceptors (CN) give rise to a yellow luminescence (YL) band near 2.2 eV [3], along with a blue luminescence band near 2.9 eV. Photoluminescence measurements showed these optical transitions shifting as a function of carbon concentration, suggesting a change in the behavior of carbon. With hybrid DFT we calculated the electrical and optical behavior of carbon species containing multiple carbon impurities, which may arise in heavily doped material. We compared the behavior of these complexes to the isolated centers, and find that the CGa-CN complex is a good candidate to explain the shift in the YL peak. Furthermore, we determined the local vibrational modes of carbon impurity centers, and compared these results to recent experiments.[1] J. L. Lyons and C. G. Van de Walle, npj Computational Materials 3, 12 (2017).[2] D. Wickramaratne et al., phys. Stat. sol. (b) 2020 (https://doi.org/10.1002/pssb.201900534).[3] J. L. Lyons, A. Janotti, and C. G. Van de Walle, Phys. Rev. B 89, 035204 (2014).