The chemical reaction that takes place can be represented as follows:
HIn (colorless) + OH- (base) → In- (pink) + H2O
Where HIn represents the protonated phenolphthalein and In- represents the phenolphthalein anion.
The color change of phenolphthalein is reversible, meaning that it can change back to colorless if the pH of the solution is lowered again by adding an acid. This property makes phenolphthalein a useful indicator for acid-base titrations, where it is used to signal the equivalence point, or the point at which the acid and base have completely reacted.