They are both forms of neutron stars, which average around 20km but are the densest objects known to man. Fun fact, one sugar cube of their material would weigh about as much as a mountain (https://imagine.gsfc.nasa.gov/science/objects/neutron_stars1...).
https://www.britannica.com/science/pulsar
https://en.m.wikipedia.org/wiki/Magnetar#Description
They are both forms of neutron stars, which average around 20km but are the densest objects known to man. Fun fact, one sugar cube of their material would weigh about as much as a mountain (https://imagine.gsfc.nasa.gov/science/objects/neutron_stars1...).