A micrometer comprising: a U-shaped frame; an anvil fixed to one end of the frame; a spindle that is screwed to the other end of the frame and is advanced and retracted relative to the anvil; an encoder that detects a displacement of the spindle; a display that displays a measurement value obtained by processing a detection value detected by the encoder; a deformation detecting section that detects a deformation of the frame; a storage that stores as a compensation factor a change amount of the detection value per a unit deformation detected by the deformation detecting section; a compensation factor setting section that, while the spindle is in contact with the anvil or an object to be measured by different first and second measurement forces, retrieves a first detection value and a second detection value which are detected by the encoder and a first deformation and a second deformation which are detected by the deformation detecting section, calculates a value obtained by dividing a difference between the first and second detection values by a difference between the first and second deformations as the compensation factor, and stores the compensation factor in the storage; and a compensator that compensates the detection value based on a difference between a zeroset-time deformation that is detected by the deformation detecting section when a command for zeroset is given and a measurement-time deformation that is detected by the deformation detecting section in measurement, and based on the compensation factor stored in the storage, wherein the other end of the frame is provided with an inner sleeve in which the spindle is rotatably screwed, and the deformation detecting section is provided by a strain gauge disposed in the inner sleeve. a U-shaped frame; an anvil fixed to one end of the frame; a spindle that is screwed to the other end of the frame and is advanced and retracted relative to the anvil; an encoder that detects a displacement of the spindle; a display that displays a measurement value obtained by processing a detection value detected by the encoder; a deformation detecting section that detects a deformation of the frame; a storage that stores as a compensation factor a change amount of the detection value per a unit deformation detected by the deformation detecting section; a compensation factor setting section that, while the spindle is in contact with the anvil or an object to be measured by different first and second measurement forces, retrieves a first detection value and a second detection value which are detected by the encoder and a first deformation and a second deformation which are detected by the deformation detecting section, calculates a value obtained by dividing a difference between the first and second detection values by a difference between the first and second deformations as the compensation factor, and stores the compensation factor in the storage; and a compensator that compensates the detection value based on a difference between a zeroset-time deformation that is detected by the deformation detecting section when a command for zeroset is given and a measurement-time deformation that is detected by the deformation detecting section in measurement, and based on the compensation factor stored in the storage, wherein the other end of the frame is provided with an inner sleeve in which the spindle is rotatably screwed, and the deformation detecting section is provided by a strain gauge disposed in the inner sleeve.