The invention discloses an automatic analyzer for an anionic surfactant in water, which comprises an automatic sampling device, a peristaltic pump, a detector and a sample processing assembly, wherein the sample processing assembly comprises a sample filling valve, knotted reactors, a three-way valve, a four-way valve, chemically inert microporous hydrophobic film on-line extraction modules, and a capillary connecting pipe; and one port of the sample filling valve is connected with a flask for carrying current, and the other port is orderly connected with a first knotted reactor, a first chemically inert microporous hydrophobic film on-line extraction module, a second knotted reactor, a second chemically inert microporous hydrophobic film on-line extraction module, the four-way valve, a flow cell, the detector and a computer processing system. The automatic analyzer can continuously and automatically test samples, has high test speed, the frequency of detecting samples of 18 samples/hour, high test sensitivity and good test accuracy, and uses the on-line double extraction modes to have strong interference resistance; and most inorganic ions such as SCN-, CN-, NO3-, Cl-, F-, Br- and the like are not interfered when the concentration is 1,000mg/L.