Abstract: An encoder for measuring a relative position between two objects and including a scale support connected with one of the objects, and a scanning unit displaceable along the scale support and connected with the other of the two objects, either directly or by a carrier, by a coupling having a first coupling part attached to the scanning unit, a second coupling part attached to the other object and a carrier, and a third ball-shaped coupling part located between the facing each other surfaces of the two coupling parts and held in a constant contact with these facing surfaces by magnetic forces.