1 Introduction

Energy is a strategic commodity important for a country's growth, survival, and socio-economic development [1,2,3,4]. Our energy needs rely heavily on petroleum-based fuels, which have limited reserves and are not considered sustainable. Moreover, they have detrimental effects on the environment. Overcoming this challenge and ensuring a long-term energy supply while mitigating environmental impact necessitates exploring alternative energy sources [5,6,7]. Renewable energy sources like hydropower, wind, solar, and geothermal energy offer potential solutions. However, their widespread adoption faces obstacles due to geographical and technical constraints, which limit their acceptance in society [8,9,10]. To unlock the maximum energy potential from these resources and overcome these limitations, hydrogen (H2) is being investigated as a promising energy carrier. H2, with its efficient energy storage and delivery capabilities, is seen as a viable energy carrier for the future [11,12,13,14]. By utilizing H2 as an intermediary, we can effectively harness the energy generated from renewable sources and address the energy crisis. This approach opens up new possibilities for extracting the utmost energy from renewable resources, paving the way for a more sustainable and environmentally friendly energy landscape [15,16,17].

Harnessing solar energy provides a viable solution for meeting the demand for clean energy. Solar power is an abundant and renewable natural resource, with sunlight striking the Earth's surface at a rate approximately 130 million times greater than that generated by a single 500 MW power plant [18,19,20,21]. Utilizing solar energy through processes like photosynthesis [22], which converts sunlight into chemical energy, is essential for producing clean fuel. To fully use solar energy, we need to achieve specific vital objectives. The methods employed for solar energy conversion [23] and storage [25], biomass [26], and renewable sources like wind [27] and solar energy [28]. H2 fuel offers higher efficiency than gasoline [29] due to its lower volumetric energy density. However, the production of clean H2 still poses significant challenges that need to be addressed [30].

