The miniaturization of quantum sensors is a popular trend for the development of quantum technology. One of the key components of these sensors is a coil which is used for spin modulation and manipulation. The bi-planar coils have the advantage of producing three-dimensional magnetic fields with only two planes of current confinement, whereas the traditional Helmholtz coils require three-dimensional current distribution. Thus, the bi-planar coils are compatible with the current micro-fabrication process and are quite suitable for the compact design of the chip-scale atomic devices that require stable or modulated magnetic fields. This paper presents a design of a miniature bi-planar coil. Both the magnetic fields produced by the coils and their inhomogeneities were designed theoretically. The magnetic field gradient is a crucial parameter for the coils, especially for generating magnetic fields in very small areas. We used a NMR (Nuclear Magnetic Resonance) method based on the relaxation of 131Xe nuclear spins to measure the magnetic field gradient in situ. This is the first time that the field inhomogeneities of the field of such small bi-planar coils have been measured. Our results indicate that the designed gradient caused error is 0.08 for the By and the Bx coils, and the measured gradient caused error using the nuclear spin relaxation method is 0.09±0.02, suggesting that our method is suitable for measuring gradients. Due to the poor sensitivity of our magnetometer under a large Bz bias field, we could not measure the Bz magnetic field gradient. Our method also helps to improve the gradients of the miniature bi-planar coil design, which is critical for chip-scale atomic devices.