A workpiece length measurement device comprises a left limit switch, a transmission mechanism, a sliding body, a photoelectric switch, a right limit switch, a stepper motor, a calibration scaleplate, an encoder, a controller and an industrial personal computer, wherein the transmission mechanism comprises a conveying belt and a transmission device. By shielding or reflecting light beams emitted by the photoelectric switch through a measured object, whether the object exists or not is detected; the length or the width of the measured object is detected through the photoelectric switch sliding along with the sliding body. The moving distance of the photoelectric switch can be conveniently acquired through the number of pulses of the encoder, and therefore the length of the measured object can be measured. In order to solve the problem that the length of the measured object is irrelevant to the photoelectric switch, the stepper motor and other parameters and make the measurement device be popularized and adapt to the measured object easily, real-time calibration is achieved by adding the calibration scaleplate, and the workpiece length measurement device can be accurately used permanently. The workpiece length measurement device not only is convenient to install and low in cost but also is high in measurement accuracy, stable and reliable in running, and convenient to popularize for use.