The groundbreaking research conducted by Fujishima and Honda [31] in 1972, which focused on using TiO2 as a semiconductor photoanode for splitting water through photocatalysis, provided hope for the generating, utilizing, and storing solar energy. However, TiO2's wide band gap of 3.2 eV and limited ability to absorb visible light hindered its efficiency in water splitting [32]. To overcome these challenges, scientists explored alternative photocatalysts with narrower band gaps, such as Fe2O3 [33], CdS [34], Bi2WO6 [35], BiVO4 [36], Ta2O5 [37], Ta3N5 [60,61,62], which involves introducing foreign elements or impurities, is a crucial technique for adjusting the physicochemical properties of g-C3N4. By do** one or two aspects into the polymer's framework, the band gap can be finely tuned [63], impacting its light absorption capacity and the values of its band edge potentials for various photocatalytic applications [64,65,66,67]. While there have been reports of metal do** [68,72] and their tendency to form covalent bonds by accepting electrons. Researchers have explored the do** of single nonmetals [73,74,75] and simultaneous do** of two nonmetals [76,77,78], which have shown significant enhancements in the activity of the bulk polymer. Given the recent progress in do** techniques, it is an ideal time to provide a comprehensive review of doped g-C3N4 systems for photocatalytic reduction reactions. While previous studies have covered aspects such as the design, development, and applications of g-C3N4, including the incorporation of both noble and non-noble metals [79,80,81], morphology orientation [82,83,

2 History of graphitic carbon nitride

In 1834, J. Liebig and J. J. Berzelius discovered [94] the formation of a pale-yellow, amorphous, and insoluble solid residue during the ignition of mercury (II) thiocyanate. They named this residue [95,96,97] "melon," now known as g-C3N4. Liebig determined its composition as (C2N3H) n through CHN analysis and identified melamine, melam, melem, and melon as the building blocks for the heptazine and triazine framework. Melon was synthesized by thermally polymerizing ammonium chloride and potassium thiocyanate. However, due to the insolubility and low reactivity of the s-heptazine derivatives, studying g-C3N4 faced challenges in the early years [98,99,100]. The focus was mainly on CHN elemental analysis (EA), and the structure remained unclear for a long time. In 1886, Klason proposed the formula C3N3(NH)3C3N3 without providing further details. Franklin, in 1922, reiterated the possibility of g-C3N4 as the final polymerization product and suggested potential structures, but without crystallography studies, his proposals were not widely accepted [101,102,103,104].

It was not until 1937 when Pauling and Sturdivant used X-ray crystallography to reveal the structure of the repeating unit, which consists of three fused 1,3,5-triazine rings known as tri-s-triazine [105]. In 1940, Redemann and Lucas confirmed Franklin's definition of the tris-s-triazine repeating unit by noting similarities between graphite and melon [106]. In 1989, Liu and Cohen [107] developed an empirical model and conducted ab initio calculations to predict the synthesis of new hard materials, including carbon–nitrogen compounds, with extreme hardness comparable to or greater than diamond. These theoretical predictions inspired [108,109,110] experimental researchers to explore synthetic methods. Further theoretical studies in the 1990s, particularly by Teter and Hamley, focused on the structure and stability of different g-C3N4 polymorphs (Fig. 2a). They predicted a cubic form of g-C3N4 with a higher bulk modulus than diamond. This theoretical work provided a foundation for experimental researchers to develop synthetic protocols. In 2001, Komatsu [111, 112] successfully synthesized Berzelius's melon and characterized it using various physicochemical techniques, such as X-ray diffraction, Raman spectroscopy, infrared spectroscopy, and laser desorption mass spectrometry. Kroke [113, 114] conducted a detailed structural characterization of a functionalized tri-s-triazine derivative and trichloro-tri-s-triazine the following year. They obtained bright yellow single crystals of trichloro-tri-s-triazine with a monoclinic space group (C2/c). DFT calculations supported a g-C3N4 structure based on tri-s-triazine, which was more stable than previously reported s-triazine structures by approximately 30 kJ mol−1.

Fig. 2
figure 2

a Historical development and critical milestones of g-C3N4 from the 19th Century to the present day, based on established structure solutions: 1800s: Liebig, Berzelius, and Gmelin conducted early research on carbon and nitrogen compounds, laying the foundation for further exploration; 1930s: Pauling and Sturdivant made a significant breakthrough by identifying the heptazine unit (C6N7) as a crucial building block in carbon nitride compounds; 1990s: with the development of computational methods, scientists were able to simulate the structure of g-C3N4, providing valuable insights into the arrangement of carbon and nitrogen atoms; 2000: the structures of two crucial carbon nitride compounds, trichloroheptazine (C6N7Cl3) and melem (C6N7H6), were successfully determined, adding experimental evidence to support predicted structures. b Synthetic pathways for the polymer family of materials, with estimated reaction starting temperatures based on variable temperature XRD. Reproduced with permission from ref. 119. Copyright (2021) Wiley–VCH GmbH

Jurgens conducted a significant study that involving synthesizing melem in large quantities, determining its crystal structure, and using spectroscopic techniques to validate the existence of a fundamental C-N–H molecule proposed earlier [115]. By subjecting cyanamide, ammonium dicyanamide, dicyandiamide, and melamine to thermal treatment at 450 °C for 5 h, a white-beige powder with a 60% yield was obtained. The molecule’s structure was confirmed through various methods, including single crystal X-ray diffraction (XRD), powder XRD, and 13C and 15N magic angle spinning nuclear magnetic resonance (MAS NMR) techniques. To gain further insights, the researchers performed calculations using B3LYP and MP2 level methods [116] implemented in Gaussian to determine the structural and vibrational properties of the molecule. The molecule's optimization in the extended state was carried out using Local Density Approximation (LDA) and Generalized Gradient Approximation (GGA) [117] implemented in VASP. The experimental and theoretical results agreed well regarding structural parameters and vibrational frequencies. Further investigations using temperature-dependent XRD revealed that the molecule transforms into a graphite-like C-N material when exposed to temperatures above 560 °C. The most stable phase of g-C3N4 has been successfully synthesized using nitrogen (N)-enriched organic compounds like cyanamide, dicyandiamide, melamine, and urea [118]. Wang et al.'s groundbreaking work in 2009 [129,130,131]. Using a covered crucible during fabrication played a crucial role in material formation. When the crucible was partially closed, a yellow solid powder was obtained. In contrast, an open crucible resulted in no material formation due to precursor decomposition caused by releasing gases during pyrolysis, which hindered the reaction. Therefore, the evolution of gases in a covered crucible acted as the driving force for polymerization. Moreover, the pyrolysis duration significantly affected the enhancement of active sites in the polymer. It was observed that the surface area of the polymer substantially increased when subjected to thermal polymerization for 0 to 240 min [132,171]. This process allows for precise adjustments in the semiconductor's characteristics. The concentration of dopants can vary, with low do** referring to a ratio of one dopant atom per 100 million intrinsic semiconductor atoms and high do** indicating a ratio of one dopant atom per ten thousand intrinsic semiconductor atoms [172,173,174]. The concept of do** in semiconductors has been known for a long time. As early as 1885, Bidwell discovered that impurities affected the properties of semiconductors [175]. Since then, extensive research has been conducted to develop do** techniques that enhance semiconductor performance for various applications [176,177,178,179]. In the field of nonmetal do** using g-C3N4 for photocatalysis, there are several advantages. First, do** increases the material's ability to absorb visible light, improving its performance [180, 181]. This occurs by enhancing the movement of excited electrons and holes while reducing their recombination rate. Do** achieves this by delocalizing π-conjugated electrons, causing the electron distribution in the lowest unoccupied molecular orbital (LUMO) and the highest occupied molecular orbital (HOMO) to spread out. Second, do** allows precise adjustments to the polymer's CB edge potential. This makes the polymer suitable for enhancing selectivity in specific reactions, such as the reduction of CO2. The polymer's behavior can be tailored to facilitate desired reaction pathways by modifying the CB edge potential. Third, do** increases the material's active surface area by converting the bulk 3D polymer into 2D nanosheets. This generates more significant active sites and defects, providing more opportunities for catalytic reactions and improving overall efficiency. Finally, do** enhances the efficiency of photoelectrochemical processes by improving charge transfer dynamics at the solid/liquid interface. This facilitates the transfer of excited electrons to the CB, resulting in higher photocurrent than the undoped polymer.

4.1 Single non-metal do**

Boron (B) doped g-C3N4 was synthesized by heating a mixture of melamine and boron oxide. Boron oxide powders were dissolved in an ethanol (CH3CH2OH) solution, followed by the addition of melamine. The mixture was dried and then calcined at various temperatures. Analysis of the XRD patterns indicated that the insertion of B into the polymer's crystal structure caused a shift in the (002) peak towards higher angles. B dopants and N defects can be simultaneously introduced into g-C3N4 by a straightforward method. This involves calcining a mixture of g-C3N4 and sodium borohydride (NaBH4) in an N2 environment at various temperatures (Fig. 3a). By heating the g-C3N4 and NaBH4 mixture under controlled conditions, chemical reactions occur, and the dopants diffuse into the g-C3N4 structure. A N2 atmosphere prevents oxidation reactions by excluding oxygen (O2). XPS analysis of the B 1 s peak (Fig. 3b) confirmed the presence of B atoms incorporated into the g-C3N4 framework. X-ray absorption near-edge structure (XANES) measurements (Fig. 3c) showed distinctive 2p π* resonances related to specific N sites, namely triangular edge N (N1 site) and bridge N (N2 site). The N1/N2 peak intensity ratio indicated similar ratios of N atoms at N1 and N2 sites, suggesting that no N defects were introduced during B do**. At the same time, the B dopants were located at carbon (C) sites. DFT calculations were conducted to examine the electronic properties of g-C3N4 (Fig. 4a) and B doped g-C3N4 (Fig. 4d). The calculations revealed that the CB primarily consisted of C 2p and N 2p orbitals. In contrast, the valence band (VB) was mainly composed of N 2p orbitals (Fig. 4b and c). A midgap energy level involving C 2p, N 2p, and B 2p orbitals appeared around 1.5 eV above the VB (Fig. 4e and f). This midgap state contributed to increased absorption and was consistent with the observed absorption tail in the BHx samples. In terms of molecular orbitals, the HOMO and LUMO of pristine g-C3N4 (Fig. 4g) were uniformly distributed over the heptazine rings due to the material's symmetrical structure. However, in B doped g-C3N4 (Fig. 4h), the charge density was redistributed, resulting in the VB and CB’s downshifting and midgap states associated with dopants or defects. This redistribution of charge carriers facilitated spatial separation of charge localization sites, minimizing back reactions and enhancing the material's photocatalytic activity [182]. B do** increased the electrical conductivity of g-C3N4 and induced spin polarization. The do** concentration influenced the coupling configuration of the net spin and the resulting magnetism. However, the distribution of net spin at the active site remained unaffected by the do** concentration, indicating that the catalytic capacity was independent of the do** level [183]. Time-domain DFT provided a detailed mechanistic understanding of charge separation and recombination processes, which are crucial for assessing photocatalytic performance. Dopant states expanded the visible light absorption range and reduced nonradiative lifetimes compared to the pristine polymer. B do** at C exhibited a longer charge recombination time among the do** systems due to weaker electron–phonon coupling between the VB maximum and trap states. This finding suggests that B do** is the most suitable option for photocatalytic applications based on quantum dynamics processes [184].

Fig. 3
figure 3

a Schematic representation of the process for preparing B doped g-C3N4, b proposed structural changes in the heptazine units of g-C3N4 resulting from thermal treatment with NaBH4, c high-resolution spectra of B1s X-ray photoelectron spectroscopy showing g-C3N4 and B doped g-C3N4 (BHx, x = 300, 350, 400, 450, 500), d nitrogen K-edge X-ray absorption near-edge structure (XANES) spectra comparing g-C3N4, CN–B, CN–H, and BH400. Reproduced with permission from ref. 182. Copyright (2019) WILEY–VCH Verlag GmbH & Co. KGaA, Weinheim

Fig. 4
figure 4

a Diagram illustrating the structure model of pristine g-C3N4 and d B doped g-C3N4 with B2-site dopants, b calculated band structures shown for pristine g-C3N4, e calculated band structures displayed for B doped g-C3N4 with B2-site dopants, c density of states (DOS) plot corresponding to pristine g-C3N4, f density of states (DOS) plot corresponding to B doped g-C3N4, g visualization of the distribution of the highest occupied molecular orbital (HOMO) and lowest unoccupied molecular orbital (LUMO) in pristine g-C3N4, h visualization of the distribution of the HOMO and LUMO in B doped g-C3N4 with B2-site dopants, carbon atoms are depicted as grey spheres, nitrogen atoms as blue spheres, hydrogen atoms as white spheres, and boron atoms as red spheres. Reproduced with permission from ref. 182. Copyright (2019) WILEY–VCH Verlag GmbH & Co. KGaA, Weinheim

In addition to incorporating B atoms, C do** can also modify the electronic structure of the polymer, resulting in improved electron mobility and increased ability to absorb visible light. Researchers developed a hydrothermal calcination method to introduce C into the polymer by using melamine and sodium alginate as precursors (Fig. 5a). By adjusting the amount of sodium alginate, they investigated how the C content affects the structure and photocatalytic properties of the material. The presence of C do** was confirmed by observing higher intensity peaks in the C 1 s (at 284.1 eV) and N 1 s (at 399.2 eV) spectra of the doped polymer. The C doped material exhibited significantly stronger absorption in the visible light range (450 nm to 700 nm), which can be attributed to the intrinsic modulation of electron behavior and the band gap (Fig. 5b). Moreover, C do** reduced the rate of charge recombination, as indicated by fluorescence and time-resolved fluorescence spectroscopy. This suggests that C do** enhances the efficiency of proton reduction reactions, leading to more effective H2 production than the bulk polymer. These improvements can be attributed to the increased specific surface area, improved visible light absorption, and enhanced electron transport facilitated by the hollow tubular structure of the material [185]. Another approach involved mixing melamine with biomass-based kapok fiber to achieve C modification of g-C3N4 through a one-step pyrolysis process. C do** improved charge separation and exhibited superior photocatalytic activity under visible light [186]. Additionally, a C-rich g-C3N4 material with cross-pore channels was synthesized through the supramolecular self-assembly of melamine and 2-hydroxypropyl-β-cyclodextrin (Fig. 5c). This material demonstrated a larger surface area enhanced light-harvesting ability, faster separation of photoinduced carriers through abundant C rings, a narrower band gap, good photo response current (Fig. 5d) and excellent photocatalytic performance [188].

In 2012, scientists used hydrothermal method to synthesize oxygen (O) doped g-C3N4 by introducing hydrogen peroxide (H2O2) as a dopant precursor. The catalyst's N–C–O species was identified through an O 1 s core level detected at 531.6 eV. By incorporating O, which was generated through the pyrolysis of melamine precursors modified with H2SO4 and HNO3, the researchers observed an unusual improvement in light absorption and charge separation within the polymer. This enhancement was attributed to increase in the C–O–C content by replacing N atoms at N2c sites. The intensity of EPR signals gradually decreased, indicating a reduction in the concentration of unpaired electrons on C atoms. This decrease formed C–O–C bonds in aromatic rings, resulting in distinct morphologies. Additionally, the do** caused a shift in the potential of the CB edge to a more negative value, facilitating a more efficient photocatalytic reduction reaction [189]. Using a "calcination-hydrothermal-calcination" method involving melamine and oxalic acid (Fig. 6a), researchers successfully demonstrated the formation of a tube-in-tube structured nanoreactor composed of O doped g-C3N4 with a broom-like appearance. Analysis using transmission electron microscopy (TEM) revealed that the nanotube had a length of 18.5 μm and a wall thickness of 13.5 nm (Fig. 6b). The ultrathin wall of the nanotube played a crucial role in increasing light scattering within the hollow cavity, promoting the separation and migration of photo-generated charges. Furthermore, the confinement effect of this nanoreactor facilitated the rapid transfer of reactants, thereby accelerating the reaction rate. The specific morphology design of the tube-in-tube nanoreactor proved vital in enhancing the photocatalytic performance. Finite-difference time-domain (FDTD) simulations showed that the hollow structure allowed light to penetrate the interior, generating resonance. Under 420 nm wavelength irradiation, the hollow tube structure exhibited a strong local electric field induced both at the edge and inside, in contrast to the weak electric field observed only at the edge in the bulk polymer. DFT calculations provided insights into the effects of O do** and the formation energy associated with substituting O atoms at various N sites. The optimized band structure and DOS analysis revealed that the CB primarily formed from C 2p and N 2p orbitals, while the VB consisted mainly of N 2p orbitals. The calculations indicated a reduction in the band gap and a shift in the CB band edge upon O do**. The charge density around O atoms (Fig. 6c) increased in the O doped catalyst due to their strong interaction with neighboring atoms. Bader charge analysis at different sites confirmed a decrease in the charge density of C atoms near O atoms and an increase in the electron density of adjacent N atoms, suggesting a reorganization of charges within the doped catalyst compared to the undoped one (Fig. 6d). This redistribution of charges resulted in the creation of an internal electric field, facilitating the separation of electron–hole pairs [190]. Additional research using an ab initio approach has provided further insights into the positive effects of O do** in monolayer g-C3N4. Incorporating O dopants weakens the covalent nature of O-C bonds and introduces a complex ionic-covalent character in O-N bonds. This do** process enhances the material's ability to absorb visible light, creating an intrinsic semiconductor behavior and preventing recombination centers by distributing the HOMO and LUMO [191]. In another study, scientists successfully demonstrated the production of 2D amorphous O doped g-C3N4 by reacting the polymer with H2O2 and polyvinylpyrrolidone (PVP) in CH3CH2OH (Fig. 6e). Subsequently, the material was treated with supercritical CO2, leading to the formation of exfoliated nanosheets ranging in size from sub-micrometer to several micrometers, as observed through TEM and atomic force microscopy (AFM) [192]. Furthermore, a one-dimensional O doped g-C3N4 nanorod was synthesized using a hydrothermal method assisted by H2O2. By examining time-dependent FESEM and TEM images of the samples obtained at various hydrothermal times, it was observed that the nanosheets gradually dissolved over a continuous 24-h hydrothermal reaction, resulting in the formation of short and long nanorods and ultimately pure rod-like O doped g-C3N4 (Fig. 6f). The proposed mechanism suggests that this transformation occurs through the formation of smaller heptazine units with a higher number of -NH and -OH groups, which subsequently assemble through intermolecular H2 bonding and interlayer p-p stacking. O do** plays a crucial role in tuning the material's absorption band, enabling it to absorb light up to 537 nm and causing a color change from yellow to ivory white. Furthermore, the flat band potential shifts from -1.2 to -1.3 eV, significantly enhancing the efficiency of photocatalytic reactions. DFT calculations indicate that electron distribution around the Fermi level differs between the O doped system and the bulk polymer, where the Fermi level is situated within the middle of the band gap. O do** also prolongs the lifetime of excited electrons, as revealed by time-resolved photoluminescence (TRPL) spectra, and improves charge transfer efficiency, as demonstrated by photocurrent and impedance measurements [193]. To prepare O doped g-C3N4, a simple thermal-oxidative exfoliation method was employed. The process involved subjecting bulk g-C3N4 to two consecutive calcination steps at 600 °C for 1 h each, resulting in do**. X-ray diffraction analysis showed a decrease in the intensity of the (100) and (002) peaks with longer calcination times, and the (100) peak nearly disappeared after do**, leading to restacking along the Z direction. XPS and EA confirmed an increase in the atomic weight percentage of O from 3.54 to 4.73%, indicating the successful incorporation of O dopants. UVDRS revealed that all samples exhibited good absorption ability in the 200–300 nm wavelength range. Additionally, the bandgaps of the material increased from 2.5 to 2.9 eV. This increase in bandgap can be attributed to the quantum confinement effect resulting from the formation of thin nanosheets. The fluorescence intensity of the material also increased and exhibited a blue shift, further supporting the quantum size effect of the catalyst. The presence of O dopants led to greater photocurrent and lower impedance values, indicating reduced electron–hole recombination and improved charge transfer mobility. DFT studies supported these findings, showing that as the thickness of the polymer decreased, the bandgap became wider, consistent with the experimental results. Furthermore, O do** introduced impurity levels in the middle of the bandgap, facilitating the charge transition from the valence band maximum (VBM) to the do** level. This enhancement resulted in better performance for CO2 photoreduction [194].

Fig. 6
figure 6

a Oxalic acid and melamine formed connections through acid–base interactions, and during the calcination process, a portion of the mixture decomposed, releasing gases such as CO2 and NO2. Meanwhile, another portion underwent polycondensation to produce g-C3N4, incorporating oxygen atoms into the tri-s-triazine structure. Upon hydrothermal treatment under high temperature and pressure, water exhibited properties of a protonic acid, effectively breaking the hydrogen bonds between layers. As a result, the polymer tri-s-triazine structures underwent hydrolysis, yielding smaller molecular units. These smaller units were subsequently reassembled into a broom-shaped supramolecular precursor. b TEM images of O doped g-C3N4. Optimized structure and charge density difference of c g-C3N4 and d O doped g-C3N4. Reproduced with permission from ref. 190. Copyright (2023) Elsevier B.V. e At elevated temperatures, H2O2 molecules undergo decomposition, generating active radicals such as ·OH, HO2·, and H+. The tri-s-triazine-based compounds react with H+, and the protonation of g-C3N4 facilitates the grafting of hydroxyl radicals onto carbon, resulting in the hydroxylation modification. A high concentration of supercritical CO2 molecules induces a strong attacking interaction due to shear strain. Consequently, the C-N = C(-NH2+) bonds break, leading to the formation of nitrogen vacancies. Subsequently, O atoms replace nitrogen sites and establish covalent C–O–C bonds within the conjugated structure. Reproduced with permission from ref. 192. Copyright (2021) Zhengzhou University. f FESEM image of O doped g-C3N4 upon H2O2 treatment. Reproduced with permission from ref. 193. Copyright (2019) The Royal Society of Chemistry

In 2010, researchers achieved a significant milestone by successfully incorporating phosphorus (P) atoms into the g-C3N4 framework through substitutional do**. They used a mixture of dicyandiamide and 1-butyl-3-methylimidazolium hexafluorophosphate ionic liquid as the source of P, with concentrations of 10 and 30 wt%. This mixture was then heated to create the doped catalyst. The researchers used various techniques to analyze the doped material, including XPS and 31P NMR. The XPS analysis showed that the presence of P-N coordination was indicated by the P2p peaks appearing at 133.5 eV, which is higher than the typical range for P–C coordination. Interestingly, no fluorine (F) peaks were observed in the XPS spectrum, indicating that the P source did not introduce F atoms to the material. The 31P NMR investigations provided additional insights, revealing distinct signals between 0 and -40 ppm, attributed to forming P-N bonds. Do** the material with lower amounts of P allowed most of its structural features to be retained. However, significant changes in the electronic properties were observed. The doped material changed color from yellow to brown and showed a substantial increase in electrical conductivity, reaching up to four orders of magnitude without light exposure. Additionally, the photocurrent values demonstrated a fivefold enhancement compared to the bulk material, indicating improved photocatalytic properties [195]. Novel porous P doped g-C3N4 nanosheets were fabricated by combining P do** and thermal exfoliation strategies by varying the mass ratio of 2-aminoethylphosphonic acid as a dopant precursor with melamine. The creation of macropores is due to the evolution of ammonia gas produced from the decomposition of the dopant as confirmed by the SEM and TEM. The thermal exfoliation gradually oxidized the heptazine units, reduced the thickness to 5–8 nm, and exposed these macropores with 90–300 nm sizes. Porous nanosheet architecture could enhance the surface area with higher active sites, facilitate the rapid transfer of photogenerated charge carriers and easy diffusion of reactant and product molecules by enhancing the light harvesting ability of the polymer. DFT structure optimization further revealed that the more energy-favorable site is C than N for P do**, consistent with the XPS analysis. Moreover, the doped optimized structure enhanced the in-planar distance of nitride pores from 6.95 to 7.04 Å. The electronic structure calculation showed that P do** could able to narrow the band gap from 3.0 to 2.6 eV and the empty midgap states are created by the hybridization of C 2s2p, N 2s2p, and P 3s3p and were well corroborated with UVDRS spectra [196]. Researchers successfully obtained P doped hexagonal tubular g-C3N4 with a hierarchical micro-nanostructure by dissolving melamine and phosphorous acid in deionized water (Fig. 7a) [197]. The hydrothermal process, conducted under pH conditions of 1–3, involved the hydrolysis of melamine into cyanuric acid and forming hexagonal cylinder precursors through self-assembly. The subsequent calcination process allowed the incorporation of P from phosphorous acid into the g-C3N4 structure, resulting in a doped polymer. Scanning electron microscopy (SEM), images revealed the presence of hexagonal rod structures measuring 300–500 nm in length and 60–100 nm in diameter (Fig. 7b). Single-crystal XRD analysis confirmed the presence of multiple H-bonds between melamine and cyanuric acid, arranged in the same plane to form a hexamer topology. The combined hierarchical micro-nanostructure and P do** resulted in a narrowed band gap, increased electrical conductivity, and enhanced photocatalytic properties [198]. Researchers successfully synthesized P doped g-C3N4 nanostructured mesoporous flowers by co-condensing melamine and (hydroxyethylidene)diphosphonic acid in a mixed ethylene glycol solution. A detailed TEM examination revealed the presence of randomly distributed in-plane mesopores on the polymer with sizes ranging from 3 to 18 nm, which correlated well with the surface area analysis. These unique flower-like structures provided abundant active sites, promoting efficient mass transfer and charge separation within nanodomains. The XPS analysis of the P 2p spectrum showed distinct peaks at 131.5 and 133.1 eV, corresponding to P–C and P-N coordination, respectively. This indicated the successful incorporation of P atoms by replacing both C and N atoms in the structure. The introduction of P also induced changes in the structural and electronic properties, evident from the color transformation of the material from pale yellow to dark brown, in agreement with the results obtained from UVDRS. The material exhibited a low recombination rate of charge carriers, as demonstrated by PL and transient photocurrent measurements. Each light excitation triggered rapid, stable, and reversible photocurrent responses. Electrochemical impedance spectroscopy (EIS) revealed a significantly smaller diameter than the bulk polymer, indicating reduced contact and charge-transfer resistance. Furthermore, the material displayed notable cathodic current density and low overpotential, indicating enhanced catalytic activity and reaction kinetics for photocatalytic H2 generation. The flower-like nanostructures with mesoporosity, and P do**, played crucial roles in enhancing light trap**, facilitating mass transfer, and promoting efficient charge separation. These factors contributed to the outstanding catalytic performance of the material compared to the undoped polymer [199]. The doped nanotubes were created through a single-step thermal reaction involving melamine and sodium hypophosphite monohydrate (NaH2PO2·H2O) (Fig. 7c). The formation of nanotube structures was attributed to the in-situ generation and evolution of phosphine gas during the thermal decomposition process. The release of this gas weakened the interlayer van der Waals forces, facilitating the exfoliation of the bulk material into thin layers that then curled up to form nanotubes. At the same time, P was introduced through interstitial do**, which was achieved by reducing uniplanar copolymerization. TEM examination revealed the presence of multilayered nanotubes with a diameter of 200 nm and a thickness ranging from 20 to 50 nm. The P 2p XPS spectra exhibited a peak centered at 133.5 eV, indicating the presence of P in the + 5-oxidation state. The P do** occurred through interstitial incorporation, likely in the form of PO43−, rather than substituting C and/or N atoms. The 31P NMR spectra displayed four distinct signals between 10 and -20 ppm, corresponding to different chemical environments of phosphate radicals within the organic polymeric framework, confirming the findings from XPS analysis. Raman spectroscopy revealed characteristic peaks at 1300 cm−1 (the D band) and 1580 cm−1 (the G band), indicating the presence of surface defects and disorder in the basal plane, respectively. The higher intensity ratio of Id/Ig observed in the doped catalyst suggested an increased presence of defects and disorder. The P do** led to a color change from pale yellow to orange-yellow, resulting in improved absorption of visible light by the material. The VB and CB potentials of the doped catalyst were estimated to be 1.8 and -0.9 eV, respectively, based on VBXPS and bandgap calculations. The decrease in the CB potential from -1.1 to -0.9 eV was consistent with the findings from the Mott-Schottky analysis. The ability to finely tune the conduction potential through do** could affect the selectivity in the photocatalytic reduction of CO2 [200]. A mild and low-temperature method was utilized to create P doped g-C3N4. The process involved a room-temperature mechanochemical reaction between sodium phosphide and cyanuric chloride, followed by annealing at 300 °C for 1 h under argon (Fig. 7d). Through a combination of experimental solid-state analytical techniques and theoretical DFT modeling, the structure was identified as carbon phosphanitride. The P 2p signal analysis revealed a doublet with two peaks at 129.8 and 133.2 eV, indicating P–C coordination and partial oxidation. 31P MASNMR spectra showed two peaks at δP1 =  − 12.8 ppm and δP2 =  − 24.7 ppm, corresponding to P linked to the triazine-based g-C3N4. Theoretical DFT calculations confirmed the experimental 31P MAS NMR spectra indicating a decrease in the formation of P containing molecules upon annealing [201]. In another study, P doped nanostructured g-C3N4 with an enlarged surface area was produced by incorporating trioctylphosphine oxide (TOPO) as a dopant precursor and SiO2 as a hard template (Fig. 8a). The resulting material exhibited a uniform hollow structure, with the role of TOPO in determining the morphology being crucial (Fig. 8b). The nonpolar characteristics of TOPO, specifically the octyl group, prevented melamine aggregation on the SiO2 surface, leading to the formation of a uniform layer (Fig. 8c). The combination of the hollow structure and P do** demonstrated a synergistic effect, enhancing light absorption across a wide range, promoting charge separation and migration, and increasing the specific surface area. Additionally, the photocurrent showed a 5.4-fold increase in the cathodic direction, and there was a 3.3-fold improvement (Fig. 8d, e) in the current at zero biased potential, significantly enhancing the photoelectrochemical activities [202].

Fig. 7
figure 7

a Under hydrothermal conditions, with the assistance of phosphorous acid at pH levels ranging from 1 to 3, melamine underwent partial in-situ hydrolysis, forming cyanuric acid. The self-assembly between melamine and cyanuric acid led to the formation of regular and stable hexagonal cylinder precursors; simultaneously, phosphorous acid molecules were adsorbed onto the surface of the precursor. Following thermal treatment, phosphorus permeated the framework, forming P doped hexagonal tubular carbon nitride. Reproduced with permission from ref. 197. Copyright (2016) WILEY–VCH Verlag GmbH & Co. KGaA, Weinheim. b Large-scale synthesis of P doped g-C3N4 nanotubes was achieved by subjecting a mixture of sodium hypophosphite monohydrate and melamine to high temperatures. The thermal decomposition of NaH2PO2·H2O released phosphine gas, which played a crucial role in transforming the material’s morphology from 2D nanosheets to 1D nanotubes. Reproduced with permission from ref. 200. Copyright (2017) American Chemical Society. c SEM images of P doped g-C3N4. Reproduced with permission from ref. 197. Copyright (2016) WILEY–VCH Verlag GmbH & Co. KGaA, Weinheim. d Examples of phosphanitride and phosphorus-containing g-C3N4 were reported by various research groups. Reproduced with permission from ref. 201. Copyright (2022) Wiley–VCH GmbH

Fig. 8
figure 8

a The initial step involved the synthesis of SiO2 nanoparticles with an average diameter of 100 nm. Subsequently, P-incorporated g-C3N4 was fabricated using melamine and TOPO through a two-step calcination process. Finally, the removal of SiO2 was achieved using NH4HF2. TOPO played a dual role in the process by acting as a precursor for P do** and as a structure-directing agent, guiding the formation of the desired nanostructured architecture after etching, FETEM images of b h-PCN at 100 nm and c h-PCN at 20 nm scale, LSV curves for the photocatalysts d in the dark and e in illuminated conditions. Reproduced with permission from ref. 202. Copyright (2022) American Chemical Society

Researchers successfully incorporated sulfur (S) into g-C3N4 by exposing the polymer powder to a gaseous atmosphere of H2S at a temperature of 450 °C. Analysis using XRD confirmed that the fundamental atomic structure of the material mainly remained intact. However there was a decrease in diffraction intensity, suggesting a reduction in particle size after do**. This finding was further supported by observations using TEM. The reduced particle size played a role in widening the material's bandgap. The S 2p XPS spectrum exhibited two distinct peaks at 163.9 and 168.5 eV, indicating the presence of C-S coordination resulting from the substitution of S for N in the lattice. XANES spectroscopy at the S K-edge revealed two characteristic features at 2472.6 and 2482.0 eV, corresponding to S functional groups: Sθ− (0 < θ < 2) and SO42−. This indicated the presence of S in different chemical environments within the material. DFT calculations were conducted using a 4 × 4 × 2 supercell model, incorporating S dopants that were two-coordinated with N atoms. The calculations demonstrated that the substitutional do** narrowed the bandgap and raised the VB through interactions between S 3p and N 2p orbitals. However, experimental bandgap measurements showed a 0.1 eV increase, contrary to the results of the DFT calculations. This discrepancy was attributed to the influence of quantum confinement effects. The homogeneous substitution of S and the presence of quantum confinement were identified as the factors responsible for the unique electronic structure and enhanced photoreactivity of the doped polymer [203]. S doped nanosheets of two-dimensional g-C3N4 were synthesized by conducting a polycondensation reaction of thiourea followed by a thermal-oxidative treatment that enabled in situ S do**. The thermal oxidative etching process, and S do**, played a crucial role in producing the nanosheet structure, which had an average thickness of around 4.0 nm and increased exposure of S elements on the surface. Examination of the nanosheets using TEM revealed the presence of numerous small surface holes, whose quantity grew with longer etching times, effectively breaking down the layers into nanosheets. The specific surface area, determined through BET analysis, showed a substantial 13-fold increase compared to the bulk material, accompanied by a pore size distribution ranging from 2 to 10 nm. The absorption band edge of the nanosheets exhibited a blue shift from 470 to 420 nm, indicating an increment in the bandgap energy from 2.3 to 2.7 eV. This shift was attributed to the quantum confinement effects resulting from the thermal etching treatment. XPS analysis of the S 2p region peaked at 163.7 eV, indicating successful in situ S do** forming S-C bonds. Moreover, the VB energy increased from 2.2 to 2.3 eV upon S do**. Under irradiation, the nanosheets demonstrated increased transient photocurrents, which returned to zero in the dark. The doped nanosheets exhibited higher photocurrent intensity, suggesting enhanced efficiency in charge carrier separation. First-principles quantum computational studies revealed that S do** shifted the CB edge to more negative potentials than the bulk material, indicating the presence of N defects. Interestingly, S do** slightly shifted the CB edge to a positive potential, similar to the shifts observed in O doped models. These shifts were attributed to the generation of do** levels within the material. Computational calculations further indicated that the most probable surface structures involved the substitution of N with S or O, as they exhibited the lowest formation energy [204].

Fluorination of the polymer was achieved by using ammonium fluoride, which had two effects: it created an open-textured structure and allowed for the adjustment of electronic band gaps. When exposed to light, the fluorinated material exhibited excellent photocatalytic activity. EA confirmed that the C-to-N ratio closely matched the ideal value for g-C3N4 (theoretical C/N ratio of 0.75). XPS analysis detected a peak at 686.2 eV, indicating the presence of C-F bonds. The do** level of F was determined to be 3 atomic%, and solid-state MAS NMR spectroscopy of F (19F) revealed four distinct signals ranging from -60 to -220 ppm, corresponding to different positions within the polymer structure. Incorporating F reduced the band gap from 2.7 eV (for g-C3N4) to 2.6 eV. DFT calculations showed that fluorination played a key role in adjusting the positions of the HOMO and LUMO. The do** process caused both the LUMO and HOMO energy levels to shift upwards. This electronic structure modification through do** significantly impacted the redox properties, thereby enhancing the photocatalytic performance [205]. The co-pyrolysis of melamine and ammonium chloride was employed to demonstrate the incorporation of chlorine (Cl) into g-C3N4. By adjusting the dopant ratio, Cl intercalation was achieved, and XPS analysis of the Cl 2p peak yielded two distinct peaks at 200.4 and 199.1 eV, corresponding to Cl 2p1/2 and Cl 2p3/2, respectively, indicating the successful introduction of Cl atoms into the polymer structure. DFT calculations were utilized to investigate the effects of Cl do** on the polymer and revealed that Cl atoms formed covalent bonds and occupied the interlayers of the polymer, acting as bridges between the layers. This bridged Cl configuration was found to facilitate charge transfer processes and lead to an expansion of the lattice parameters. Furthermore, Cl do** resulted in a narrowing of the band gap, an elevation of both the CB and VB positions, and a potential increase in the polymer's conductivity. The introduction of Cl atoms into the interlayer structure of g-C3N4 resulted a homogeneous porous structure. This led to several advantages, including enhanced charge migration, a higher CB level, a reduced band gap, and an increased surface area. As a result, the Cl doped polymer exhibited excellent photocatalytic performance [206]. Bromine (Br) was used to modify g-C3N4 by mixing urea with different amounts of NH4Br in deionized water at 80 °C. The resulting mixture was sintered in air at 550 °C for 2 h. Raman spectroscopy revealed characteristic shifts in the sample's spectrum, specifically in the 500–1300 cm−1, attributed to heptazine units. These shifts indicated the presence of in-plane bending vibrations of the heptazine linkages (observed at 709 and 762 cm−1) and the symmetric N-breathing mode of heptazine units (observed at 978 cm−1). The absence of peaks in the 2000–2500 cm−1 region indicated the absence of certain linking groups. Solid-state 13C NMR analysis showed two distinct peaks in the spectra of both samples. The stronger peak at 167.4 ppm corresponded to sp2 hybridized C in the form of N–C-N, while the smaller peak at 158.8 ppm was associated with C atoms like CN3 in the melem structure. No new peaks were observed, suggesting the stability of the heptazine g-C3N4 after Br do**. XPS confirmed the presence of Br species with a single peak at 67.8 eV. The introduction of Br into the polymer system resulted in a notable decrease in EIS, indicating improved interfacial charge transfer and migration. Additionally, the doped polymer exhibited higher photocurrent density due to the reduced resistance of the modified material. These findings demonstrate the potential advantages of non-metal elemental do** in modifying the properties of the polymer system [207]. A polymer doped with iodine (I) was synthesized by grinding a mixture of I and bulk material using a planetary ball mill operating at 25 Hz for 50 h. XPS analysis revealed two distinct peaks at 619.3 and 619.9 eV, indicating the presence of C–I and C–I+–C coordination, respectively. The introduction of I caused a noticeable change in the color of the polymer, transitioning it from yellow to a deep brown shade. This color transformation can be attributed to increase delocalization of p-electrons, leading to a shift in the CB value from -1.2 to -1.3 eV [208]. DFT simulations examined the electronic and optical properties of a monolayer g-C3N4 doped with halogens (F, Cl, Br, or I). The researchers discovered that the most stable configuration occurred when the halogen atoms occupied the interstitial space between three tri-s-triazine units within the monolayer. The introduction of halogen atoms led to changes in the DOS and the redistribution of the HOMO and LUMO. Specifically, the highly electronegative F atom tended to occupy the VB and HOMO, while the Cl, Br, and I atoms were involved in the CB and LUMO. The study concluded that do** the monolayer with halogens reduced band gap enhanced light absorption, and decreased work function, which are beneficial for achieving highly efficient photocatalytic activity [209].

4.2 Bi-non-metal do**

Simultaneously incorporating two or more non-metal heteroatoms as dopants in a polymer can lead to significant synergistic effects in catalytic processes [210, 211]. Combining the strengths of multiple dopants make it becomes possible to address various inherent limitations simultaneously, resulting in improved catalytic performance. In some cases, one dopant may modify the material's band structure. At the same time, the other facilitates the incorporation of the active dopant into the host crystal lattice or helps balance charges during aliovalent do** [212,213,214,215]. In other cases, both dopants may work together to finely adjust the semiconductor's band structure cooperatively. When considering substitutional dopants with lower Mulliken electronegativity than C and N (such as B, S, and P), they tend to raise the conduction band minimum (CBM). Conversely, dopants with higher Mulliken electronegativity (such as O, F, and Cl) tend to lower the CBM. Additionally, dopants with more valence electrons than C and N (such as O, S, P, and Cl) tend to create electron-donor states near the CBM. In comparision, those with fewer valence electrons tend to generate electron acceptor states near the VBM [216,217,218,219,220,221,222,223,224]. Overall, co-do** a polymer with multiple non-metal elements has been shown to enhance the catalytic capabilities of the material, leveraging the benefits of single-element do**.

g-C3N4 was modified through co-do** with B and S using a thermal co-polymerization method involving melamine, boric acid, and thiourea (Fig. 9a) [225]. XPS analysis revealed distinct peaks in the S 2p spectrum, indicating the presence of various forms of oxidized S. The peak at 162.9 eV indicated the formation of a C-S bond within the aromatic ring. In comparision, peaks at 166.9 and 168.0 eV corresponded to sulfone and sulfate forms of oxidized S (Fig. 9b). The B 1 s peak at 190.5 eV suggested that B replaced C in the aromatic ring, forming a B-N bond. The co-do** of B and S occurred within the lattice of the material. One notable outcome of the co-do** process was the improved ability of the photocatalyst to absorb visible light compared to the undoped material. This enhancement was attributed to a reduced band gap, as evidenced by a shift towards longer wavelengths. The band gap of the co-doped material decreased from 2.7 to 2.5 eV. Additionally, the co-doped photocatalyst exhibited significantly increased current in both cathodic and anodic directions, with an 11- and 8.5-fold increase, respectively, compared to the bulk material. This enhancement in electrochemical performance indicated the positive influence of co-do** on the photocatalytic activity of the material (Fig. 9c). Theoretical investigations using DFT calculations provided insights into the electronic structure changes induced by non-metal do**. In its pure form, g-C3N4 had specific HOMO and LUMO positions. Do** with B resulted in a widened band gap and downward shifts in the HOMO and LUMO positions. Conversely, the introduction of S into the structure led to a shortened band gap and shifts in the HOMO and LUMO positions, reflecting the electron-donating nature of S (Fig. 9d). Simultaneous co-do** with B and S allowed for precise tuning of the HOMO and LUMO positions, taking advantage of the electron-withdrawing and electron-donating properties of the respective dopants. As a result, the HOMO and LUMO positions were adjusted to -5.8 and -1.8 eV, respectively [225]. A new porous nanobelt structure with hierarchical features was successfully synthesized and characterized. This unique material was created using a self-assembly method without templates. The precursor, dicyandiamide, and the dopant source, glutathione, were employed to introduce C and O atoms into the g-C3N4 structure. The resulting co-doped material exhibited a well-defined nanobelt architecture composed of porous nanosheets, significantly increasing its specific surface area to 120 m2 g−1. The material’s bandgap was narrowed by substituting N atoms with C and O heteroatoms allowing, it to harness visible light efficiently. Additionally, the position of the CB shifted downwards, enhancing the material's ability to reduce electrons for H2 production. DFT calculations were employed to determine the precise locations of C and O do** to gain deeper insights. Two potential substitution sites for N atoms, named site 1 and site 2, were carefully examined. The formation energy values were computed for substituting C and O atoms at these specific sites. Notably, substituting an O atom for the N atom at site 1 and a C atom for the N atom at site 2 exhibited significantly lower formation energy values of 0.5 eV and 0.2 eV, respectively. These findings indicate that these specific do** sites are more energetically favorable. By identifying the optimal locations for C and O do**, researchers can finely tune the material's properties to enhance its performance in various applications, including photocatalysis and H2 production [226]. A novel C and O co-doped g-C3N4 material was synthesized using a mechanical mixing technique followed by calcination of hexamethylolmelamine and melamine (Fig. 10a). The characterization analysis confirmed the successful incorporation of C and O into the g-C3N4 structure. The resulting catalyst exhibited two distinct regions with different functions. The C-containing part acted as an electron acceptor, while the O-containing part acted as an electron donor. This donor–acceptor system provided an additional pathway for electron transfer, leading to an expanded optical absorption range and a narrower bandgap of g-C3N4, reducing it from 2.7 to 2.0 eV. Moreover, the donor–acceptor systems enhanced the delocalization ability of photoinduced charge carriers, resulting in prolonged carrier lifetime and reduced electron–hole recombination rates. The improved delocalization of charge carriers can be attributed to efficient electron transfer between the O-containing and C-containing regions of the catalyst. Electrons from the O-containing section readily transferred to the C-containing section, which served as an electron acceptor, establishing an effective electron transfer pathway. This process significantly extended the lifetime of charge carriers and minimized electron–hole recombination. DFT calculations were employed to investigate the mechanism of intramolecular photo-induced electron transfer. Due to the complexity of the catalyst's structure, three representative fragments (F1, F2, F3) were selected for the calculations based on their structural models. The results revealed that the O-containing fragments acted as electron donors, while the C-containing fragments acted as electron acceptors. The cyclic structure of the heterocycle with an O atom exhibited stronger electron donor properties than that of an O atom outside its cyclic structure. Analysis of the spatial separation between the HOMO and LUMO in fragments F1 and F3 demonstrated an efficient mechanism for charge separation (Fig. 10b). In contrast, the incomplete separation in fragment F2 indicated limited charge separation efficiency. The spatial separation of HOMO and LUMO facilitated the separation of charge carriers through the HOMO–LUMO transition, making fragments F1 and F3 ideal for photocatalytic reactions [227]. A new type of g-C3N4 material called P and F co-doped g-C3N4 was synthesized using a sol–gel-mediated thermal condensation process (Fig. 10c). To confirm the chemical structure of the synthesized material, solid-state MAS NMR analysis was conducted. Various MAS and CPMAS NMR spectra, including 13C, 15N, 31P, 19F, and 1H, were obtained for the co-doped material. The 13C CPMAS NMR spectrum revealed the presence of four distinct C peaks, indicating the existence of four different C types in the material. Specifically, two characteristic peaks corresponding to C atoms in g-C3N4 (C3 and C4) were observed at chemical shifts of 160.0 and 168.1 ppm, respectively (Fig. 10d). The synthesized polymer exhibited a well-defined mesoporous nanostructure, which contributed to its improved light absorption properties in the visible and infrared regions. The unique sol–gel synthesis process resulted in a higher BET surface area of 260.93 m2/g, indicating an increased active surface area and potential for high catalytic activity [228].

Fig. 9
figure 9

a A successful synthesis of B and S co-doped g-C3N4 was achieved in a single-step reaction. The procedure involved dissolving melamine, thiourea, and boric acid in water. The solution was then evaporated at 80 °C overnight, forming a white crystalline compound. Subsequently, the compound was subjected to calcination at a temperature of 550 °C for 3 h, b S 2p XPS spectra oxidized sulfur in the form of sulfone and sulfate. c plausible mechanism to explain the photocatalytic reduction of H+ to H2 on the surface of a co-doped catalyst. When exposed to visible light, it undergoes electron–hole pair generation, and the photoinduced electrons in the CB are captured by defects created by introducing of heteroatoms into the carbon nitride lattice. These captured electrons then react with H+ to produce H2 gas with the assistance of Pt nanoparticles. d Atomic orbital compositions of the frontier molecular orbitals and optimized geometries of bulk, S doped, B doped, and B and S co-doped g-C3N4. Reproduced with permission from ref. 225. Copyright (2018) American Chemical Society

Fig. 10
figure 10

a 37% aqueous formaldehyde solution and melamine were refluxed in a basic medium to have a clear solution, followed by cooling to room temperature, and a white solid was obtained. The solid and melamine were mixed, and the resulting mixture was subjected to thermal polymerization to obtain C, O co-doped g-C3N4, b DFT optimized fragments (F1, F2, F3) of C, O co-doped g-C3N4 showing O-containing fragments acted as electron donors. In contrast, the C-containing fragments acted as electron acceptors. Reproduced with permission from ref. 227. Copyright (2020) Elsevier B.V. c P, F co-doped g-C3N4 was synthesized by conducting a thermal condensation process using dicyandiamide, [Bmim][PF6], CTAB), and TEOS, during the sol–gel process, TEOS polymerized around CTAB upon thermal treatment. This silica matrix prevented the structural pores’s and trapped PF6 species, enabling their reaction with amino groups of uncondensed carbon nitride precursor. As a result, the PF6 species, became incorporated into the g-C3N4 framework. Subsequent removal of the silica template by washing with ammonium fluoride solution produced silica-free P, F co-doped materials. d Solid-state NMR spectra of the material. Reproduced with permission from ref. 228. Copyright (2020) Wiley–VCH GmbH

