The effect of primordial magnetic fields on X-ray and Sunyaev–Zel’divich (S-Z) galaxy cluster surveys is investigated. After the recombination epoch, primordial magnetic fields generated density fluctuations, and such density fluctuations enhanced the number of galaxy clusters. Taking into account the density fluctuations generated by these primordial magnetic fields, we calculated the expected number of galaxy clusters based on the Press–Schechter formalism. By comparing the results with observations from the Chandra X-ray galaxy cluster survey, we found that the amplitude of the primordial magnetic fields cannot have been larger than 10 nG. Moreover, we show that S-Z cluster surveys are also sensitive enough to constrain the amplitude of primordial magnetic fields. In particular, the SPT S-Z cluster survey can constrain the amplitude to several nano-gauss.