A magnetar is a type of neutron star believed to have an extremely powerful magnetic field (∼109 to 1011 T, ∼1013 to 1015 G). The magnetic-field decay powers the emission of high-energy electromagnetic radiation, particularly X-rays and gamma rays. The theory regarding these objects was proposed in 1992 by Robert Duncan and Christopher Thompson. The theory was subsequently developed by Bohdan Paczyński and by its proposers. This theory explained a burst of gamma rays from the Large Magellanic Cloud that had been detected on March 5, 1979, and other less bright bursts from within our galaxy. During the following decade, the magnetar hypothesis became widely accepted as a likely explanation for soft gamma repeaters (SGRs) and anomalous X-ray pulsars (AXPs). In 2020, a fast radio burst (FRB) was detected from a magnetar.

Magnetars are characterized by their extremely powerful magnetic fields of ∼109 to 1011 T. These magnetic fields are a hundred million times stronger than any man-made magnet, and about a trillion times more powerful than the field surrounding Earth. Earth has a geomagnetic field of 30–60 microteslas, and a neodymium-based, rare-earth magnet has a field of about 1.25 tesla, with a magnetic energy density of 4.0 × 105 J/m3. A magnetar's 1010 tesla field, by contrast, has an energy density of 4.0 × 1025 J/m3, with an E/c2 mass density more than 10,000 times that of lead. The magnetic field of a magnetar would be lethal even at a distance of 1,000 km due to the strong magnetic field distorting the electron clouds of the subject's constituent atoms, rendering the chemistry of life impossible. At a distance of halfway from Earth to the moon, an average distance between the Earth and the Moon being 384,400 km (238,900 miles), a magnetar could strip information from the magnetic stripes of all credit cards on Earth. As of 2010, they are the most powerful magnetic objects detected throughout the universe.