An indicator may be used to obtain quite precise measurements of pH by measuring absorbance quantitatively at two or more wavelengths. The principle can be illustrated by taking the indicator to be a simple acid, HA, which dissociates into H and A.
:HA  H + A   
The value of the acid dissociation constant, pK, must be known. The molar absorbances, ε and ε at wavelengths λ and λ must also have been determined by previous experiment. Assuming Beers law to be obeyed, the measured absorbances A and A' at the two wavelengths are simply the sum of the absorbances due to each species.
These are two equations in the two concentrations [HA] and [A]. Once solved, the pH is obtained as
If measurements are made at more than two wavelengths, the concentrations [HA] and [A] can be calculated by linear least squares. In fact, a whole spectrum may be used for this purpose. The process is illustrated for the indicator bromocresol green. The observed spectrum (green) is the sum of the spectra of HA (gold) and of A (blue), weighted for the concentration of the two species.
When a single indicator is used, this method is limited to measurements in the pH range pK ± 1, but this range can be extended by using mixtures of two or more indicators. Because indicators have intense absorption spectra, the indicator concentration is relatively low, and the indicator itself is assumed to have a negligible effect on pH.