The chemical formula for rust is Fe2O3.nH2O. The overall chemical equation for the formulation of rust is iron + water + oxygen = rust. Fe(OH)3 dehydrates to produce Fe2O3.nH2O(s) or rust.
Rusting occurs as the corrosion of iron in the alloy steel. Steel is an alloy made of iron and carbon. Although the carbon atoms in steel increase the strength of the metal, it is the carbon atoms that decrease the ability of iron to resist corrosion. Steel loses its metallic properties in the presence of oxygen and water due to oxidation and produces reddish brown flakes that loosely adhere to the iron.