Today, the monitoring and determination of heavy metal pollutants in the environment is an essential requirement for the environmental and research communities. Mercury ion is one of the most hazardous heavy metals, and scientists are trying to develop new methods for its detection. In this study, a new colorimetric sensor based on aggregation gallic acid-capped gold nanoparticles (GA-AuNPs) for the determination of mercury ions in environmental water samples was presented. The green synthesized GA-AuNPs exhibited a sharp surface plasmon resonance peak at 515 nm. The addition of mercury ions changed the surface properties of GA-AuNPs, resulting in the formation of a new peak near 670 nm due to the aggregation of GA-AuNPs, and an obvious color change from red to purple occurred. Thus, mercury ions were detected based on the change in the absorbance ratio (A670/A515). The developed sensor can determine the mercury ions in the concentration range of 78.0 nM to 8.3 µM with a detection limit of 5.5 nM. Based on the Environmental Protection Agency (EPA) and the World Health Organization (WHO) reports, the amount of Hg2+ ions in fresh water should be between 10.0 and 30.0 nM. The results indicate that the developed sensor can detect and determine trace amounts of Hg2+ ions in environmental water samples.