Helmholtz coils are one of the common methods for generating a uniform magnetic field. The coil spacing of the conventional square Helmholtz coils satisfies a certain relationship with the coil side length, that is, the spacing is 0.5445 times the side length. The derivation of the relationship satisfies that the first and second derivatives of the central point magnetic field are zero, but does not consider the uniformity of the magnetic field in the entire three-dimensional using space. In this paper, aiming at the maximum uniformity of the three-dimensional space magnetic field, the coil spacing corresponding to different using space is calculated numerically, and the functional expression of different using space and coil spacing is fitted with mathematical functions. Finally, the uniformity of the conventional Helmholtz coils and the dual-coil system designed in this paper is compared from different angles, and the effect is better than that of conventional Helmholtz coils. The method in this paper has certain reference value for designing only double coils to improve magnetic field uniformity in different using space.