Carbon and nitrogen co-doped ZnO was synthesized by simple, two-step pyrolysis of a zinc-based metal organic framework (Zeolitic Imidazolate Framework-8, ZIF-8). ZIF-8 was firstly carbonized in a nitrogen atmosphere, followed by pyrolysis in air forming carbon and zinc oxide hybrids. The hybrids were evaluated by photocatalytic dye degradation and oxygen evolution reaction (OER). The contents of the dopants influenced the photocatalytic performances of the hybrids. The mechanism was illustrated and showed that hydroxyl radicals and photo-excited electrons contributed to the dye degradation. The carbon-zinc oxide hybrid also demonstrated a great potential for water oxidation because of the more active sites induced by dopants.