A novel spiropyran that responds to both extreme acid and extreme alkali and has an 鈥渙n鈥搊ff鈥搊n鈥?switch is reported. Benzoic acid at the indole N-position and carboxyl group at the indole 6-position contribute to the extreme acid response. The ionizations of carboxyl and phenolic hydroxyl groups cause the extreme alkali response. Moreover, the fluorescent imaging in bacterial cells under extreme pH conditions supports the mechanism of pH response.