
X-gal (5-bromo-4-chloro-3-indolyl-β-D- galactopyranoside) is used to indicate whether bacteria express the ß-galactosidase enzyme, which is encoded by the lacZ gene.
X-gal is cleaved by ß-galactosidase yielding galactose and 5-bromo-4-chloro-3-hydroxyindole, which is oxidized into 5,5'-dibromo-4,4'-dichloro-indigo, an insoluble blue product. Thus, if X-gal and an inducer of ß-galactosidase (usually IPTG) is contained within an agar medium on a culture plate, colonies which have a functional lacZ gene can easily be distinguished by their blue color.