The invention discloses a spectral analysis type high-precision on-line detector for gas and liquid detection. The spectral analysis type high-precision on-line detector comprises a detection sensor probe, a detector host, and a laser device, a circuit board and a power supply battery which are mounted in a detector host shell, and a display screen, an alarm device and a communication interface which are arranged outside the shell. By the adoption of a light intensity modulation technology, and due to concentration calculation on a modulation spectrum subjected to wavelet analysis, the spectral analysis type high-precision on-line detector for gas and liquid detection has the characteristics of high detection sensitivity, high detection stability, short detection time, high detection precision and the like. According to the on-line detector, an optical fiber is connected with the detection sensor probe, so that the distance can be 4KM; the detector can be used in a fixed or portable state; when the detector is applied to gas detection, (a single or multiple serial connected) handheld, open and fixed gas probes can be adopted.