A wire electrical discharge machine having functions of relatively moving an object and a wire electrode supported by upper and lower wire guides and positioning the wire electrode or measuring the shape of the object based on a contact/non-contact state of the wire electrode and the object, the wire electrical discharge machine comprising: a voltage applying unit configured to apply a detection voltage between the wire electrode and the object for detecting the contact/non-contact state of the wire electrode and the object; a relative movement unit for relatively moving the wire electrode and the object; a wire electrode position detecting unit for detecting a center position of the wire electrode; a contact state detecting unit configured to detect the voltage between the wire electrode and the object in the course of relative movement of the wire electrode toward and away from the object by the relative movement unit and detect the contact/non-contact state of the wire electrode and the object based on the detected voltage; an end face determination position detecting unit configured to detect an end face determination position in which the wire electrode is determined to be in contact with an end face of the object, based on the contact/non-contact state detected by the contact state detecting unit and the position of the wire electrode detected by the wire electrode position detecting unit, the wire electrical discharge machine being characterized in that it further comprises: a wire electrode diameter storage unit for storing the diameter of the wire electrode; a wire electrode displacement amount storage unit for storing an amount of displacement such that the wire electrode is displaceable between the upper and lower wire guides in a direction perpendicular to a line segment connecting the upper and lower wire guides; an end face determination position compensation unit configured to obtain a reference position by compensation of the end face determination position based on a compensation value obtained from the wire electrode diameter and the displacement amount, wherein the wire electrical discharge machine is configured to position the wire electrode or to measure the shape of the object based on the reference position obtained by the end face determination position compensation unit as a position of the object. a voltage applying unit configured to apply a detection voltage between the wire electrode and the object for detecting the contact/non-contact state of the wire electrode and the object; a relative movement unit for relatively moving the wire electrode and the object; a wire electrode position detecting unit for detecting a center position of the wire electrode; a contact state detecting unit configured to detect the voltage between the wire electrode and the object in the course of relative movement of the wire electrode toward and away from the object by the relative movement unit and detect the contact/non-contact state of the wire electrode and the object based on the detected voltage; an end face determination position detecting unit configured to detect an end face determination position in which the wire electrode is determined to be in contact with an end face of the object, based on the contact/non-contact state detected by the contact state detecting unit and the position of the wire electrode detected by the wire electrode position detecting unit, the wire electrical discharge machine being characterized in that it further comprises: a wire electrode diameter storage unit for storing the diameter of the wire electrode; a wire electrode displacement amount storage unit for storing an amount of displacement such that the wire electrode is displaceable between the upper and lower wire guides in a direction perpendicular to a line segment connecting the upper and lower wire guides; an end face determination position compensation unit configured to obtain a reference position by compensation of the end face determination position based on a compensation value obtained from the wire electrode diameter and the displacement amount, wherein the wire electrical discharge machine is configured to position the wire electrode or to measure the shape of the object based on the reference position obtained by the end face determination position compensation unit as a position of the object.