Planetary MagnetsPlanets have magnetic fields that start deep inside themselves.
Not every planet has a magnetic field. It takes special conditions to make a magnetic field within a planet. Scientists are fairly certain that there are two essential ingredients for making a magnetic field. Those two ingredients are magnetic material deep within the planet and currents moving inside the magnetic material.
Mercury, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune are known to have magnetic fields. Venus is a special case of a rocky planet with no magnetic field.