4.3 Vacancy creation

The controlled generation of vacancies is crucial for harnessing solar energy directly, as it enhances the interaction between defects and photoactivity in photocatalysts. Introducing vacancies, such as C and N, has been shown through theoretical and experimental studies to effectively narrow the bandgap and facilitate the separation of electron–hole pairs. Unlike heteroatom do**, the introduction of vacancies does not introduce impurities into the structure of g-C3N4. By removing graphitic C atoms, the in-plane conjugation system of g-C3N4 is weakened, leading to significant changes in its physicochemical properties. This alteration disrupts the symmetry of g-C3N4, creating electron delocalization effects and defect states that improve the transfer and migration efficiency of photogenerated electrons and carriers. An important benefit of introducing C vacancies is the generation of unsaturated N atoms, which promote catalytic reactions. One effective approach to achieve this is through the thermal treatment of bulk material in an NH3 atmosphere, resulting in holey graphene-like C3N4 nanosheets with abundant in-plane holes. This process increases the exposure of active edges and facilitates cross-plane diffusion channels, leading to accelerated mass and photogenerated charge transfer and reduced aggregation. The resulting polymer exhibits a significantly higher specific surface area of 196 m2/g and an increased bandgap of 2.9 eV. Analysis of the C 1 s spectrum reveals distinct peaks corresponding to C = C and N = C-N bonds, with a higher ratio of N = C-N to C = C peak areas, indicating the removal of graphitic C species through NH3 etching. This reduction in graphitic C content suppresses charge recombination, and the presence of C vacancies enhances the electrical conductivity and mobility of photogenerated charge carriers. XPS analysis shows a significantly lower C/N molar ratio, indicating the ratio modification by C vacancies. This modification extends the light absorption range into the near-infrared region, increases the donor density, and significantly prolongs the lifetime of charge carriers [229]. Researchers have developed a new type of g-C3N4 by intentionally creating vacancies in C atoms through heat treatment in an NH3 atmosphere. These vacancies have significantly improved the performance of the modified polymer, and a detailed analysis has uncovered several factors contributing to this enhancement. High-resolution analysis of the C 1 s spectra revealed two distinct peaks, one corresponding to adventitious C species and the other indicating the presence of sp2 C bonded with N in the aromatic triazine heterocycles. Importantly, the modified sample showed higher binding energy for the latter peak, suggesting a decrease in electron density around the C atoms in the heptazine rings due to the absence of covalently bonded C atoms. Electron spin resonance (ESR) spectroscopy demonstrated a strong ESR signal for the unmodified sample compared to the modified one, which is believed to be caused by local stress and bond-angle disorder in the connectivity structure, with unpaired electrons associated with C atom sites. The introduction of C vacancies has significantly enhanced the polymer's ability to adsorb and activate CO2. Moreover, it has led to an upward shift in the CB, increased charge carrier concentration, and extended lifetime, all of which contribute to improved photocatalytic activity. The study also revealed that C vacancies can mitigate the exciton effect and promote charge carrier generation. This research opens up new possibilities for modifying the exciton effect and charge carrier concentration in the polymer, potentially facilitating the separation of photoinduced electron–hole pairs and enabling charge carrier-involved photocatalytic reactions [230]. The scientists successfully produced and characterized C vacancies in g-C3N4 through calcination in an atmosphere containing H2 gas. This modified form of g-C3N4 exhibits a larger specific surface area and increased active sites due to numerous C vacancies. The material analysis revealed a shift in the position of the N = C = N peak to a higher binding energy, indicating a slight alteration in the arrangement of C atoms. Additionally, the ratio of peak areas corresponding to N = C = N showed changes, indicating the existence of C vacancies resulting from H2 etching. ESR spectroscopy results demonstrated a clear Lorentz line at g = 2.003 for the modified polymers, displaying the strongest response signal. Furthermore, the photocurrent density of the modified material was more than four times greater than that of the bulk material. The C vacancies caused a reduction in electron density around N atoms, narrowing the bandgap and enhancing the material's ability to respond to light. The abundant pore structure and C vacancies facilitated efficient separation and transfer of photo-excited electron–hole pairs, thereby significantly improving the material's photocatalytic efficiency [231].

