In magnetic fusion devices, unwanted non-axisymmetric magnetic eld perturbations, known as error fields (EF), can have detrimental effects on plasma stability and confinement. To minimize their impact on plasma performances and on the available operational space, it is important to identify the EF sources and develop EF control strategies. MAST Upgrade is a magnetic fusion device which will operate in the next future after a series of enhancements from the previous MAST experiment and will contribute to the mainstream program of the exhaust and fast particle physics [Morris A. W. et al, “MAST Accomplishments and Upgrade for Fusion Next-Steps” IEEE Transactions on Plasma Science, April 2014]. To deliver a machine with EF amplitude low enough to allow a high quality experimental programme, a careful analysis of the intrinsic EF sources in the divertor (D) and in the poloidal field (P) coils has been carried out. The 3D coil deformation has been characterized through high accuracy magnetic field measurements which reveal that the main EF harmonics have n=1 and n=2 toroidal mode numbers. Passive and active control strategies have been adopted to compensate them in preparation for MAST Upgrade operations. The passive EF control consisted in nding the optimal ne-scale alignment of D and P coils so as to minimize the intrinsic n=1 EF amplitude. The optimal coil alignment has been determined based on magnetic field measurements and the corresponding 3D electro-magnetic modelling. Conversely, active control will be adopted during MAST Upgrade operation to reduce the n=2 EF which is associated mainly to the manufacturing of P coils named P4 and P5 [Kirk A. et al 2014 Plasma Physics and Controlled Fusion 56 104003]. Since these coils have been re-used from the MAST device, the experience gained on n=2 EF control, from experimental studies and the corresponding ERGOS [Nardon E. et al 2007 J. Nucl. Mater. 363-365 1071] and MARS-F [Liu Y Q et al 2000 Phys. Plasmas 7 3681] modelling, has allowed the identification of the best n=2 EF control technique and to perform a model-based optimization of its control parameters in preparation to MAST Upgrade operation.