Carbon materials with unique sp2 -hybridization are extensively researched for catalytic applications due to their excellent conductivity and tunable physicochemical properties. However, the development of economic approaches to tailoring carbon materials into desired morphologies remains a challenge. Herein, a convenient "bottom-up" strategy by pyrolysis of graphitic carbon nitride (g-C3 N4 ) (or other carbon/nitrogen (C, N)-enriched compounds) together with selected metal salts and molecules is reported for the construction of different carbon-based catalysts with tunable morphologies, including carbon nano-balls, carbon nanotubes, nitrogen/sulfur (S, N) doped-carbon nanosheets, and single-atom catalysts, supported by carbon layers. The catalysts are systematically investigated through various microscopic, spectroscopic, and diffraction methods and they demonstrate promising and broad applications in electrocatalysis such as in the oxygen reduction reaction and water splitting. Mechanistic monitoring of the synthesis process through online thermogravimetric-gas chromatography-mass spectrometry measurements indicates that the release of C─N-related moieties, such as dicyan, plays a key role in the growth of carbon products. This enables to successfully predict other widely available precursor compounds beyond g-C3 N4 such as caffeine, melamine, and urea. This work develops a novel and economic strategy to generate morphologically diverse carbon-based catalysts and provides new, essential insights into the growth mechanism of carbon nanomaterials syntheses.