We evaluated a method that determines the optimal grid parameters of potential-field data such as the intervals of grid nodes and the grid azimuth. Optimal grid parameters produced the best gridding results with the least amount of data distortions. We used spectral analysis of the data statistics on azimuth projections. The direction with the largest degree of periodicity was defined as the optimal azimuth of the grid. The grid line interval was determined according to the frequency point with the largest amplitude value. By spectral analysis of the data sequence projected in the direction normal to the survey lines, grid point spacing was also determined. Correlative analysis of the template matching method was used to determine the optimal grid range. Tests on simulated and field data proved that this method is rather robust and can be incorporated into gridding software packages.