The method is based on the specific binding of calmagite, a metallochromic indicator, and magnesium at alkaline pH with the resulting shift in the absorbtion wavelength of the complex. The intensity of the cromophore formed is proportional to the concentration of magnesium in the sample.