Protection of stainless steel from water, oxygen, and chloride ions is of crucial importance for diverse industrial fields; yet, it remains challenging to develop a proper solution with improved corrosion and oxidation resistance for long-term service durability. Here, we demonstrate the direct growth of hexagonal boron nitride (h-BN) nanofilms on the surface of stainless steel (ss304) by the magnetron sputtering method, serving as barrier coatings for protection in a corrosive environment. The obtained h-BN nanofilms are ∼200 nm in thickness, with a highly densified morphology, converting the hydrophilic surface of ss304 to a hydrophobic surface. These films exhibit excellent oxidation resistance at 600 °C in the atmosphere and enhanced anticorrosion performance as compared to the bare ss304. Moreover, they show robust and stable corrosion resistance when immersed in a 3.5 wt % NaCl electrolyte for over 10 weeks. The results suggest that the direct growth of h-BN nanofilms on ss304 holds great promise for corrosion inhibition and antioxidation of steel, therefore offering a feasible and effective route for long-term corrosion protection concerning practical applications of h-BN on industry-relevant surfaces.