Various forms of carbon based complexes in GaN are studied with first-principles calculations employing Heyd-Scuseria-Ernzerhof hybrid functional within the framework of density functional theory. We consider carbon complexes made of the combinations of single impurities, i.e. CN − CGa, CI − CN and CI − CGa, where CN, CGa and CI denote C substituting nitrogen, C substituting gallium and interstitial C, respectively, and of neighboring gallium/nitrogen vacancies (VGa/VN), i.e. CN − VGa and CGa − VN. Formation energies are computed for all these configurations with different charge states after full geometry optimizations. From our calculated formation energies, thermodynamic transition levels are evaluated, which are related to the thermal activation energies observed in experimental techniques such as deep level transient spectroscopy. Furthermore, the lattice relaxation energies (Franck-Condon shift) are computed to obtain optical activation energies, which are observed in experimental techniques such as deep level optical spectroscopy. We compare our calculated values of activation energies with the energies of experimentally observed C-related trap levels and identify the physical origins of these traps, which were unknown before.