A highly toxic heavy metal Cd2+ not only pollutes the environment but also poses a serious health risk to humans through water intake and food chains. Thus, to measure the concentration of Cd2+ with simplicity, sensitivity, and rapidity in tap water, soil, and rice is important particularly. In the work, an efficient sensor based on gold nanoparticles (AuNPs) modified with 3-(1H-Tetrazol-5-yl) aniline (TAA) for the colorimetric detection of Cd2+ is rationally proposed. The chelation between Cd2+ and TAA@AuNPs is characterized by transmission electron microscopy (TEM), dynamic light scattering (DLS), UV-visible spectroscopy, Fourier transforms infrared (FTIR) and analyzed by Gaussian16w and Multiwfn simulations. The system color from wine-red to gray-blue with raising Cd2+ concentration resulted from the agglomeration of AuNPs with high anti-interference and selectivity, which could be visually perceived with the naked eye. The limit of detection (LOD) is 1.0 µM by the unaided eye, and 31 nM by UV-vis spectroscopy with the excellent linear relationship (R2 = 0.99049) in the range of 0.0 ~ 8.0µM (Cd2+ concentration) showing that AuNPs modified with TAA could serve as the quantitative determination of Cd2+. After testing the tap water, soil, and rice, it is considered that the new test way can be practically applied to the monitoring of harmful metal Cd2+ in environmental systems.