A novel pyridinium salt derivative, 2,3,4,5,6-pentaphenyl-1-(1H-1,2,4-triazol-3-yl)pyridinium perchlorate (1) has been designed and synthesized by using pyrylium perchlorate and 3-amino-1H-1,2,4-triazole as ingredients, which can be exploited for the binding and specific sensing of anion via hydrogen bonds. Compound 1 exhibits intense blue emission in solution with maximum emission at 469 nm with a red shift relative to that (426 nm) of solid state. The luminescence intensity of 1 could be selectively and sensitivity quenched with acetate ion and fluorine ion among various anions including F−, Cl−, Br−, I−, AcO− and NO3−. Furthermore, the possible detection mechanism was investigated. This work could contribute a credible potential sensing application of 1,2,4-triazolyl substituted pentaphenylpyridinium salts towards the specific anions in biological and environmental concerns.