In contrast, the structure of g-C3N4 remains unchanged when N vacancies are introduced. The study identified the terminal -NHx positions as the most likely locations for creating vacancies among four possible positions (C-N = C, N-(C)3, bridging N, and -NHx). N vacancies generate defect energy levels that can accept electrons and inhibit the recombination of electron–hole pairs, making them valuable as active or adsorption sites. The excess electrons within the N vacancies can react with O2 to produce superoxide radicals or form bonds with metals to create sites for electron absorption. Researchers have employed different techniques, such as N2 or H2 gas calcination, to produce g-C3N4 materials with N defects and achieve high efficiency in photocatalysis. Scientists have developed g-C3N4 nanosheets with controllable N vacancies by subjecting bulk g-C3N4 to an H2 atmosphere at temperatures ranging from 475 to 550 °C for one hour. By analyzing the elemental composition, they observed an increase in the C/N ratio as the heat treatment temperature rose, indicating the formation of N vacancies. XPS analysis confirmed the presence of these vacancies and identified four main components in the N 1 s spectrum. The ratio between specific peak areas decreased with increasing temperature, suggesting the removal of N atoms from certain lattice sites during the thermal reduction process. EPR spectroscopy revealed the presence of unpaired electrons associated with specific C atoms in the material. Both empirical observation and theoretical calculations demonstrated that N vacancies induced midgap states below the CB edge, with deeper states occurring as vacancies increased. The improved photocatalytic activity of the material was attributed to various factors, including enhanced visible light absorption, efficient trap** of photogenerated electrons, and the uniform anchoring of small Pt NPs. However, an excessive induction of N vacancies resulted in deeper midgap states acting as recombination centers, leading to decreased photocatalytic activity [232]. A straightforward and efficient method has been developed to create N-deficient g-C3N4 using alkali-assisted thermal polymerization of urea, melamine, or thiourea. The introduction of N vacancies has a significant impact on the optical properties of the material, causing a shift in the absorption edge towards the red region of the spectrum. The concentration of defects can be controlled by adjusting alkali to N precursor ratio. Under visible light, the N-deficient samples exhibit superior photocatalytic performance compared to the pristine samples. Solid-state 13C MAS NMR measurements confirm the presence of newly-formed cyano groups, with distinct peaks observed in the spectra. The introduction of N defects does not significantly affect the VB position, but it does lead to a decrease in the CB position, resulting in a narrower bandgap. DFT calculations further support these findings by demonstrating a decrease in the bandgap energy when cyano groups and N vacancies are present. The narrowing of the bandgap can be attributed to the coexistence of cyano groups and N vacancies in the material [233]. A novel technique was developed to create porous g-C3N4 materials with many defects. This was achieved through a short thermal treatment in an air environment without additional reactants. The resulting materials demonstrated an enhanced ability to absorb light in the visible spectrum. The red-shifted absorption edge was attributed to the presence of cyano groups, while the appearance of a new absorption edge was linked to N vacancies. Theoretical calculations of the dielectric function and previous research findings supported these observations. It was proposed that including cyano groups and N vacancies within the structure of g-C3N4 led to a reduction in the bandgap and the introduction of energy levels associated with defects, resulting in an expanded range of light absorption [234]. A groundbreaking method was developed to produce defect-modified, thin-layered, and porous g-C3N4 materials using urea- and KOH-assisted thermal polymerization. This technique simultaneously introduces cyano groups, N vacancies, and mesopores into the g-C3N4 structure while reducing its thickness. By adjusting the mass ratio of urea, KOH, and melamine, the thickness, pore characteristics, and defects can be finely tuned, resulting in a significant increase in specific surface area, light absorption capacity, and the efficiency of separating photoexcited charge carriers. These advancements greatly enhance mass transfer within the g-C3N4 material. Solid-state and 13C CPMAS NMR measurements were conducted to analyze the samples. The spectra showed distinctive features, with prominent peaks at 156.3 and 164.5 ppm representing the chemical shifts of C3N atoms and C2N–NHx atoms in heptazine. The peak intensity at 156.3 ppm decreased with higher KOH usage, resulting in a reduced intensity ratio of C3N to C2N–NHx from 0.29 to 0.14. New peaks at 123.3 and 171.4 ppm were also observed, corresponding to the C atoms in cyano groups and neighboring C atoms, respectively. These findings suggest that the introduced cyano groups are likely located at the apex of the melon structure, leading to partial fracturing and restructuring of N = C–N2 units and a decreased concentration of C3N atoms. Orbital analyses of both pristine and modified samples were conducted, revealing significant differences. In the pristine sample, the charge density of the LUMO and the HOMO was uniformly distributed over the heptazine rings. In contrast, the modified sample showed redistributed charge density, resulting in the emergence of electron-rich regions and well-separated distributions corresponding to LUMO and HOMO. These changes can be attributed to the increased local fluctuations of the electrostatic potential caused by the introduced N defects. The distinct and localized charge density distribution facilitates efficient separation and transfer of photoexcited charge carriers, minimizing back reactions and significantly enhancing the photocatalytic activity [235]. The physical, chemical, and optoelectronic properties of g-C3N4 can be finely tuned through thermal treatment, which introduces N vacancies and defects/holes in the nanosheets, increasing porosity. These modifications significantly impact the material's optoelectronic characteristics, including the appearance of n → π* transitions, a redshift in light absorption, enhanced charge separation, and reduced charge recombination. Trap states near the VB further contribute to improved charge separation. Analyzing the C and N core levels provides valuable insights into the material's composition. The C core level exhibits three peaks, with the main peak attributed to sp2 hybridized C in the tri-s-triazine rings, while the weaker peaks at 285.7 and 288.7 eV originate from surface oxidation of the C film. The N core level can be deconvoluted into three peaks representing sp2 hybridized aromatic N atoms in C–N = C bonds, sp3 hybridized N atoms in N-(C)3 groups, and terminal amino groups (C–NH2 or = NH), respectively. Analysis of the N content reveals an increased atomic ratio of C/N from 0.73 to 0.76, indicating a relative enrichment of C in the samples due to the presence of N vacancies in the g-C3N4 structure [236]. Controlling the morphology and surface vacancies of g-C3N4 is crucial for enhancing the efficiency of photocatalytic systems. A groundbreaking study demonstrated the positive impact of N vacancies in the atomic layers of g-C3N4 on the photoreduction of CO2. The researchers achieved a unique 3D bubbly structure of g-C3N4 nanosheets, which disrupted the interactions between adjacent layers and facilitated charge transport. They used an NH4Cl gas template that decomposed upon heating, resulting in a bubble film on the nanosheet surface. The researchers could tune the N vacancies by intentionally introducing N defects into the ultrathin nanosheets under a reducing atmosphere. This N vacancy tuning significantly affected the optoelectronic properties of the nanosheets. It increased the reducing ability of the nanosheets, extended their light absorption range to longer-wavelength visible light, and prolonged the radiative recombination of electron–hole pairs. These improvements were attributed to midgap states, which efficiently trapped electrons and acted as reservoirs [237].

