Pyrimidine derivatives, which are classified as heterocyclic compounds, have been reported to have antibacterial activity. Therefore, synthesizing potential active pyrimidine derivative compounds is essential to address antibacterial resistance and to achieve good health and well-being, supporting Sustainable Development Goals (SDGs). In silico analysis has been used to be an ideal methodology in predicting compounds efficacy of their bioactivities prior to the synthesizing process. This study aims to examine three pyrimidine derivatives as potential antibacterial agents through in silico analysis by using molecular docking. Three pyrimidine derivatives, 4-(4-methoxyphenyl)-6-phenylpyrimidine-2-thiol 1, 4-(4-aminophenyl)-6-(4-methoxyphenyl)pyrimidine-2-thiol 2 and 4-(4-bromophenyl)-6-(4-methoxyphenyl)pyrimidine-2-thiol 3, were subjected to have antibacterial activity against Escherichia coli. It was also predicted that the antibacterial mechanism could be activated by inhibiting folate synthesis in dihydrofolate reductase (DHFR) enzyme through substrate mimicking structure. Molecular docking of DHFR with three pyrimidine derivatives was conducted using Autodock4 with RMSD docking validation at 1 Å. The outcomes show that free binding energy (ΔG) of 1, 2 and 3 were at -6.39, -6.08 and -6.60 kcal/mol, respectively. This study found that compound 3 have showed the lowest binding energy value and inhibition constant (Ki) at 14.53 µM. Meanwhile, the Ki values of compounds 1 and 2 were slightly higher than compound 3 in 20.78 and 34.88 µM, respectively. Molecular docking also resulted the three compounds located in the active site and have showed hydrogen bond and van der Waals-electrostatic interaction with amino acids of DHFR in the binding pocket of an active site. A comparison with a known antibacterial, trimethoprim, have showed higher free energy (-1.44 kcal/mol) and Ki value (88.67 mM) compared to three potential pyrimidine derivatives. Thus, it demonstrated that three pyrimidine derivatives tested in this study could be used as a prospective antibacterial agent.