In the laboratory, it is used to detect the presence of alkaline phosphatase activity by hydrolysis of PNPP. In basic conditions, presence of hydrolytic enzymes will turn reaction vessel yellow.
4-Nitrophenol is a product of the enzymatic cleavage of several synthetic substrates such as 4-nitrophenyl phosphate (used as a substrate for alkaline phosphatase), 4-nitrophenyl acetate (for carbonic anhydrase), 4-nitrophenyl-β--glucopyranoside and other sugar derivatives which are used to assay various glycosidase enzymes.  Amounts of 4-nitrophenol produced by a particular enzyme in the presence of its corresponding substrate can be measured with a spectrophotometer at or around 405 nm and used as a proxy measurement for the amount of the enzyme activity in the sample.
Accurate measurement of enzyme activity requires that the 4-nitrophenol product is fully deprotonated, existing as 4-nitrophenolate, given the weak absorbance of 4-nitrophenol at 405 nm.  Complete ionization of the alcohol functional group affects the conjugation of the pi bonds on the compound. A lone pair from the oxygen can be delocalized via conjugation to the benzene ring and nitro group. Since the length of conjugated systems affects the color of organic compounds, this ionization change causes the 4-nitrophenol to turn yellow when fully deprotonated and existing as 4-nitrophenolate.
A common mistake in measuring enzyme activity using these substrates is to perform the assays at neutral or acidic pH without considering that only part of the chromophoric product is ionized. The problem can be overcome by stopping the reaction with sodium hydroxide (NaOH) or other strong base, which converts all product into 4-nitrophenoxide; final pH must be > ca. 9.2 to ensure more than 99% of the product is ionised. Alternatively enzyme activity can be measured at 348 nm, the isosbestic point for 4-nitrophenol/4-nitrophenoxide.