4.4 Plasmonic metal loading

When metal NPs are placed on the surface of a semiconductor, there is a difference in their work functions that creates a contact potential difference known as the Schottky barrier [238, 239]. This leads to bending of the energy bands at the interface once equilibrium is reached. The band bending extent depends on the metal and semiconductor's relative work function energies. This phenomenon promotes the directional movement of photo-generated electrons from the semiconductor to the metal, significantly improving the separation of charges. As a result, the system effectively traps electrons, reducing recombination between electron–hole pairs [240,241,242]. The combination of plasmonic [243,Full size image

g-C3N4 nanosheet panels decorated with Au NPs oriented with (111) facets were synthesized using a two-step method involving vapor-deposition polymerization and immersion (Fig. 11d). Characterization using TEM and AFM revealed that the film consisted of g-C3N4 nanoplatelets with a thickness of 12 nm and equally distributed Au NPs with a diameter of approximately 2 nm (Fig. 11e). The resulting photocatalyst exhibited enhanced absorption of visible light due to the surface plasmon resonance effect of the Au NPs. This, along with efficient transportation and separation of charge carriers (Fig. 11f) and well-aligned VB levels, enabled effective overall water splitting [268] without the need for sacrificial agents. The photocatalyst demonstrated stoichiometric evolution of H2 and O2, distinguishing it from the half-reaction observed when using Pt-decorated g-C3N4. Amine-functionalized g-C3N4 was treated with N2 plasma and impregnated with HAuCl4.3H2O to create Au NPs. These NPs were then deposited onto g-C3N4 nanosheets. Notably, g-C3N4/Au exhibited enhanced photocatalytic activity for reducing CO2 under visible light without additional cocatalysts or sacrificial agents. The rates of CO and CH4 evolution achieved by g-C3N4/Au were significantly higher compared to pristine g-C3N4, with values of 28.3 and 1.3 μmol h−1 g−1 respectively, and these rates were 7.6 and 2.6 times higher than bulk [269]. The improved performance of g-C3N4/Au can be attributed to several factors. Firstly, introducing amine groups enhanced the adsorption capacity of g-C3N4/Au for CO2. Secondly, small-sized Au NPs (Fig. 12a) generated hot electrons that activated surrounding electrons through energy transfer, resulting in increased local temperature and improved efficiency in the CO2 reduction reaction. Finally, forming a Schottky junction between Au and g-C3N4 facilitated electron migration from g-C3N4 to Au NPs (Fig. 12b), effectively reducing carrier recombination. The catalytic activity of metal–semiconductor heterojunctions in CO2 conversion relies on precisely tuning the Schottky barrier. Researchers successfully demonstrated the utilization of plasmonic Ag NPs on N-vacancy modified g-C3N4 nanotubes through a simple self-assembly method (Fig. 12c), enabling efficient visible-light photocatalytic CO2 conversion. The figures revealed that highly dispersed small Ag NPs, ranging from 6 to 8 nm, were uniformly loaded onto the surfaces of nanotubes (Fig. 12d). This indicated that the one-dimensional g-C3N4 nanotubes, enriched with reductive active sites, greatly improved CO2 transmission/adsorption, captured photo-generated electrons, and established a desirable Schottky heterojunction for effective separation and migration of charge carriers. The homogeneous distribution of Ag NPs and the directed spatial arrangement within the 1D tubular g-C3N4 structure significantly enhanced the utilization efficiency of plasmonic metals. The nanocatalyst exhibited an impressive CO evolution rate of 88.2 μmol g−1 h−1 under visible light. The optimized Schottky barrier height not only facilitated charge kinetics through the driving force from the Schottky junction but also prevented the trapped photoelectrons from flowing back to g-C3N4 under visible light. This effectively suppressed the recombination of photoinduced charge carriers, resulting in highly efficient CO2 photoreduction. The favorable spatial distribution and precisely tuned Schottky barrier in the nanotube heterojunction contributed to its superior photocatalytic performance [270].

Fig. 12
figure 12

a TEM and HRTEM images of g-C3N4/Au. b The proposed mechanism for the photocatalytic reduction of CO2 by g-C3N4/Au involves the synergistic effects of introduced amino groups, activation of hot electrons, and formation of a Schottky junction. These factors work together to enhance the photocatalytic activity of g-C3N4/Au, enabling the efficient conversion of CO2 into valuable products. Reproduced with permission from ref. 269. Copyright (2020) Elsevier Inc. c The self-assembly of melamine and cyanuric acid, resulting in the formation of well-defined 1D pillar supramolecular precursors, which can connect to through hydrogen bonding within the layers and grow vertically in adjacent interlayers through π-π interactions, subsequently, Ag(I) ions are introduced into the supramolecular precursors using AgNO3. During the thermal polycondensation process, the combined effects of high temperature and gas release promote the exfoliation of the supramolecular pillars into ultra-thin layers. Each 1D hexagonal pillar contains tightly packed nanosheet-like frameworks within its interior, and to minimize surface energy, the exfoliated nanosheets gradually curl up and transform into g-C3N4 nanotubes. d TEM image of g-C3N4 nanotube with well-distributed Ag NPs. Reproduced with permission from ref. 270. Copyright (2022) Elsevier B.V.

5 Photocatalytic application

This section focuses on the progress of photochemical processes involving photocatalysis, specifically the splitting of water to produce H2 and O2, as well as the reduction of CO2 to hydrocarbon fuels. It is important to note that these applications have been extensively explored and discussed in various review articles. However, the goal is to provide readers with a concise yet comprehensive overview of the potential benefits of doped g-C3N4-based photocatalysts in these applications. A collection of examples based on recent research findings is presented without favoring any specific research group.

5.1 Water splitting reaction

Using a photocatalyst and solar energy to produce H2 gas from water is a promising avenue in the quest for renewable energy sources, offering a viable alternative to traditional fossil fuels. H2 is renowned for its exceptional energy density, surpassing standard hydrocarbon fuels such as gasoline and diesel. Recent advancements in doped nanomaterials based on g-C3N4 have led to highly efficient photocatalytic water-splitting processes (Table 1). These processes involve the converting light energy into H2 and O2 gases, with photogenerated electron–hole pairs migrating to active sites on the surface of the g-C3N4 photocatalyst. At these sites, they facilitate the reduction and oxidation reactions of water molecules, resulting in the generation of gaseous H2 and O2 without recombination, as depicted by Eqs. 13.

Table 1 Summary of non-metal doped g-C3N4 for water splitting reaction
$${H}_{2}O +2{h}^{+} \to 2{H}^{+} + \frac{1}{2}{O}_{2}$$
(1)
$$2{H}^{+} +2{e}^{-}\to {H}_{2}$$
(2)
$${H}_{2}O\to {H}_{2}+ \frac{1}{2}{O}_{2}$$
(3)

