An encoder includes an absolute pattern, a light source, and a plurality of light reception elements. The absolute pattern is disposed in a measurement direction. The light source is configured to emit light to the absolute pattern. The plurality of light reception elements are arranged in the measurement direction and configured to receive the light emitted from the light source and transmitted through or reflected by the absolute pattern. The plurality of light reception elements include at least one first light reception element having an edge in the measurement direction. The edge is inclined relative to a width direction perpendicular to the measurement direction.