 The Earth and most of the planets in the Solar System, as well as the Sun and other stars, all generate magnetic fields through the motion of electrically conducting fluids.The Earth's field originates in its core.This is a region of iron alloys extending to about 3400 km (the radius of the Earth is 6370 km).