Rust is a compound. It is formed when iron comes into contact with oxygen and water. The chemical formula for rust is Fe2O3·xH2O, where x varies depending on the amount of water present. Rust is a reddish-brown material that is brittle and flaky. It is not magnetic, unlike iron.