The invention discloses a poisonous and harmful gas concentration on-line testing method. The method comprises 1, starting a broadband light source, and respectively transmitting the broadband light beam into a measurement gas chamber and a reference gas chamber, 2, detecting light transmission intensity of the reference gas chamber by an optical detector and transmitting a signal into a divider, 3, shooting broadband light into the measurement gas chamber, detecting light intensity by the optical detector, carrying out treatment by a light detector and a digital lock-in-amplifier and transmitting the signal into the divider, 4, scanning oscillator frequency by a sweep generator, and setting doubled modulation frequency as a reference signal by a frequency doubler, 5, separating alternating current and direct current parts of a gas concentration electrical signal by a circuit of the optical detector, and feeding the alternating current part into the digital lock-in-amplifier, and 6, carrying out treatment by a gas concentration computing model to obtain a concentration value of gas to be detected and outputting and displaying the concentration value of the gas. The poisonous and harmful gas concentration on-line testing method can effectively improve a measurement precision of poisonous and harmful gas and has measurement safety and reliability.