In the current research chor, we are reporting the synthesis of 2-amino-6-methylpyrimidin-4-yl benzenesulfonate (AMPBS) and 2,6-diaminopyrimidin-4-yl benzenesulfonate (DAPBS) via O-benzenesulfonylation of 2-amino-6-methylpyrimidin-4-ol 1 and 2,6-diaminopyrimidin-4-ol 2 respectively. The structures of the synthesized compounds were characterized unambiguously by single crystal analysis (SC-XRD).Hirshfeld surface study showed that C-H…O, C-H…N and especially C-H…C hydrogen bond interactions are the key contributors to the intermolecular stabilisation in the crystal. The quantum chemical understanding about optimized geometry, natural bond orbitals (NBOs), frontier molecular orbitals (FMOs) and nonlinear optical (NLO) analysis for AMPBS and DAPBS were obtained by applying density functional theory (DFT) at B3LYP level and 6-311G(d,p) basis set. Time dependent density functional theory (TD-DFT)/ B3LYP/ 6-311G(d,p) level were employed to determine the photo physical properties of compounds. As a whole, the simulated results were found to have an excellent concurrence to the experimental results. The charge transfer phenomenon entitled compounds was determined by FMOs. Global reactivity parameters were obtained by using HOMO–LUMO energies of compounds. Overall, the computational results of AMPBS and DAPBS have outstanding agreement to experimental data. The computational study also showed that the title compounds have remarkable NLO properties.