Researchers led by Wang conducted a study where they synthesized g-C3N4 by subjecting cyanamide to high temperatures for 4 h. They then utilized this material in the photocatalytic water, splitting it into H2 and O2 using visible light. However, the original g-C3N4 showed inconsistent rates of H2 evolution, ranging from 0.1–4 μmolh−1, with significant variation between different batches. To address this issue, they modified the g-C3N4 by adding 3wt% Pt, resulting in a remarkable increase in H2 production. After 72 h, they could generate 770 μmol of H2, surpassing the amounts produced by both C6N8 units and Pt NPs. For the production of O2, they introduced RuO2, a common cocatalyst for O2 generation, along with AgNO3 as a sacrificial electron acceptor. Under ultraviolet illumination for 8 h, they achieved a total O2 evolution of 53 μmol. In their quest to enhance photocatalytic performance, the researchers explored rational design strategies as a promising alternative. They focused on engineering O doped g-C3N4 nanotubes, which exhibited an impressive H2 evolution rate of 73.84 μmolh−1. This surpassed the performance of previously reported one-dimensional g-C3N4 photocatalysts. The exceptional performance of the nanotubes was attributed to the deliberate incorporation of O, which improved the band structure of g-C3N4. This resulted in a reduced recombination rate of photogenerated carriers and a narrower band gap. Moreover, the unique hollow nanotube structure of the O-doped g-C3N4 facilitated multiple diffuse reflections, thereby enhancing the utilization of visible light and further enhancing the efficiency of the photocatalytic water-splitting process [277]. Phosphorization of g-C3N4 resulted in an improved ability to generate H2 through photocatalysis. This enhancement can be attributed to several factors, such as a narrower bandgap, a higher CB edge, better separation and transfer of photogenerated charges, and a highly hydrophilic surface that promotes the absorption of reactant molecules during the photocatalytic process. Notably, the modified catalyst exhibited an H2 production rate twice as high as the pristine g-C3N4, reaching 916.2 μmolg−1 h−1, with an apparent quantum yield (AQY) of 6.52% at 420 nm. Additionally, the modified catalyst achieved an AQY of 1.48% at 500 nm and 0.7% at 520 nm, indicating that the expanded light absorption beyond 500 nm contributed to its significantly increased H2 production rate [317]. The researchers investigated the photocatalytic H2 production capability of S doped holey g-C3N4 nanosheets under visible light. The nanosheets demonstrated impressive activity, with an H2 evolution rate of 6225.4 μmolg−1 h−1 and an AQY of 10% at 420 nm. Through extensive characterization and theoretical calculations, it was determined that the outstanding performance of the nanosheets can be attributed to their distinct properties. These properties include an increased surface area, a downward shift of the CB, and a reduced bandgap resulting from S do** and the unique ultra-thin two-dimensional structure of the nanosheets. These factors synergistically contribute to the enhanced photocatalytic performance of the material [317]. Utilizing a Schiff-base reaction that involves substituting an N atom with a C atom, the bandgap of g-C3N4 was effectively reduced from 2.7 to 2.6 eV. This narrowing of the bandgap facilitated a more efficient dissociation of photogenerated excitons. The resulting C self-doped g-C3N4 exhibited remarkable rates of photocatalytic H2 evolution, surpassing those of pure g-C3N4 when exposed to both blue and visible light. The optimized sample demonstrated excellent performance with H2 evolution rates of 94.0 and 28.4 μmolg−1 h−1, even under green and yellow light illumination, respectively. These findings highlight the versatility of this approach in enhancing the photocatalytic performance of g-C3N4 [275]. In a recent study, researchers evaluated the effectiveness of ultrathin g-C3N4 doped with N and O for photocatalytic H2 production. They used a Pt co-catalyst and observed a significantly higher H2 evolution rate than previous studies on 2D g-C3N4 nanostructures (Fig. 13a). Increasing the Pt loading (Fig. 13b) further enhanced the H2 production. The study confirmed that the photocatalytic activity was driven by photogenerated electrons, with an AQY of 16.2% under irradiation at 405 ± 10 nm. The researchers also noted the high stability of the photocatalyst under the experimental conditions. They observed consistent and reproducible high activity without any noticeable decrease in the H2 production rate after multiple cycles within 18-h period. Characterization techniques were employed to analyze the distribution of Pt, revealing its presence in clustered form. Additionally, the study investigated the influence of irradiation wavelength on the photocatalytic H2 production activity. The observed variations in activity aligned with the shape of the UV–visible absorption spectrum [293]. The research investigated the photocatalytic H2 evolution capabilities of a nanomesh composed of B and O co-doped g-C3N4 under visible light exposure, utilizing a sacrificial agent, Triethanolamine (TEOA), and Pt cocatalyst. The results revealed that the O doped g-C3N4 nanomesh exhibited an H2 evolution rate approximately 12.7 times higher (345 μmolh−1 g−1) than that of bulk g-C3N4, thanks to its porous nanostructure and O do**. Interestingly, the B and O co-doped g-C3N4 nanomesh demonstrated even higher H2 evolution rates (9751 μmolh−1 g−1) than the O doped version, indicating a significant enhancement in photocatalytic performance due to B do**. The stability of the B and O co-doped g-C3N4 nanomesh was also assessed and confirmed through XRD and SEM analysis, demonstrating its structural integrity during the photocatalytic H2 production process [290]. In a separate scientific investigation, introducing P and O into g-C3N4 significantly improved its photocatalytic performance. The doped material exhibited an H2 production rate of 1588 μmolh−1 g−1, which was approximately double the rate achieved by pristine g-C3N4 (Fig. 13c). Furthermore, the P and O co-doped g-C3N4 displayed excellent stability and the ability to be reused for up to 12 h without a noticeable decline in its photocatalytic activity. This suggests that the doped g-C3N4 has the potential to serve as an efficient and reliable photocatalyst for H2 generation [318]. Adding N defects to g-C3N4 has shown promise in boosting the photocatalytic performance of g-C3N4-based materials for H2 production. N defects can alter the material's electronic structure, creating active sites facilitating catalytic reactions. This modification enhances the material's ability to absorb visible light, essential for efficient H2 production through photocatalysis. Introducing N defects involved a controlled treatment of pure g-C3N4 with selenium vapor. The resulting N-defected g-C3N4 exhibited an average H2 generation rate of 1.16 mmolg−1 h−1 at room temperature (25 °C), which is 3.4 times higher than that of pristine g-C3N4. These findings highlight the significant improvement in photocatalytic activity achieved by incorporating N defects into g-C3N4 [319]. A novel and cost-effective method was used to prepare a 3D porous polymer with a high surface area and N defects without needing templates. This modified material, characterized by its nanocage-like structure, demonstrated enhanced photocatalytic performance compared to pristine g-C3N4. The N defects and nanocage-like structure synergistically contributed to a wider range of responsiveness to visible light, increased exposure of active sites, and improved separation of photogenerated carriers. As a result, the modified g-C3N4 exhibited remarkable performance in the H2 evolution reaction during water splitting under visible light, achieving a maximum H2 evolution rate of 92.6 μmolh−1. This rate was approximately 20.3 times higher than that of pristine g-C3N4, showcasing the significant improvement achieved by introducing of N defects [311]. A surface hydrotreating method was employed to address the issue of unreacted amino groups hindering the photocatalytic activity of bulk g-C3N4. By treating the bulk g-C3N4 with NaBH4 under an inert atmosphere, hydrogenated deficient g-C3N4 was produced. This process resulted in the complete reduction of unreacted amino groups (-NHx) and the formation of N vacancies and cyano groups (-C≡N groups) within the g-C3N4 structure. This elimination of -NHx groups effectively mitigated photo-induced carrier recombination, significantly improving photocatalytic H2 evolution. The H2 production rate achieved with the modified material reached 340.6 μmolh−1, 2.5 times higher than the bulk g-C3N4. Furthermore, the modified material exhibited an AQY value of 16.2% at 420 nm, indicating its enhanced ability to convert light energy into H2 [320]. A simple and efficient method involving the thermal polymerization of urea and KOH has been developed to create defect-modified thin-layered and porous g-C3N4. This process reduces the thickness of g-C3N4 and introduces cyano groups, N vacancies, and mesopores simultaneously. These modifications greatly enhance the photocatalytic efficiency of g-C3N4 for H2 evolution. When exposed to light with a wavelength greater than 420 nm, the defect-modified g-C3N4 demonstrated an H2 evolution rate of 1.5 mmolh–1 g–1, more than 48.5 times higher than that of pristine g-C3N4. Moreover, the defect-modified g-C3N4 exhibited an impressive average AQY of 18.5% at 500 nm, indicating its superior ability to convert light energy into H2 [235]. A simple three-step heat-treatment method is employed to create defective ultrathin mesoporous g-C3N4. This method brings the photogenerated carriers closer to the surface, enhancing the adsorption and diffusion of reactants and products while exposing more active surface sites. Additionally, the high-temperature hydrogenation process generates N-vacancy defects that improve light absorption, boost intrinsic carrier mobility, and increase the availability of active sites. Consequently, the photocatalyst demonstrates an impressive rate of photocatalytic H2 production, reaching up to 13.6 mmolh−1 g−1 under visible light in a TEOA solution, as well as achieving a rate of 33.5 μmolh−1 g−1 for overall water splitting [295]. A novel method has been developed to create thin polymeric g-C3N4 nanosheets with controlled surface C vacancies, greatly enhancing their ability to produce H2 through photocatalysis. These nanosheets have unique structures with improved surface properties, resulting in a higher number of active sites and a significantly increased rate of H2 evolution compared to bulk material. Furthermore, these nanosheets exhibit remarkable stability under repeated testing, showing no significant decrease in activity even after undergoing four cycles. At a wavelength of 405 nm, the nanosheets achieve an AQY of 11.3%, indicating their potential to improve the efficiency and stability of photocatalytic H2 production significantly [321]. A novel fibrous g-C3N4 material was developed using a unique method involving pyrolyzing functionalized 2,5-thiophenedicarboxylic acid and melamine precursors in a laminated covalent triazine framework. C vacancies were created by subjecting the material to a two-step calcination process in argon and air atmospheres, exposing the nanofibers’ edges and diffusion channels. This resulted in the formation of additional active sites and facilitated the transfer of photogenerated charges. The synthesized material exhibited remarkable stability and achieved a maximum H2 evolution rate of 102.6 μmol in 6 h under visible-light irradiation, surpassing the H2 production rate of the bulk material by 66 times. Furthermore, the fibrous g-C3N4 maintained its stability even after undergoing ten cycles of visible-light irradiation [322].

Fig. 13
figure 13

a Under visible light irradiation, the N, O co-doped g-C3N4 nanosheets demonstrated continuous and stable hydrogen production for 6 h during water splitting. The average rate of hydrogen evolution was significantly higher than that of previously reported 2D g-C3N4 nanostructures. b Different Pt loadings as a cocatalyst influence the hydrogen evolution process. Reproduced with permission from ref. 293. Copyright (2019) WILEY–VCH Verlag GmbH & Co. KGaA, Weinheim. c The rate of H2 evolution shows improvement as the mass fraction of ammonium polyphosphate increases from 0 to 10wt% during fabrication. However, if the ammonium polyphosphate content is further increased beyond this range, the H2 evolution rate decreases in the case of P, O co-doped g-C3N4. Photocatalytic reduction activity for CO2 conversion, formation of intermediate CO, and final product CH4 on P doped g-C3N4 exhibited a linear increase as the irradiation time progressed. Reproduced with permission from ref. 318. Copyright (2022) American Chemical Society. Yield of (d) CO and (e) CH4. Reproduced with permission from ref. 200. Copyright (2017) American Chemical Society. f CO evolution on the g-C3N4 and carbon vacancy modified g-C3N4 photocatalysts over 5 h. Reproduced with permission from ref. 230. Copyright (2019) The Royal Society of Chemistry

A thermal treatment method has been developed to enhance the photocatalytic activity of g-C3N4 for water oxidation by introducing B dopants and N defects simultaneously. This treatment modifies the material's band structure and electronic properties, significantly improving in the rate at which O2 is evolved. By adjusting the positions of the CB and VB, the material becomes more efficient in absorbing visible light and driving the water oxidation process. The optimized O2 evolution rate of the modified g-C3N4 is approximately six times higher than that of the pristine material, reaching 561.2 µmolh−1 g−1 compared to 98.6 µmolh−1 g−1 [182]. A nanostructured photocatalyst based on g-C3N4 was developed, incorporating P to enhance its performance; including P in the g-C3N4 framework increased surface area, leading to improved light absorption across a wide range of wavelengths. This modification enhanced the separation and migration of charges, and raised the photocatalyst’s specific surface area. As a result, the photocatalyst demonstrated impressive overall water splitting activity, achieving a high faradic efficiency of 95%. Without needing additional cocatalyst or sacrificial agent, the photocatalyst produced an H2 evolution rate of 27 μmolh–1 and an O2 evolution rate of 13 μmol h–1 [202].

5.2 Carbon dioxide reduction

With growing global concerns about climate change and the escalating levels of CO2, there is a pressing need to find efficient methods for utilizing solar energy to convert CO2 into valuable fuels and products. One way to enhance the photo-assisted selective conversion of CO2 is by using g-C3N4 with appropriate reduction potential values and incorporating foreign elements. The process of visible light-driven photocatalytic CO2 conversion involves several steps. These steps encompass the adsorption of CO2 molecules and reductants onto the photocatalyst's surface, the generation of photocarriers upon absorption of visible light, the migration of photo-illuminated excitons across the semiconductor material's surface, surface photocatalytic reactions between the adsorbents and photocarriers, and the subsequent desorption of photo-reaction products, followed by the re-adsorption of reactants. the supplied potential must be more negative than the required standard reduction potential to enable the spontaneous conversion of CO2 (ΔG < 0). Equations (4) to (10) provide the formal redox potential values (relative to NHE at pH 7) that facilitate the photocatalytic reduction of CO2 reactions.

$$C{O}_{2}+2{H}^{+}+2{e}^{-}\to HCOOH, {E}^{0} = -0.61 V$$
(4)
$$C{O}_{2}+2{H}^{+}+2{e}^{-}\to CO+{H}_{2}O, {E}^{0} = -0.53 V$$
(5)
$$C{O}_{2}+4{H}^{+}+4{e}^{-}\to HCHO+{H}_{2}O, {E}^{0} = -0.48 V$$
(6)
$$C{O}_{2}+6{H}^{+}+6{e}^{-}\to C{H}_{3}OH+{H}_{2}O, {E}^{0} = -0.38 V$$
(7)
$$C{O}_{2}+8{H}^{+}+8{e}^{-}\to C{H}_{4}+2{H}_{2}O, {E}^{0} = -0.24 V$$
(8)
$$2{H}^{+}+2{e}^{-}\to {H}_{2}, {E}^{0} = -0.41 V$$
(9)
$$2{H}_{2}O +4{H}^{+} \to {O}_{2}+4{H}^{+}, {E}^{0} = +0.82 V$$
(10)

