Nonuniformities of magnetic field gradients can cause serious artifacts in diffusion imaging. While it is well known that nonlinearities of the imaging gradients lead to image warping, those imperfections can also cause spatially dependent errors in the direction and magnitude of the diffusion encoding. This study shows that the potential errors in diffusion imaging are considerable. Further, we show that retrospective corrections can be applied to reduce these errors. A general mathematical framework was formulated to characterize the contribution of gradient nonuniformities to diffusion experiments. The gradient field was approximated using spherical harmonic expansion, and this approximation was employed (after geometric distortions were eliminated) to predict and correct the errors in diffusion encoding. Before the corrections were made, the experiments clearly revealed marked deviations of the calculated diffusivity for fields of view (FOVs) generally used in diffusion experiments. These deviations were most significant farther away from the magnet's isocenter. For an FOV of 25 cm, the resultant errors in absolute diffusivity ranged from approximately -10% to +20%. Within the same FOV, the diffusion-encoding direction and the orientation of the calculated eigenvectors can be significantly altered if the perturbations by the gradient nonuniformities are not considered. With the proposed correction scheme, most of the errors introduced by gradient nonuniformities can be removed.