Carbon doped hexagonal boron nitride epilayers have been grown by metal organic chemical vapor deposition. Photocurrent excitation spectroscopy has been utilized to probe the energy levels associated with carbon impurities in hexagonal boron nitride (h-BN). The observed transition peaks in photocurrent excitation spectra correspond well to the energy positions of the bandgap, substitutional donors (C B , carbon impurities occupying boron sites), and substitutional acceptors (C N , carbon impurities occupying nitrogen sites). From the observed transition peak positions, the derived energy level of C B donors in h-BN is E D $ 0.45 eV, which agrees well with the value deduced from the temperature dependent electrical resistivity. The present study further confirms that the room temperature bandgap of h-BN is about 6.42-6.45 eV, and the C N deep acceptors have an energy level of about 2.2-2.3 eV. The results also infer that carbon doping introduces both shallow donors (C B) and deep acceptors (C N) via self-compensation, and the energy level of carbon donors appears to be too deep to enable carbon as a viable candidate as an n-type dopant in h-BN epilayers.