**1. Introduction**

Carbon nitrides are a type of a polymeric substance that is mostly made up of carbon and nitrogen [1, 2]. They may be prepared from carbon materials by replacing carbon atoms with nitrogen atoms, making them intriguing possibilities for a range of uses. Due to the chemical inertness of carbon nitride, solubility problem in acidic, neutral, and basic solvents. Hence, the structure of the material was not completely appreciated until recent decades [3]. Because of the presence of basic surface sites, graphitic carbon nitride (g-C3N4) is not only the most stable allotrope of carbon nitrides in the ambient atmosphere, but it also exhibits rich surface characteristics that are appealing for various applications, including catalysis [4]. In the state (this material is a -conjugated polymer), the ideal g-C3N4 consists only of an assembly of CN bonds with no electron localization [5, 6].

As shown in **Figure 1**, real materials, such as those made by polycondensation of cyanamide, contain a minor amount of hydrogen, which is present as primary and/or secondary amine groups on the terminal edges. The presence of hydrogen indicates that the real g-C3N4 is incompletely condensed and that a number of surface defects exist, which can be useful in catalysis and are thought to promote electron relocalization on the surface, inducing Lewis-base character toward metal-free coordination chemistry and catalysis.

**Figure 1.** *Multiple surface functionalities reproduced from [7] with permission from the Royal Society of Chemistry.*

The energy positions of the conduction band (CB) and valence band (VB) versus the normal hydrogen electrode (NHE) are −1.1 and 1.6 eV, respectively, in g-C3N4 (2.7 eV bandgap). Furthermore, g-C3N4 is extremely resistant to heat, strong acids, and strong alkaline solutions. The only elements in g-C3N4 are carbon and nitrogen, and it can be made by pyrolyzing nitrogen-rich precursors such as melamine, urea, thiourea, and cyanamide. It has been observed that the choice of precursor and pyrolysis temperatures have a significant impact on the electrical structure and bandgap of g-C3N4, which will have implications for its prospective uses in a variety of disciplines.

Recently, tremendous progress has been made in the field of g-C3N4 research. As a result, a paper summarizing the synthesis of g-C3N4-based materials and their prospective energy storage applications is required. The characteristics, production, and possible applications of g-C3N4 and g-C3N4-based nanocomposites in energy storage and conversion, such as photocatalytic hydrogen evolution, oxygen reduction reaction (ORR), and Li-based battery, are discussed in this book chapter.
