PURPOSE: To derive and implement a method for correcting spatial distortion caused by in vivo inhomogeneous static magnetic fields in echo-planar imaging (EPI). MATERIALS AND METHODS: The reversed gradient method, which was initially devised to correct distortion in images generated by spin-warp MRI, was adapted to correct distortion in EP images. This method provides point-by-point correction of distortion throughout the image. EP images, acquired with a 3 T MRI system, of a phantom and a volunteer's head were used to test the correction method. RESULTS: Good correction was observed in all cases. Spatial distortion in the uncorrected images ranged up to 4 pixels (12 mm) and was corrected successfully. CONCLUSION: The correction was improved by the application of a nonlinear interpolation scheme. The correction requires that two EP images be acquired at each slice position. This increases the acquisition time, but an improved signal-to-noise ratio (SNR) is seen in the corrected image. The local SNR gain decreases with increasing distortion. In many EPI acquisition schemes, multiple images are averaged at each slice position to increase the SNR; in such cases the reversed gradient correction method can be applied with no increase in acquisition duration.