A methylene blue active substances assay, or MBAS assay, is a colorimetric analysis test method that uses methylene blue to detect the presence of anionic surfactants (such as a detergent or foaming agent) in a sample of water. An anionic surfactant detected by the color reaction is called a methylene blue active substance (MBAS).
After first acidifying a water sample (with boric acid, for example), one adds to it chloroform and a solution of methylene blue et al. Methylene blue is a cationic dye. The biphasic solution is then agitated to distribute these reagents throughout the aqueous and organic phases. If an anionic surfactant is present, then the cationic methylene blue and the anionic surfactant forms an ion pair, which is extracted into the organic phase. The color saturation of the chloroform increases with the concentration of anionic surfactants.
MBAS assay is an ASTM International standard technique for detecting anionic surfactants. These include carboxylates, phosphates, sulfates, and sulfonates. An MBAS assay alone does not, however, identify specific surfactants. ASTM withdrew the standard (ASTM D2330-02) in 2011 pending a review and update of the method, which was last approved in 2003.
The publication Standard Methods for the Examination of Water and Wastewater lists the following methods used by certified laboratories testing wastewater in the United States.
* Method 5540B describes surfactant separation by sublation. 
* Method 5540C discusses anionic surfactants as methylene blue active substances (MBAS). 
* Method 5540D discusses nonionic surfactants as cobalt thiocyanate active substances (CTAS).