Tunable photoluminescent nitrogen-doped graphene and graphitic carbon nitride (g-C3N4) quantum dots are synthesized via a facile solid-phase microwave-assisted (SPMA) technique utilizing the pyrolysis of citric acid and urea precursors. The atomic ratio, surface functionalization, and atomic structure of as-prepared quantum dots strongly depend on the ratio of citric acid to urea. The quantum dots have a homogeneous particle size and tend to form a circle and/or ellipse shape to minimize the edge free energy. The atomic ratio of surface nitrogen to carbon (N/C) in the quantum dots can reach as high as 1.74, among the highest values reported in the literature. The SPMA technique is capable of producing high-quality quantum dots with photoluminescence (PL) emission at various wavelengths on a pilot scale. The atomic structures of the N-doped graphene and g-C3N4 quantum dots are explored using molecular dynamics simulations. Increasing the urea concentration increases the tendency of in-plane N (i.e., quaternary N) substitution over that of other amino functionalizations, such as pyrrolic and pyridinic N. The PL emission can be precisely tuned via a one-step SPMA method by adjusting the precursor composition. A high quantum yield of 38.7% is achieved with N-doped graphene quantum dots, indicating the substantial influence of the N- and O-rich edge groups on the enhancement of PL efficiency. A bandgap structure is proposed to describe the interstate (π∗-π) transition of quantum dots. This work introduces a novel approach for engineering the chemical composition and atomic structure of graphene and g-C3N4 quantum dots, facilitating their research and applications in optical, electronic, and biomedical devices.