A colorimetric cyanide ion (CN À ) sensor 4-[(1E)-2-(2-hydroxyphenyl)ethenyl]-1-allylpyridinium bromide (2-HPEAPB) was synthesized via condensation and N-alkylation reactions using 4-methylpyridine and salicylaldehyde as the starting materials. 2-HPEAPB displayed good selectivity, fast response, and high sensitivity toward CN À over other competing anions in acetonitrile-water (95 : 5, v/v) with a limit of detection of 8.0 Â 10 À6 mol L À1 by the naked eye. The sensing mechanism and the influence of pH and temperature on sensing properties were investigated. Colorimetric test paper for CN À was prepared by absorption of 2-HPEAPB to a chromatography paper, which could be used to detect CN À directly and quickly. Analytical application of measuring CN À concentration in an electroplating wastewater in realtime was conducted successfully.