The invention relates to a torque sensor device based on fiber gratings. The device comprises the fiber gratings, an input shaft having the same axis as the fiber grating, a torsion rod and an outputshaft, wherein two ends of the torsion rod are connected with the input shaft and the output shaft through a spline, one end of the input shaft is provided with partially-annular projections symmetricto the axis, an outer circumferential surface of one end of the output shaft is provided with a groove, fiber is tensioned in a straight line mode and is tangent to the output shaft, two ends of thefiber are fixed with the partially-annular projections, the middle of the fiber is fixed on the groove, two suspended gratings are uniformly distributed among three fiber fixing points, and a tail fiber fits the surface of the input shaft, is led out along the surface of the input shaft and is then connected with a rotary connector. The device is advantaged in that a relative torsion angle is converted into stretching or compression deflection of the fiber, torque can be acquired through measuring wavelength drift amount of the fiber grating, measurement is simple and easy, anti-electromagnetic interference and temperature compensation functions are realized, sensitivity is high, and signal stability is further realized.