The invention relates to the technical field of pH detection, and provides an online pH detection and automatic cleaning instrument which comprises a box body, a pH display controller and a working module, the pH display controller and the working module are arranged in the box body, a circulation groove is fixed in the box body, a pH
electrode is fixed on the inner side of the top of the circulation groove, and a
water sample inlet, an acid liquor inlet, a
tap water inlet and a water outlet are formed in the outer side of the box body; the pH value of a
water sample can be measured, the electrodes can be cleaned in time,
dirt, precipitates, biological membranes and other impurities on the surfaces of the circulating groove and the electrodes can be removed, interference of the substances on
pH measurement is prevented, the accuracy and reliability of a measurement result are ensured, the risk that the electrodes are damaged due to
pollution is reduced, and the service life of the
water sample is prolonged. Compared with the prior art, maintenance cost and replacement frequency of the equipment are reduced, regular automatic cleaning can be achieved, the good state of the equipment can be kept, stable performance of the equipment can be kept for a long time, frequent manual disassembly and cleaning of the
electrode are not needed, and manpower and
time cost are saved.