A wire electric discharge machine for performing distortion removing machining and configured to machine a workpiece by moving a wire electrode supported by upper and lower wire guides (14, 15), and the workpiece relatively to each other, the wire electric discharge machine configured by a numerical controller and a main body controlled by the numerical controller, and comprising: an axial movement control portion moving, after the machining is ended, relatively to the workpiece, the wire electrode from the machining end position to the machining start position along the machining path in the direction opposite to the machining direction; characterised by further comprising a contact detection portion detecting contact between the wire electrode and the workpiece at the time when the wire electrode is moved relatively to the workpiece in the direction opposite to the machining direction; and a contact position storage portion stopping, when the contact between the wire electrode and the workpiece is detected by the contact detection portion, the relative movement of the wire electrode, so as to store, as a contact position, the position of the wire electrode with respect to the workpiece at the time of detection of the contact; a non-contact position storage portion moving, after the contact position of the wire electrode is stored, the wire electrode in the offset direction relatively to the workpiece, and detecting, when the wire electrode and the workpiece are brought into a non-contact state, the non-contact state, and stopping the relative movement of the wire electrode, so as to store, as a non-contact position, the position of the wire electrode with respect to the workpiece at the time of detection of the non-contact state; a machining path return control portion moving, relatively to the workpiece, the wire electrode in the direction opposite to the offset direction from the non-contact position, and moving, relatively to the workpiece, the wire electrode in the direction opposite to the machining direction along the machining path by a predetermined distance while neglecting the detection of contact between the wire electrode and the workpiece by the contact detection portion; a distortion amount calculation portion calculating an amount of distortion of the workpiece from the contact position stored in the contact position storage portion, and the non-contact position stored in the non-contact position storage portion; and a distortion removing machining execution portion performing distortion removing machining at the time when a maximum value of the amounts of distortion calculated by the distortion amount calculation portion is larger than a value set beforehand. an axial movement control portion moving, after the machining is ended, relatively to the workpiece, the wire electrode from the machining end position to the machining start position along the machining path in the direction opposite to the machining direction; characterised by further comprising a contact detection portion detecting contact between the wire electrode and the workpiece at the time when the wire electrode is moved relatively to the workpiece in the direction opposite to the machining direction; and a contact position storage portion stopping, when the contact between the wire electrode and the workpiece is detected by the contact detection portion, the relative movement of the wire electrode, so as to store, as a contact position, the position of the wire electrode with respect to the workpiece at the time of detection of the contact; a non-contact position storage portion moving, after the contact position of the wire electrode is stored, the wire electrode in the offset direction relatively to the workpiece, and detecting, when the wire electrode and the workpiece are brought into a non-contact state, the non-contact state, and stopping the relative movement of the wire electrode, so as to store, as a non-contact position, the position of the wire electrode with respect to the workpiece at the time of detection of the non-contact state; a machining path return control portion moving, relatively to the workpiece, the wire electrode in the direction opposite to the offset direction from the non-contact position, and moving, relatively to the workpiece, the wire electrode in the direction opposite to the machining direction along the machining path by a predetermined distance while neglecting the detection of contact between the wire electrode and the workpiece by the contact detection portion; a distortion amount calculation portion calculating an amount of distortion of the workpiece from the contact position stored in the contact position storage portion, and the non-contact position stored in the non-contact position storage portion; and a distortion removing machining execution portion performing distortion removing machining at the time when a maximum value of the amounts of distortion calculated by the distortion amount calculation portion is larger than a value set beforehand.