A chemosensor based on symmetrical squarylium (SQ) dye, 2,4-bis((3,3-dimethylindolin-2-ylidene)methyl)cyclobutane-1,3-bis(olate), was synthesised and its cation-sensing properties in acetonitrile were investigated by UV–vis spectroscopy. Upon the addition of Hg2+, the solution of SQ dye showed clear colour change. The absorption studies also indicate a higher affinity of Hg2+ towards the formation of 2:1 complexes, which is in good agreement with the experimental results. The selective detection of Hg2+ of the symmetrical-SQ unit gave rise to a significant absorption decrease at λmax 650 in acetonitrile solution.