Nanoporous carbons were prepared by thermal conversion of zinc/cobalt-based zeolitic imidazolate frameworks (ZIF-8/ZIF-67) and their bimetallic ZIFs, and used for environmental remediation, energy storage and conversion. For wastewater treatment by adsorption, pristine ZIFs presented high adsorption capacities of phenol while the carbon derivatives showed a negligible capacity, due to the collapse of frameworks during the pyrolysis, resulting in a sharp decrease in specific surface area and micropore fraction. However, the as-derived carbons exhibited excellent catalytic performances in degradation of phenol and p-hydroxybenzoic acid by advanced oxidation using peroxymonosulfate. Moreover, ZIF-67 derived carbons also produced the best performances in electrochemical oxygen reduction and evolution reactions due to a high graphitic degree, while ZIF-8 derived carbons showed the highest specific supercapacitance, attributing to the large mesopore volume and specific surface area. This study illustrated that the structures of ZIFs-derived carbon materials are determined by the metal species and constituents of the parental ZIFs as well as the pyrolysis conditions, making the carbons varying performances in environmental and electrochemical applications.