Phenolphthalein, an acid-base indicator used to test the pH of a solution, turns pink due to the presence of a weak base. The indicator itself is a weak, colorless acid that forms pink anions when it dissolves in water.
Although the anions are pink, the solution remains colorless in the presence of an acid. If the pH of the solution is 8.2 or above, the number of anions increases, causing the solution to turn pink. The increase in cations also causes the solution to turn red when the pH is above 10.0.
Phenolphthalein is often used on litmus paper to test pH, along with bromophenol, which turns blue or yellow in the presence of an acid.