A sensor for measuring mechanical changes in length, in particular a compressive and/or tensile stress sensor, includes a sandwich system with two flat and superposed electrodes separated from each other by a tunnel element (tunnel barrier), in particular an oxide barrier, a current being set up between the electrodes and through the tunnel barrier, one electrode consisting of a magnetostrictive layer 3 which responds to elongation, and wherein the contributions of the anisotropies caused by mechanical tension are larger than those from the intrinsic anisotropies, relative changes in system resistance ΔR/R larger than 10% at room temperature being attained during elongation.