We present constraints on the number of Galactic magnetars , which we have established by searching for sources with periodic variability in 506 archival Chandra observations and 441 archival XMM-Newton observations of the Galactic plane ( |b| < 5 ^ { \circ } ) . Our search revealed four sources with periodic variability on time scales of 200–5000 s , all of which are probably accreting white dwarfs . We identify 7 of 12 known Galactic magnetars , but find no new examples with periods between 5 and 20 s. We convert this non-detection into limits on the total number of Galactic magnetars by computing the fraction of the young Galactic stellar population that was included in our survey . We find that easily-detectable magnetars , modeled after persistent anomalous X-ray pulsars ( e.g. , either with X-ray luminosities L _ { X } = 3 \times 10 ^ { 33 } erg s ^ { -1 } [ 0.5–10.0 keV ] and fractional rms amplitudes A _ { rms } =70 % , or L _ { X } = 10 ^ { 35 } erg s ^ { -1 } and A _ { rms } =12 % ) , could have been identified in \approx 5 % of the Galactic spiral arms by mass . If we assume that there are 3 previously-known examples within our random survey , then there are 59 ^ { +92 } _ { -32 } in the Galaxy . Barely-detectable magnetars ( L _ { X } = 3 \times 10 ^ { 33 } erg s ^ { -1 } [ 0.5–10.0 keV ] and A _ { rms } = 15 % ) could have been identified throughout \approx 0.4 % of the spiral arms . The lack of new examples implies that < 540 exist in the Galaxy ( 90 % confidence ) . Similar constraints are found by considering the detectability of transient magnetars in outburst by current and past X-ray missions . For assumed lifetimes of 10 ^ { 4 } yr , we find that the birth rate of magnetars could range between 0.003 and 0.06 yr ^ { -1 } . Therefore , the birth rate of magnetars is at least 10 % of that for normal radio pulsars . The magnetar birth rate could exceed that of radio pulsars , unless the lifetimes of transient magnetars are \gtrsim 10 ^ { 5 } yr . Obtaining better constraints will require wide-field X-ray or radio searches for transient X-ray pulsars similar to XTE J1810–197 , AX J1845.0–0250 , CXOU J164710.2–455216 , and 1E 1547.0-5408 .