Polymeric carbon nitride (CNxHy) has been facilely synthesized from dicyandiamide and functions as a solution-processed hole injection layer in organic light-emitting diodes (OLEDs). The measurements using X-ray diffraction, atomic force microscopy, X-ray photoelectron spectroscopy, ultraviolet photoelectron spectroscopy, and impedance spectroscopy elucidate that CNxHy exhibits superior film morphology and extra electric properties such as tailored work function and tunable hole injection. The luminous efficiency of CNxHy-based OLED is found to improve by 76.6% in comparison to the counterpart using favorite solution-processed poly(ethylene dioxythiophene):poly(styrene sulfonate) as the hole injection layer. Our results also pave a way for broadening carbon nitride applications in organic electronics using the solution process.