The invention discloses a method for measuring the tooth profile deviation of a cylindrical gear based on linear structured light. According to the method, firstly a three-dimensional nominal mathematical model of the tooth surface of a measured gear is built; the structured light is formed by a series of equally spaced light spots, and the operation is performed based on characteristics of the structured light and within an effective value range of the structured light; a mathematical model of a gear tooth profile deviation item is built; and finally high-precision measurement for the tooth profile total deviation, the tooth profile slope deviation and the tooth profile shape deviation of the cylindrical gear is realized. According to the invention, detection for each tooth of the cylindrical gear in a complex environment can be realized, the measurement speed is high, and the efficiency is high; the method can adapt to detection for various types of cylindrical gears and does not have problems such as measuring head abrasion and radius compensation; the measurement accuracy can be improved through big data, the repeatability is good, and a shadow effect in gear detection is avoided. Tooth profile error calculation can be performed on all measured data transformed into a gear coordinate system, and the method is high in calculation speed.