The amphiphilic random copolymer exhibited a good reversible behavior in aqueous solution: the addition of strong acid promoted the isomerization from spiropyran (SP) to merocyanine (MC), and the inverse process was achieved by the introduction of strong base.