Copper and silver are strategic metals in industry. However, corrosion in these metals severely limits their broad engineering applications. Organic molecules, such as thiadiazole (TD) derivatives have been effectively utilized as corrosion inhibitors for Cu and Ag metals and their alloys. Therefore, a fundamental understanding of their adsorption behavior on metal surfaces is key to the understanding of their effect on corrosion inhibition. In this work, we used first-principles calculations based on the density functional theory (DFT) to systematically study the adsorption behaviors of 1,3,4-thiadiazole (TD) and 2,5-dimercapto-1,3,4-thiadiazole (DMTD) on the low index surfaces of pure Cu and Ag. Our results show that the average adsorption energy of DMTD is much lower than that of TD on both Cu and Ag surfaces. This is attributed to the removal of H atoms from DMTD in the DFT calculations as they easily dissociate in the aqueous solution, along with the presence of two more sulfur atoms in the DMTD structure as anchoring sites. It is also revealed that both S and N atoms in DMTD participate in the bond formation with Ag, while the three S atoms of DMTD prefer to form bonds with Cu. This is further validated from the calculated charge density difference before and after the adsorption and agrees well with the X-ray photoelectron spectroscopy measurements. Finally, the differences between the adsorption energies from DFT calculations and experimental extrapolations are discussed. They can be ascribed to the existence of H atoms in DMTD due to their plausible partial ionization in real experiments, as well as the presence of surface oxides and contact with the electrolyte in the experiments. This is further validated by simulating the adsorption of fully-, partially-and non-ionized DMTDs on the (111) surfaces of both Cu and Ag. Our work sheds light on the adsorption behaviors of TD derivatives on both Cu and Ag, which can potentially be used as a criterion to discover and determine appropriate corrosion inhibitors for metal protection.