The invention relates to a security element for securing documents of value. Along the security element a portion of a magnetic coding with first and second coding elements is arranged. The coding elements are arranged along a predetermined direction, wherein the first coding element continuously has along the predetermined direction a first magnetic region with a first coercive field strength and the second coding element has at least one first gap region and one second magnetic region with a second coercive field strength. At least one of the first magnetic regions is directly adjacent to at least one of the second magnetic regions. The sum of the lengths of the directly adjacent first and second magnetic regions amounts to a maximum of 8 mm.