In this paper, a novel active shimming method is proposed to minimize the shim coil–magnet and the shim coil–shim coil magnetic couplings simultaneously. In standard superconducting shim coil designs, each shim coil is usually designed individually to correct specific field harmonic components of the inhomogeneous field without considering the magnetic couplings among the shim coils and the main magnet. In particular, a strong interaction among the zonal shim coils and the main magnet can lead to a series of problems, like the drift of main field, instability of field homogeneity, and even destruction of coils. In this paper, magnetic decoupling techniques for reducing magnetic interactions among the zonal shim coils and the main magnet are developed. To complete a set of independent shim coils design, a nonlinear optimization model considering the field deviation and magnetic coupling is established. To improve the efficiency and solution quality of the involved optimization problem, the nonlinear model is first converted to a linear one by using the McCormick envelopes scheme. Through linear programming (LP), the optimal topology and preliminary positions of the shim coils are determined. To further optimize the position and turn numbers of the shim coil, a nonlinear programming (NLP) is then implemented to achieve desired field uniformity. In order to verify the feasibility and effectiveness of the proposed method, a simulation design of two sets of shim coils, Z2 and Z4, for a practical 9.4T magnet for whole-body magnetic resonance imaging (MRI) is presented. Compared with coils designed by conventional methods, magnetic coupling between the zonal shim coils and the main magnet had been effectively reduced. And also, magnetic coupling between the zonal shim coils had also been minimized as much as possible, which consequently improve the stability and safety of the MRI magnet system.