Anomalous X-ray pulsars (AXPs) and Soft gamma repeaters (SGRs) form together a single class of astrophysical sources, commonly associated to magnetars. New-generation X-ray polarimeters will play a key role in assessing the nature of these sources by directly probing the star magnetic field. In the highly magnetized environment radiation is expected to be strongly polarized and such a measure will be easily within reach of IXPE and eXTP. Polarization measurements will eventually confirm the presence of ultra-strong magnetic fields, probing the magnetar scenario. In this work we will discuss theoretical expectations for the polarization signature of AXPs and SGRs and present numerical simulations for the detector response of the polarimeters currently under construction. We will also show how these sources can be used to test vacuum birefringence, a QED effect predicted by Heisemberg and Euler in the Thirties and not experimentally verified as yet