Carbolic acid or phenol reacts with phthalic anhydride in presence of conc. H2SO4 to form phenolphthalein which is used as an acid base indicator. The type of reaction involved is electrophilic substitution reaction. Phenol is ortho-para directing group. Hence, substitution occurs at para position.

The phenolphthalein is colourless below pH 8.5 and attains a pink to deep red hue above pH 9.0.