We present photometric redshifts for ∼4 million galaxies detected in the Spitzer 3.6 or 4.5 μm bands of the Spitzer Extragalactic Representative Volume Survey (SERVS). The 18 deg 2 area of SERVS covers five extragalactic fields with a variety of ancillary, optical, and near-infrared (IR) photometry. We evaluate the accuracy of our photometric redshifts with ∼90.000 publicly available, spectroscopic redshifts. Overall, we find an average of ∼0.038 for the normalized median absolute deviation (σ NMAD), a measure similar to the standard deviation yet more robust against outliers, and outlier fraction η of 3.7 per cent for the sources with the widest wavelength coverage. On the example of the XMM field, we quantify the quality and reliability of photometric redshifts as a function of (1) the number of photometric bands available in the fitting, (2) i AB magnitude, (3) Infrared Array Camera (IRAC) 3.6 μm magnitude, (4) spectroscopic redshift, and (5) the survey origin of the spectroscopic redshift. The best results are achieved when the photometry available for the fitting covers rest-frame optical and near-IR wavelengths. σ NMAD and η are smallest for the brightest objects. Similarly, we find σ NMAD and η to be smaller on average at z < 1.5 than at z > 1.5. Photometric redshifts derived without the two IRAC filter bands, but detections in all other bands are slightly underestimated. Approximately 76 per cent of SERVS sources with at least five available filter bands lie between redshift 0 and ∼1.5. We find a tail of high-redshift galaxies, i.e. ∼7 per cent of all objects with at least five available filter bands for the fitting lie at z > 3. We discuss ways to improve upon the photometric redshifts for SERVS galaxies in the future.