The CO2 adsorption capacity of pristine g-C3N4 is limited, which hampers its effectiveness in catalyzing CO2 reduction. However, researchers have explored methods to enhance the adsorption capacity by introducing vacancies or dopants into the material. In a study [230], the concentration of C vacancies in g-C3N4 was directly related to its ability to adsorb CO2. Linear CO2 molecules have low reactivity and pose a challenge for photocatalytic reactions. A critical mechanism for CO2 reduction involves activating adsorbed CO2 through single-electron transfer at active sites, resulting in the formation of CO2•− intermediates. However, this step is thermodynamically unfavorable due to the high LUMO level of CO2, leading to a highly negative equilibrium potential. The transformation of linear CO2 to bent CO2•− radicals requires significant energy rearrangement, making the single-electron activation step the limiting factor in CO2 photoreduction. Nonetheless, the presence of defects in g-C3N4 facilitates CO2 activation by enhancing its adsorption. These defects, including vacancies and dopants, play a crucial role in promoting the overall process of CO2 photoreduction (Table 2).

Table 2 Summary of non-metal doped g-C3N4 for CO2 reduction reaction

A comprehensive approach that combines experimental investigations and theoretical calculations is essential to gain a deeper understanding of the CO2 reduction reaction (CO2RR). DFT has proven to be particularly crucial among the various computational methods available. The fundamental principles of DFT were initially proposed by Hohenberg and Kohn in 1964 [342]; DFT has been pivotal in providing valuable insights into the fundamental properties of systems with multiple particles. It has contributed to understanding of various aspects of CO2 reduction reactions, such as electronic excitations, energy band structures, adsorption energies, and defect sites. Moreover, DFT calculations can explore potential reaction pathways by analyzing the elementary steps involved. DFT calculations have played a crucial role in understanding how the structure of g-C3N4 relates to its catalytic performance. In a study led by Su and their research group, DFT was used to investigate the mechanisms behind the improved performance of S doped g-C3N4. The calculations revealed that S atoms can be doped into three possible sites: NCen, NAro, and NTet. However, NTet sites were considered insignificant and excluded from further analysis. By examining the formation energies (Eform) of S doped g-C3N4, the researchers determined that do** at the NAro site was the most stable, with Eform values of -1.6 eV for NCen and -3.0 eV for NAro. The DFT calculations also provided insights into the band structure and partial density of states (PDOS). S doped g-C3N4 exhibited a smaller band gap (2.4 eV) than pristine g-C3N4 (2.7 eV), allowing for better absorption of visible light. Analysis of the PDOS revealed that the VB of g-C3N4 primarily consisted of N atoms, while the CB was predominantly composed of C atoms. In contrast, the VB of S doped g-C3N4 involved C, N, and S atoms, while the CB contained C and N atoms. Significantly, S do** caused a shift in the Fermi level towards the CB, indicating an increased reduction ability in S doped g-C3N4. The calculated LUMO and HOMO supported the altered orbital distributions in S doped g-C3N4, facilitating efficient separation of electron–hole pairs generated by light and enhancing the photocatalytic efficiency of the material [343]. DFT calculations are also essential for examining the effects of N vacancies on material properties. For instance, when comparing the PDOS of g-C3N4 nanosheets with N vacancies to that of bulk g-C3N4, it becomes evident that the N vacancies introduce new states in the middle of the energy gap near the bottom of the CB. This modification enables more efficient excitation of electrons during the photoreduction process, enhancing the material's ability to undergo photo-induced electron transfer [232]. In addition, DFT calculations play a crucial role in investigating the pathways involved in the reduction of CO2 on different catalyst surfaces. For instance, Du et al. conducted DFT calculations to examine the reaction barriers of CO2 reduction on Pd/g-C3N4, explicitly focusing on forming formic acid (HCOOH) and methanol (CH3OH). The study identified the hydrogenation of CH2OH* and HCOO* as the rate-determining steps for the CH3OH and formaldehyde (HCHO) pathways, respectively. The calculations revealed that Pd/g-C3N4 prefer to produce HCOOH due to the lower energy barrier associated with the HCOOH pathway and the favorable desorption of HCOOH [344].

S, P, B, O, and halogens are non-metallic elements used as dopants to enhance the photocatalytic performance of g-C3N4 in CO2 reduction. Among these dopants, S do** has been extensively studied for its ability to improve the photoreactivity of g-C3N4. Wang and colleagues proposed a simple method to prepare S doped g-C3N4 by thermally treating a thiourea precursor, while undoped g-C3N4 was obtained from melamine. XPS analysis confirmed the formation of C-S and N-S bonds from S do**. S doped g-C3N4 showed a shift in absorption wavelength towards longer wavelengths and exhibited increased absorption in the ultraviolet region compared to the undoped material. This suggests that S do** enhances light utilization, generating photo-induced electrons and holes more. DOS calculations for S doped g-C3N4 and pure g-C3N4 revealed that the CB and VB mainly comprise C 2p and N 2p states. In pure g-C3N4, the bandgap between the VB and CB aligns with the maximum energy band. However, in S doped g-C3N4, an intermediate energy level consisting of C 2p, N 2p, and S 3p states appears below the CB, decreasing the maximum energy band. This modification significantly improves the transition probability of photo-induced electrons. Additionally, S do** introduces more defects in g-C3N4, which facilitates charge transfer and separation and extends the lifetime of charge carriers. Under UV–visible light irradiation for 3 h, S doped g-C3N4 demonstrated a higher yield of CH3OH production compared to the bulk material. However, the effect of S content on the activity and product selectivity in CO2 reduction has not been thoroughly investigated. Therefore, S do** shows potential for enhancing CH3OH yield and utilizing cost-effective rare-earth elements (S, P, N) to improve CO2 reduction activity and selectivity [331]. P doped g-C3N4 was synthesized using a simple poly-condensation method involving melamine and NaH2PO2·H2O precursors. During the formation process, phosphine gas released from the decomposition of NaH2PO2·H2O caused the ultrathin layers of g-C3N4 to roll up, forming nanotubes instead of the usual sheet-like structure. This unique nanotubular structure provided larger surface areas and increased the number of surface sites enriched with amino groups. Moreover, P do** shifted the absorption edge of g-C3N4 towards longer wavelengths, indicating enhanced absorption of visible light. When exposed to visible light for 4 h, the P doped g-C3N4 exhibited significantly higher yields of carbon monoxide (CO) and methane (CH4), reaching 9.5 and 7.2 μmolg−1, respectively (Fig. 13d, e). These values were 3.1 and 13.9 times higher than those observed with pure g-C3N4. Additionally, the reduced CO/CH4 ratio from 6.0 to 1.3 indicated that P do** selectively promoted the production of CH4 [200]. In a study conducted by Yu and colleagues, they investigated the incorporation of O dopant into g-C3N4. Their research revealed that O atoms preferentially replaced bi-coordinated N atoms in the aromatic heterocycles of g-C3N4. Through a thermal delamination and curling-condensation process under high-temperature oxidation conditions with air flow, they successfully synthesized hierarchical porous nanotubes of O doped g-C3N4. The catalyst exhibited a significantly larger specific surface area of 36 m2g−1 compared to the 9 m2g−1 surface area of bulk g-C3N4. This increase in surface area provided more active sites for CO2 adsorption and facilitated efficient charge transfer. The introduction of O dopants also resulted in a shift in the bandgap, enhancing its light absorption capacity and generating a greater number of photo-induced charge carriers. Notably, it demonstrated an average CH3OH generation rate of 0.9 μmolg−1 h−1, nearly five times higher than that observed for pristine g-C3N4 [345]. A novel technique involving sol gel-mediated thermal condensation of dicyandiamide has been successfully employed to synthesize amorphous g-C3N4 doped with P and F. Introducing P dopants creates midgap states below the CB, formed through the hybridization of C, N, and P orbitals. This reduces the bandgap, indicating transitions between the VB and midgap states or from midgap states to the CB. The specific position of the midgap states in the co-doped catalyst surpasses the CO2/CH3OH potential, meeting the thermodynamic requirements for CO2 photoreduction. The researchers achieved a high CH3OH yield, surpassing previous studies on g-C3N4 catalysts doped with heteroatoms or undoped for the photocatalytic conversion of CO2 to CH3OH. The improved photocatalytic activity of the co-doped g-C3N4 is attributed to the reduced bandgap and increased presence of structural defects. The narrower bandgap allows for enhanced light absorption, generating a larger number of electrons upon irradiation. The incorporation of F modifies the electronic structure of the g-C3N4 network, narrowing the bandgap and promoting p-π conjugation, thereby facilitating the transfer of photocarriers. Defects in the co-doped catalyst suppress the recombination of charge carriers. It extends the lifetime of electrons, leading to more available charge carriers for CO2 reduction. The co-doped g-C3N4 efficiently absorbs visible light, leading to the generation of electron–hole pairs. The holes then oxidize water molecules, producing protons and hydroxide radicals, which further react to generate O2 and additional protons. These protons and CO2 are adsorbed on the catalyst surface, and the photo-generated electrons reduce them to produce CH3OH. By aligning the CB with the redox potential of CO2/CH3OH, the formation of unwanted byproducts such as HCOOH and HCHO is minimized [228].

A new method was employed to synthesize co-doped g-C3N4 using a sol gel-mediated thermal condensation technique with dicyandiamide as the precursor. The co-do** involved incorporating both C and O into the g-C3N4 structure. The co-doped catalyst demonstrated CO as the primary product, accompanied by a small quantity of CH4. When exposed to UV light, the pure g-C3N4 catalyst exhibited a CO evolution rate of 8.11 μmolg−1 over a 4-h duration. However, introducing hexamethylenetetramine (HMT) do**, significantly increased the CO evolution rate, reaching 4.3 times higher than pure g-C3N4. It is worth noting that excessive amounts of the do** agent led to decreased activity, possibly due to an excess of HMT causing an abundance of vacancies that acted as recombination centers, thereby reducing the overall efficiency of the photocatalysis process. The co-doped catalyst displayed stability over four consecutive cycles, indicating its operational reliability for the photocatalytic reduction of CO2. Researchers employed DFT calculations to gain insight into the mechanism of intramolecular photo-induced electron transfer. The calculations focused on three representative fragments (F1, F2, F3) chosen due to their complex structures. Theoretical energy levels were determined based on the structural models of these fragments. The results revealed that fragments containing O atoms were electron donors, while fragments containing C atoms acted as electron acceptors. Among the fragments, the heterocycle with an O atom within its cyclic structure exhibited a stronger electron donor characteristic than the heterocycle with an O atom outside its cyclic structure. Notably, fragments F1 and F3 demonstrated a distinct spatial separation between the HOMO and the LUMO. In these fragments, the HOMO primarily localized on the heterocycle unit with an O atom, while the LUMO mainly resided on the heterocycle unit with an ethylene group. On the other hand, fragment F2 exhibited a more uniform distribution of the HOMO throughout the fragment, while the LUMO predominantly localized on the heterocycle units with the ethylene group, indicating a partial spatial separation between the HOMO and LUMO. The clear spatial separation of the HOMO and LUMO in fragments F1 and F3 facilitated efficient charge separation during the transition, making them highly suitable for photocatalytic reactions. Consequently, in the context of donor–acceptor approaches in g-C3N4, a higher proportion of F1 and F3 fragments contributed to the improved photocatalytic performance of the co-doped catalyst [227]. A successful design and manufacturing method was employed to address the limitations of g-C3N4 nanosheets, including poor visible light absorption and low efficiency in charge transportation. This involved co-do** the nanosheets with C and O, resulting in improved performance in photocatalytic applications, particularly in the production of H2 and the reduction of CO2. The photocatalytic system strongly preferred CO as the primary product during CO2 reduction, with the co-doped g-C3N4 achieving a remarkable CO selectivity of 55.2 μmolg−1. This enhanced performance was attributed to the efficient extraction and transfer of electrons facilitated by introducing C and O dopants, along with enhanced absorption of visible light. In the CO2 reduction experiments using a mixture of water, methyl cyanide (MeCN), and TEOA, all tested g-C3N4 photocatalysts detected the presence of CO, CH4, and H2. However, the system exhibited a strong inclination towards CO production, with the co-doped g-C3N4 achieving a CO formation rate of 55.2 μmolg−1 after 12 h of visible light exposure. This rate was 2.0 and 9.5 times higher than pure g-C3N4, respectively. The slower reaction kinetics in the subsequent steps after CO formation limited the occurrence of further reactions before CO desorbed from the surface of the tubular g-C3N4, resulting in CO being the dominant product. At the same time other compounds like CH3OH, CH3CH2OH, or HCOOH were not detected. The co-doped g-C3N4, with C and O as dopants, exhibited a CO formation rate of 4.6 μmolg−1 h−1 during CO2 reduction, displaying an impressive selectivity of 92.5% for CO, surpassing previous g-C3N4-based photocatalysts. These findings confirm that CO formation result from the photocatalytic reduction of CO2. Furthermore, the synthesized co-doped g-C3N4 photocatalysts demonstrated excellent stability over three consecutives testing cycles. Based on the obtained results, the mechanism of CO2 reduction was analyzed, revealing that the key processes involved the reduction reactions facilitated by protons. This process included the transfer of multiple electrons, where photoexcited electrons in the CB reduced CO2 to generate CO and CH4. However, due to the lower electron requirement, CO was preferentially formed over other products that involved more complex reaction pathways. Additionally, the holes in the VB oxidized TEOA to TEOA+, while the electrons in the CB reduced CO2 to CO and CH4, with CO being the primary product [346].

