A wire electric discharge machine having a machining tank for storing a machining liquid, wherein an object to be machined is placed on a table provided in the machining tank, and the object is machined by relatively moving a wire electrode with respect to the table on the basis of an instruction output from a controller, the wire electric discharge machine comprising: a combination of contact detection jigs (20, 30, 40, 50, 60) including a first contact detection jig having a first contact detection unit (22, 32, 42, 52, 62) and a second contact detection jig having a second contact detection unit (22, 32, 42, 52, 62), wherein the first and second contact detection jigs are arranged at a predetermined distance from each other on a same axial line on the table such that the first and second contact detection units face each other; a contact detection unit for detecting contact between the wire electrode and the first and second contact detection jigs (20, 30, 40, 50, 60); a coordinate value memory unit for respectively storing coordinate values of axes moved when the wire electrode comes into contact with the first and second contact detection jigs (20, 30, 40, 50, 60); a reference distance memory unit for causing the wire electrode to come into contact with the first and second contact detection jigs (20, 30, 40, 50, 60) under a first state in which a desired positioning accuracy can be obtained, and obtaining and storing, as a reference distance, a distance between the first contact detection jig and the second contact detection jig from the coordinate values when the wire electrode comes into contact with the first and second contact detection jigs, which are stored in the coordinate value memory unit; an actual distance memory unit for causing the wire electrode to come into contact with the first and second contact detection jigs (20, 30, 40, 50, 60) under a second state which is different from the first state, and storing, as an actual distance, a distance between the first contact detection jig and the second contact detection jig from the coordinate values when the wire electrode comes into contact with the first and second contact detection jigs, which are stored in the coordinate value memory unit; and a compensation unit for calculating a difference between the reference distance stored in the reference distance memory unit and the actual distance stored in the actual distance memory unit, and compensating the instruction according to the distance from the contact position coordinate so as to cancel the difference during actual machining. a combination of contact detection jigs (20, 30, 40, 50, 60) including a first contact detection jig having a first contact detection unit (22, 32, 42, 52, 62) and a second contact detection jig having a second contact detection unit (22, 32, 42, 52, 62), wherein the first and second contact detection jigs are arranged at a predetermined distance from each other on a same axial line on the table such that the first and second contact detection units face each other; a contact detection unit for detecting contact between the wire electrode and the first and second contact detection jigs (20, 30, 40, 50, 60); a coordinate value memory unit for respectively storing coordinate values of axes moved when the wire electrode comes into contact with the first and second contact detection jigs (20, 30, 40, 50, 60); a reference distance memory unit for causing the wire electrode to come into contact with the first and second contact detection jigs (20, 30, 40, 50, 60) under a first state in which a desired positioning accuracy can be obtained, and obtaining and storing, as a reference distance, a distance between the first contact detection jig and the second contact detection jig from the coordinate values when the wire electrode comes into contact with the first and second contact detection jigs, which are stored in the coordinate value memory unit; an actual distance memory unit for causing the wire electrode to come into contact with the first and second contact detection jigs (20, 30, 40, 50, 60) under a second state which is different from the first state, and storing, as an actual distance, a distance between the first contact detection jig and the second contact detection jig from the coordinate values when the wire electrode comes into contact with the first and second contact detection jigs, which are stored in the coordinate value memory unit; and a compensation unit for calculating a difference between the reference distance stored in the reference distance memory unit and the actual distance stored in the actual distance memory unit, and compensating the instruction according to the distance from the contact position coordinate so as to cancel the difference during actual machining.