The Magnetic field is the area around a magnet in which a magnetic force is exerted . Moving electric charges produce magnetic fields . A magnetic field is a field of force produced by moving electric charges , by electric fields that vary in time , and by the ` intrinsic ' magnetic field of elementary particles associated with the spin of the particle .