Graphitic carbon nitride $$({\text {g-C}}_{3}{\text {N}}_{4})$$ has become a new interdisciplinary research hot spot due to its metal-free and visible-light-responsive nature along with alluring electronic band structure and high physicochemical stability. This fascinating semiconductor conjugated polymer is considered a feasible material for harvesting clean and inexhaustible solar energy in the field of environmental remediation and energy applications. Chemical graph theory plays an important role in modeling and designing the chemical structure of complex compounds. The molecular topological indices are the numerical invariants of a molecular graph and are very useful for predicting the reactivity of respective compound. In this paper, we studied the chemical graph of crystalline graphitic carbon nitride, i.e., $$({\text {g-C}}_{3}{\text {N}}_{4})$$ , via degree-based topological indices such as general Randic index, atom bond connectivity index, geometric arithmetic index and Zagreb-type indices. Curve fitting between the calculated thermodynamic properties and topological indices was done together with the numerical and graphical representation of computed results. This mathematical framework of graphitic carbon nitride based on topological indices presents a comprehensive picture of potentially valuable thermodynamic properties such as entropy and enthalpy which could be useful in structural modification of $$({\text {g-C}}_{3}{\text {N}}_{4})$$ for specific application.