In this letter, we calculate numerically the emitter-collector gaps that maximize the power conversion efficiency of vacuum thermionic energy converters (TECs). The optimum arises because efficiency drops both at very large gaps, due to space-charge limitations on the TEC current, and at very small gaps, due to the increased parasitic heat loss via near-field radiative heat transfer. For typical TECs made with cesiated tungsten electrodes, the optimal gaps range from 900 nm to 3 mu m and are approximately equal to the characteristic wavelength of the emitter thermal radiation, as given by Wien's displacement law. (C) 2012 American Institute of Physics. [http://dx.doi.org/10.1063/1.4707379]