The electrochemical reduction of CO2 (CO2RR) to valuable chemicals and fuels is a promising strategy for addressing environmental challenges. Graphitic carbon nitride (g-C3N4) is a promising electrocatalyst for CO2 reduction. However, poor electron transfer and low CO2 affinity often limit its catalytic performance. In this study, we employ density functional theory (DFT) calculations to systematically investigate the effect of various non-metal dopants (B, P, O, and S) on the electronic structure and CO2 adsorption properties of g-C3N4. Our results demonstrated that O-C3N4 preferentially catalyzes the formation of HCOOH with a low limiting potential of −0.12 V. Meanwhile, S-C3N4 efficiently promotes the generation of CH2O, CH3OH, and CH4 at a limiting potential of −0.58 V, as well as CO at −0.77 V. These findings provide valuable insights toward the rational design of effective non-metal-doped g-C3N4 catalysts for efficient CO2 conversion.