The compound 3-(2-Mercaptopyridine)phthalonitrile has been synthesized and characterized by IR, UV-vis, and X-ray single-crystal determination. The molecular geometry from X-ray determination of the title compound in the ground state has been compared using the Hartree-Fock (HF) and density functional theory (DFT) with the 6-31G(d) basis set. The calculated results show that the DFT and HF can well reproduce the structure of the title compound. The energetic behavior of the title compound in solvent media was examined using the B3LYP method with the 6-31G(d) basis set by applying the Onsager and polarizable continuum model. Using the TD-DFT and TD-HF methods, electronic absorption spectra of the title compound have been predicted and good agreement with the TD-DFT method and the experimental determination was found. The predicted nonlinear optical properties of the title compound are much greater than those of urea. Besides, molecular electrostatic potential of the title compound were investigated by theoretical calculations. The thermodynamic properties of the compound at different temperatures have been calculated and corresponding relations between the properties and temperature have also been obtained.