Two potential bioactive pyrimidine-5-carbonitrile derivatives have been synthesized and characterized by spectroscopic techniques (1H and 13C-NMR) and the three dimensional structures were elucidated by single crystal X-ray diffraction at low temperature (160 K). In both structures, the molecular conformation is locked by an intramolecular C–H⋯C interaction involving the cyano and CH of the thiophene and phenyl rings. The intermolecular interactions were analyzed in a qualitative manner based on the Hirshfeld surface and 2D-fingerprint plots. The results suggest that the phenyl and thiophene moieties have an effect on the crystal packing. For instance, the chalcogen bonds are only preferred in the thiophene derivative. However, both structures uses a common N–H⋯O hydrogen bond motif. Moreover, the structures of 1 and 2 display 1D isostructurality and molecular chains stabilize by intermolecular N–H⋯O and N–H⋯N hydrogen bonds. The nature and extent of different non-covalent interactions were further characterized by the topological parameters derived from the quantum theory of atoms-in-molecules approach. This analysis indicates that apart from N–H⋯O hydrogen bonds, other non-covalent interactions are closed-shell in nature. A strong and linear N–H⋯O hydrogen bond shows intermediate bonding character between shared and closed-shell interactions. The molecular docking analysis suggests that both compounds display potential inhibitory effect against the dihydrofolate reductase (DHFR) enzyme from humans and Staphylococcus aureus.