Xanthine, which can specifically bind with mercury ion (Hg2+) to form xanthine-Hg(2+)-xanthine complex, was used as Hg2+ binding molecule in this paper. In the absence of Hg2+, imide group of xanthine easily adsorbs onto the surface of gold nanoparticles (AuNPs) and induces aggregation of AuNPs, resulting in a blue color. In the presence of Hg2+, however, the selective binding of xanthine with Hg2+ prevents the AuNPs against xanthine induced aggregation, resulting in a visible color change from blue to red depend on the concentration of Hg2+. Therefore, taking advantage of this phenomenon, a simple, cost-effective and rapid method can be established for Hg2+ visual detection. This method allows the detection of Hg2+ in the range of 0.075-4.0 microM with a detection limit (3sigma/slope) of 15 nM, and exhibits a high selectivity toward Hg2+ over other metal ions. Particularly, as low as 0.5 microM Hg2+ can be easily detected by the naked eye without using any complicated or expensive instruments.