Magnetite is one of the main iron ores, with the chemical formula Fe3O4. It is the most magnetic of all the naturally occurring minerals on Earth. Small grains of magnetite are very common in igneous and metamorphic rocks.