An absolute position detection apparatus comprising: a scale with a main track and a sub track, each having two types of periodic patterns with different pitches (P1, P2, Q1, Q2); a sensor configured to output two sine wave detection signals with a 90° phase difference, each detection signal corresponding to the types of periodic patterns of the main track and the sub track, respectively, according to a relative movement between the scale and the sensor; and a calculator (23, 24) configured to generate, based on phase information which corresponds to the relative movement and is acquired by arctangent transformation of the two sine wave detection signals with the 90° phase difference, a first signal having a detection unit set to a first relative movement amount between the scale and the sensor, and a second signal having a detection unit set to a second relative movement amount, smaller than the first relative movement amount, between the scale and the sensor, the first signal indicating the first relative movement amount, corresponding to a plurality of consecutive second signals indicating the second relative movement amount, to determine, as a code corresponding to each of the plurality of second signals, a relationship between the first signal and the plurality of second signals by comparing the first signal and the plurality of second signals, and to obtain an absolute position in a relative movement direction of the scale and the sensor, based on the first and second signals, characterized in that a relative movement range of the scale and the sensor includes a boundary which is a repetition part of adjacent detection units in the first signal, the absolute position detection apparatus further comprises a first photo-interrupter (30_1) and a second photo-interrupter (30_2) respectively configured to output a signal for determining a plurality of areas set in the relative movement range, the first photo-interrupter and the second photo-interrupter are provided such that at most one of the respective boundaries of the first signal is included inside both ends of each of the plurality of areas, in each of the plurality of areas, the code of each detection unit of the second signal is different from each other, and in that the calculator is configured to specify a detection unit of the first signal to be used to calculate the absolute position, based on the code of each detection unit of the second signal in an area, that includes the boundary of the first signal inside both ends, of the plurality of areas. a scale with a main track and a sub track, each having two types of periodic patterns with different pitches (P1, P2, Q1, Q2); a sensor configured to output two sine wave detection signals with a 90° phase difference, each detection signal corresponding to the types of periodic patterns of the main track and the sub track, respectively, according to a relative movement between the scale and the sensor; and a calculator (23, 24) configured to generate, based on phase information which corresponds to the relative movement and is acquired by arctangent transformation of the two sine wave detection signals with the 90° phase difference, a first signal having a detection unit set to a first relative movement amount between the scale and the sensor, and a second signal having a detection unit set to a second relative movement amount, smaller than the first relative movement amount, between the scale and the sensor, the first signal indicating the first relative movement amount, corresponding to a plurality of consecutive second signals indicating the second relative movement amount, to determine, as a code corresponding to each of the plurality of second signals, a relationship between the first signal and the plurality of second signals by comparing the first signal and the plurality of second signals, and to obtain an absolute position in a relative movement direction of the scale and the sensor, based on the first and second signals, characterized in that a relative movement range of the scale and the sensor includes a boundary which is a repetition part of adjacent detection units in the first signal, the absolute position detection apparatus further comprises a first photo-interrupter (30_1) and a second photo-interrupter (30_2) respectively configured to output a signal for determining a plurality of areas set in the relative movement range, the first photo-interrupter and the second photo-interrupter are provided such that at most one of the respective boundaries of the first signal is included inside both ends of each of the plurality of areas, in each of the plurality of areas, the code of each detection unit of the second signal is different from each other, and in that the calculator is configured to specify a detection unit of the first signal to be used to calculate the absolute position, based on the code of each detection unit of the second signal in an area, that includes the boundary of the first signal inside both ends, of the plurality of areas.