Abstract.We study the pumping of magnetic flux in three-dimensional compressible magnetoconvection in the context of stellar dynamos. The simulation domain represents a rectangular section from the lower part of a stellar convection zone plus the underlying stably stratified layer, with a total depth of up to five pressure scale heights. Once convection has attained a statistically stationary state, a magnetic field is introduced. The magnetic field is subsequently modified by the convective motions, and the resulting pumping effects are isolated by calculating various coefficients of the expansion of the electromotive force, u × b, in terms of components of the mean magnetic field. The dependence of the pumping effects on rotation, latitude and other parameters is studied. First numerical evidence is found for the existence of pumping effects in the horizontal directions. Evidence is found that the pumping effects act differently on different components of the mean magnetic field. Latitudinal pumping is mainly equatorward for a toroidal field, and can be poleward for a poloidal field. Longitudinal pumping is mainly retrograde for the radial field but prograde for the latitudinal field. The pumping effect in the vertical direction is found to be dominated by the diamagnetic effect, equivalent to a predominating downward advection with a maximum speed in the turbulent case of about 10% of the rms convective velocity. Where possible, an attempt is made to identify the physical origin of the effect. Finally, some consequences of the results for stellar dynamos are discussed.