To address the challenges of low CO2 activation capability and limited concentration of charge carriers in g- g-C3N4, researchers developed a new type of g-C3N4 by introducing C vacancies through heat treatment in an NH3 atmosphere. This modified g-C3N4 with enriched C vacancies showed a CO2 to CO conversion rate more than twice that of pristine g-C3N4. The improved CO2 reduction performance of the modified g-C3N4 can be attributed to enhanced CO2 adsorption/activation, an elevated CB, and increased concentration and lifetime of charge carriers. Moreover, introducing C vacancies helped to mitigate the exciton effect and promote the generation of charge carriers. These findings provide insights into enhancing CO2 photoreduction in g-C3N4 through structural adjustments and offer possibilities for manipulating the exciton effect and charge carrier concentration to facilitate photocatalytic reactions involving electron–hole separation and charge carriers. During the reaction, both photocatalysts exclusively produced CO as the carbonaceous product. The CO evolution rate on the modified g-C3N4 was approximately 4.18 mmolg−1 h−1, nearly 3.3 times higher than that on pristine g-C3N4 (approximately 1.28 mmol g−1 h−1) within the first hour (Fig. 13f). However, the increase was not as significant under full spectrum light. A comparative analysis examined the CO2 adsorption/activation, light-harvesting, and charge separation and transfer capabilities of pristine g-C3N4 and the modified g-C3N4 with C vacancies. Pristine g-C3N4 displayed inadequate active sites for CO2 adsorption/activation, as indicated by the CO2 temperature programmed desorption (CO2-TPD) results revealed a single desorption peak at around 80 °C. In contrast, the modified g-C3N4 exhibited two desorption peaks at approximately -85 °C and—330 °C. The lower temperature peak indicated physical adsorption of CO2, with a slightly higher desorption temperature than pristine g-C3N4. The peak at 330 °C was attributed to the chemisorption of CO2, likely facilitated by the increased basic sites resulting from more N–H groups in the modified g-C3N4 with C vacancies. DFT calculations supported these findings, showing higher CO2 adsorption energies on the modified g-C3N4 with C vacancies compared to pristine g-C3N4. Overall, the presence of C vacancies in g-C3N4 enhances CO2 adsorption/activation and improves the CO2 to CO conversion rate, underscoring the significance of C vacancies in facilitating CO2 photocatalytic reduction [230]. The performance of g-C3N4-based photocatalytic systems can be significantly improved by controlling their morphology and adjusting surface vacancies. This study aimed to understand the impact of N vacancies in the atomic layers of g-C3N4 on the photoreduction of CO2. By introducing an NH4Cl gas template, which facilitated efficient charge transportation, the researchers examined the influence of N vacancies on the photocatalytic properties. Incorporating the gas template disrupted the interactions between adjacent g-C3N4 layers, resulting in the desired structure. Additionally, N vacancies in the ultrathin nanosheets had notable effects on their optoelectronic characteristics. The researchers made several key findings regarding the N vacancies: First, a higher density of N vacancies enhanced the ability of g-C3N4 to reduce CO2. Second, the N vacancies allowed for extended absorption of long-wavelength visible light due to the strategic positioning of a midgap state below the CB. Third, the midgap state acted as an effective electron reservoir, prolonging the radiative recombination of electron–hole pairs. Consequently, g-C3N4 with N defects exhibited significant improvements in photocatalytic performance. The yield of CH4 evolution was 3.16 times higher compared to pristine ultrathin g-C3N4 and 5.14 times higher compared to bulk g-C3N4. The broader absorption spectra and longer lifetime of charge carriers demonstrated the crucial role of N defect states in enhancing the photocatalytic activity of g-C3N4. The CB edge of both ultrathin g-C3N4 and N defect-modified materials favored the production of CH4 through CO2 reduction, while H2O was oxidized to O2. The rate of CH4 evolution increased with a higher density of N vacancies, resulting in a CH4 evolution rate of 9.26 μmolg−1, which was 3.16 times higher than that of ultrathin g-C3N4. Photostability tests showed a relatively consistent CH4 evolution yield throughout the cycles, indicating the resistance of N defect sites to radical species and their ability to sustain prolonged light exposure. Based on the results, the researchers proposed a mechanistic understanding of how N vacancies contribute to improved photoactivity. N vacancies created a midgap state closer to the CB edge, characterized by a band tail energy between 1.2 and 1.3 eV. This unique positioning allowed the catalyst to effectively capture both short- and long-wavelength photons within the visible light range, leading to a two-step electron excitation process. The midgap state acted as an electron reservoir, efficiently trap** unstable electrons and preventing their direct recombination with holes. When sufficient excitation energy was available, the trapped electrons were excited from the midgap state to the CB, actively participating in the CO2 reduction process [237]. A simple one-step method was utilized to prepare 3D macroporous g-C3N4 with C vacancies, using polymethylmethacrylate as a template. This approach effectively increased the available reaction sites on the surface of g-C3N4 and expanded its absorption range for visible light. The modified g-C3N4 demonstrated remarkable improvements in reducing CO2 compared to the unmodified counterpart. The unique pore structure of the material played a significant role in enhancing light utilization efficiency and providing a greater number of active surface sites for catalysis. The performance of the modified samples was evaluated based on their capacity to reduce CO2, with the primary product being CH3OH. Notably, the modified catalyst exhibited a CH3OH generation rate of 7.5 μmolh−1 g−1, which surpassed the rate achieved by the unmodified g-C3N4 fourfold. This outcome underscores the importance of the macroporous structure, high specific surface area, and presence of C vacancies in facilitating the capture and photoreduction of CO2 molecules on the catalyst's surface. The efficiency of the photoreduction process is closely linked to the material’s electronic structure. Analysis of the electron configuration revealed that the CBM of the modified g-C3N4 was shifted to -2.1 eV, in contrast to the CBM value of -1.6 eV for bulk g-C3N4. This considerable shift in CBM creates a strong driving force for the conversion of CO2 by raising the reduction potential of the photogenerated electrons. The C vacancies act as effective electron traps, promoting photogenerated electrons localization and enhancing surface carriers utilization. These combined mechanisms synergistically contribute to the improved catalytic activity of the modified g-C3N4 in the photoreduction of CO2 [347].

6 Conclusion and future prospectives

g-C3N4 has attracted considerable attention as a photocatalyst in areas like photocatalytic water splitting and CO2 reduction. It possesses desirable properties, such as responsiveness to visible light, suitable band gap, excellent redox ability, metal-free nature, environmental friendliness, chemical and thermal stability, ease of fabrication, and modifiability. However, pristine g-C3N4 has limitations that hinder its photocatalytic efficiency, including insufficient sunlight absorption, low surface area, and fast recombination of electron–hole pairs. To overcome these limitations, researchers have explored nonmetal do** as a promising approach to enhance the photocatalytic activity of g-C3N4. This review summarizes recent advancements in develo** efficient and cost-effective systems based on doped g-C3N4. Nonmetal do**, co-do**, and vacancy engineering have been investigated to improve photocatalytic performance by enhancing light absorption, facilitating charge separation and transport, and extending the lifetime of charge carriers. By introducing external dopant atoms into g-C3N4, the electronic structure and energy levels can be adjusted, resulting in increased light responsiveness and improved charge separation. Nonmetal do** creates new energy levels within the band gap, broadening the spectral response and reducing the recombination rate of electron- hole pairs. However, these new energy bands can also act as recombination centers, decreasing quantum efficiencies. Nonetheless, nonmetal do** effectively modulates light absorption, redox potentials, and the mobility of photo-induced charge carriers. Co-do** offers additional benefits by combining the positive effects of individual dopants, thereby enhancing the structural and optical properties of g-C3N4 and ultimately improving its photocatalytic performance. Despite promising results, the development of nonmetal-doped g-C3N4 in photocatalysis is still in its early stages, and some challenges need to be addressed. The review also highlights significant advancements in vacancy creation in g-C3N4, which have greatly improved photocatalytic energy performance. The introduction of vacancies or dopants effectively modifies the material’s surface, optical, and electrical properties, resulting in enhanced photocatalytic performance in water splitting and CO2 reduction. Creating vacancies in g-C3N4 nanomaterials brings about significant changes, such as tunable bandgaps, defect-induced midgaps, increased surface area, suppressed recombination of electron–hole pairs, and improved adsorption and activation of reactant molecules. Do** with elements like B, O, S, and P and engineering N and C vacancies has increased reactant molecules’ affinity and binding energy, thereby enhancing uptake. These modifications enable the selective production of desired products in solar energy conversion.

However, despite extensive research and a positive outlook, the field of doped g-C3N4 still faces numerous scientific and engineering challenges that must be overcome. Several notable problems and future suggestions for the advancement of the do** effect in g-C3N4 include:

  1. 1.

    Do** modifications of g-C3N4 can expand its ability to absorb visible light but often result in an indirect band gap, leading to insufficient light absorption intensity in the visible region. It is crucial to develop dopants and methods that create a direct band gap to enhance the absorption properties of g-C3N4. By introducing dopants into g-C3N4 materials, coordination unsaturated centers can be formed, providing highly active sites for the activation and chemisorption of reactant molecules. Future research should focus on specific techniques that anchor structural units to create single-atom catalysts with improved reaction kinetics. Ensuring the formation of uniform do** centers and preventing their disappearance or transformation are essential factors in this approach.

  2. 2.

    The exploration of incorporating non-metal do** with the production of nanostructures, such as nanosheets, mesostructured, nanorods, nanotubes, and nanofibers, opens up a new and exciting direction. Nanostructured forms of g-C3N4, especially nanosheets, offer several advantages over bulk g-C3N4, including a larger specific surface area, improved transfer of electron–hole pairs, and enhanced efficiency in separating carriers. Template methods, like hard and soft templates, can synthesize mesoporous g-C3N4, increasing specific surface area and electron capture sites. However, exploring alternative techniques that minimize using environmentally harmful strong acids or alkalis is necessary. Choosing an appropriate do** method should align with the structural characteristics of g-C3N4. Interlayer do**, which uses a layered structure similar to graphite, can enhance electron transfer capabilities. On the other hand, in-plane do** can modify the energy barriers for surface reactions, allowing for specific adjustments by targeting different do** sites.

  3. 3.

    Further exploration is needed to understand the relationship between dopants and the various morphologies of g-C3N4 in terms of their impact on photocatalytic activity. This requires conducting experimental and computational analyses to investigate dopant modification, catalytic performance, active site properties, and underlying reaction mechanisms. Using computational chemistry can provide valuable insights into how do** influences the electronic structure, adsorption energy, and Gibbs free energy changes during photocatalysis. One promising avenue for improving the photocatalytic efficiency of nonmetal-doped g-C3N4 involves studying the modulation of the orientations of the HOMO and LUMO to encompass oxidation and reduction potentials while simultaneously reducing the band gap and enhancing the separation of photo-generated electrons and holes. To advance this field, it is crucial to understand the origins of visible light absorption caused by element do**, the resulting chemical states, and the specific locations of dopants.

  4. 4.

    The current methods used to characterize materials have limitations when accurately identifying and quantifying do** in g-C3N4. Although advanced techniques like EPR, XPS, SFG, HRTEM, AFM, and STEM have been helpful, there is a need for more precise and refined characterization methods to understand the different types of dopants present in g-C3N4 fully. It is crucial to establish reliable techniques or systematic approaches to distinguish between dopant types, concentrations, and locations to deepen our understanding of their specific catalytic activities. Another unexplored aspect of do** materials relates to the structural changes that vacancies undergo during catalytic processes. Vacancies, known for their high energy and reactivity, can experience dynamic structural transformations during reactions. Investigating the stability of dopants throughout these processes contributes significantly to our understanding of their catalytic activity. Therefore, it is essential to increase the use of in situ/operando analyses (such as FTIR, Raman, XAFS, XPS, and SAS) to shed light on the dynamic structure of doped g-C3N4.

  5. 5.

    The innovative concept of merging light-driven catalysis with electrochemical or bio-catalytic reactions offers promising opportunities. Biological systems utilize enzymes and reductive pathways to produce long-chain hydrocarbons, and by integrating biocatalysts with light-driven catalysis, we can capitalize on the unique benefits of each approach. The versatile properties of doped g-C3N4, including its customizable structure, tunable surface properties, and flexible nature, make it an ideal candidate for synergistic interactions with cellular organisms. This integration opens up possibilities for multifunctional photo redox applications, maximizing their potential.

Here, we have emphasized a crucial facet of sustainable energy research, focusing on the pivotal role of surface chemistry in enhancing the performance of g-C3N4 as a metal-free semiconductor photocatalyst for clean energy conversion. Our manuscript delves into recent breakthroughs in the precise engineering of single g-C3N4 at the atomic level, with a pronounced focus on enhancing its surface chemistry through various do** techniques. These techniques encompass nonmetal and bi-nonmetal do** and the strategic creation of vacancies within the polymer framework. By finely tuning the surface chemical properties, we aim to address issues related to charge carrier dynamics, specific surface area, and light absorption properties. To provide a rigorous and comprehensive analysis, computational simulations based on first principles and DFT were employed to investigate the influence of do** and vacancy creation on the distribution of surface states, adsorption energies, and the interaction of g-C3N4 with target molecules. We highlight how surface chemistry modifications impact the efficiency of photocatalytic reactions, including water splitting and CO2 reduction, with a particular focus on product selectivity.

Collectively adhering to these guidelines can extend valuable insights for designing efficient and continuous catalytic systems in artificial photosynthesis. With collaborative efforts spanning various disciplines such as materials engineering, chemical engineering, electrical engineering, computational science, chemistry, and physics and involvement from industrial stakeholders, we hold strong confidence that this approach will establish a groundbreaking paradigm. It will propel scalable doped g-C3N4 to the forefront and usher in a new era of renewable energy in the coming years. Furthermore, the future integration of machine learning, big data, and artificial intelligence can enhance the do** engineering of g-C3N4 for light-driven energy catalysis. Through comprehensive collection and analysis of experimental and simulation results, we firmly believe that do** engineering in g-C3N4 photocatalysts will rectify imperfections observed in their pristine counterparts. This, in turn, will unlock unprecedented opportunities for solar energy conversion and transform visionary concepts into tangible breakthroughs. Ultimately, it will revolutionize the field of photocatalysis with remarkable advancements in specialized applications.