Compared with detection methods such as gas chromatography analysis and physical and chemical sensing of dissolved gas in oil, the utilization of spectroscopy to detect dissolved gas in transformer oil has the advantages of non-contact, strong electromagnetic interference resistance, calibration-free, etc., and future applications prospect is favored by industry and academia. Aiming at the shortcomings of traditional transformer oil chromatographic analysis, such as large errors, tedious process steps, and long detection cycles, this paper presents a novel online detection method for dissolved gases in transformer oil based on photoacoustic spectroscopy, and develops a novel detection method based on online detection and analysis system was successfully applied to a 220 kV transformer in a city. The comparison of its historical detection data verified the effectiveness of the online detection method and the stability of the developed online detection system.