A magnetic anomaly detector (MAD) is a piece of equipment that is used to detect minute variations in the Earth's magnetic field. The term refers specifically to magnetometers used by military forces to detect submarines. Such a mass of ferromagnetic material disturbs the magnetic field and can be detected.

MAD devices are usually mounted on aircraft. In order to detect any anomaly, the aircraft aligns itself with the Earth's magnetic field, creating a constant and even 'noise' against which anomalies can be detected. To reduce interference from electrical equipment aboard the aircraft the 'MAD head' is placed out from the aircraft on a boom or towed device. Even so the aircraft must be very near the submarine's position to detect the change or anomaly. The detection range is normally related to the distance between the sensor and the submarine. The size of the submarine and its hull material composition also determines the detection range.

See also: Antisubmarine warfare