The short answer
A magnetar is a type of neutron star with a magnetic field roughly 10¹⁵ gauss — a trillion times stronger than Earth's. These fields power intense bursts of X-rays and gamma rays, and the star's crust periodically cracks under magnetic stress, producing starquakes.
What makes a magnetar different from a pulsar
Both magnetars and pulsars are neutron stars — the ultra-dense remnants of massive stars that exploded as supernovae. A typical pulsar has a magnetic field of about 10¹² gauss and emits radiation powered by its rapid rotation. A magnetar's field is roughly 1,000 times stronger. Instead of rotation, the energy source is the decay and rearrangement of the magnetic field itself.
Magnetic field strength in context
Earth's magnetic field is about 0.5 gauss. A hospital MRI machine produces ~30,000 gauss. A typical neutron star has ~10¹² gauss. A magnetar reaches ~10¹⁵ gauss. At this intensity, the vacuum of space itself becomes birefringent (light travels at different speeds depending on polarisation), and atoms are deformed into long, thin cylinders. No laboratory on Earth can reproduce these conditions.
Starquakes and giant flares
A magnetar's crust is a rigid crystal lattice of neutron-rich nuclei. As the internal magnetic field evolves, it builds stress in the crust until it fractures — producing a starquake. The resulting gamma-ray burst can outshine the entire galaxy for a fraction of a second. The giant flare from SGR 1806-20 on 27 December 2004 was the brightest extrasolar event ever recorded, briefly ionising Earth's upper atmosphere from 50,000 light-years away.
Soft gamma repeaters and how magnetars form
Magnetars were first identified through their repeated bursts of soft gamma rays — hence the name soft gamma repeaters (SGRs). They are thought to form from the core collapse of massive stars with particularly strong initial magnetic fields or rapid core rotation rates. The magnetar phase lasts only about 10,000 years before the field decays below the threshold for burst activity. After that, the object becomes an ordinary, radio-quiet neutron star.