An absolute encoder comprising: a scale on which a plurality of marks (1a, 1c) are arrayed at a period with a gap following each mark, the plurality of marks comprising code marks of at least two types, wherein each type of code mark corresponds to a code value of a multilevel absolute code and the code marks are arrayed with the gaps in between so as to embed a plurality of the multilevel absolute code in a track of the scale; a plurality of detecting devices (5a,5b) each configured to detect consecutive n marks of the plurality of marks as a mark group and output a signal corresponding to the mark group; wherein the plurality of marks are arrayed in the track such that magnitudes of signals of the plurality of detecting devices with respect to an i-th mark, i being one of 1, 2,..., n, of the mark group are complementary to one another; and wherein the plurality of marks are arrayed in the track such that subtracting, from one of a plurality of signals respectively output from the plurality of detecting devices, the other signal(s) of the plurality of signals generates a code determination signal and adding the plurality of signals generates a periodic signal, the absolute encoder further comprising: a processor configured to obtain an absolute coordinate of the scale based on outputs of the plurality of detecting devices, wherein the processor is configured to obtain first position data based on the code determination signal, obtain second position data having a resolution higher than that of the first position data based on a phase of the periodic signal, and generate data representing the absolute coordinate based on the first position data and the second position data. a scale on which a plurality of marks (1a, 1c) are arrayed at a period with a gap following each mark, the plurality of marks comprising code marks of at least two types, wherein each type of code mark corresponds to a code value of a multilevel absolute code and the code marks are arrayed with the gaps in between so as to embed a plurality of the multilevel absolute code in a track of the scale; a plurality of detecting devices (5a,5b) each configured to detect consecutive n marks of the plurality of marks as a mark group and output a signal corresponding to the mark group; wherein the plurality of marks are arrayed in the track such that magnitudes of signals of the plurality of detecting devices with respect to an i-th mark, i being one of 1, 2,..., n, of the mark group are complementary to one another; and wherein the plurality of marks are arrayed in the track such that subtracting, from one of a plurality of signals respectively output from the plurality of detecting devices, the other signal(s) of the plurality of signals generates a code determination signal and adding the plurality of signals generates a periodic signal, the absolute encoder further comprising: a processor configured to obtain an absolute coordinate of the scale based on outputs of the plurality of detecting devices, wherein the processor is configured to obtain first position data based on the code determination signal, obtain second position data having a resolution higher than that of the first position data based on a phase of the periodic signal, and generate data representing the absolute coordinate based on the first position data and the second position data. a processor configured to obtain an absolute coordinate of the scale based on outputs of the plurality of detecting devices, wherein the processor is configured to obtain first position data based on the code determination signal, obtain second position data having a resolution higher than that of the first position data based on a phase of the periodic signal, and generate data representing the absolute coordinate based on the first position data and the second position data.