We show that NMR chemical shift spectroscopy could help to identify the crystalline phases of hard carbon nitride compounds. To this purpose we compute the NMR chemical shifts of defect zinc-blende,cubic, alpha, beta, and graphitic C3N4 with with a newly developed ab initio method. The C shifts can be used to identify the CN bonds and to characterize C hybridization. The N shifts distinguish the alpha C3N4 from the beta C3N4 phases, and indicate the presence of the graphitic phase.