Wax deposition during the production and transportation of crude oil is a global problem in oil industries. Fabrication of underwater self-cleaning materials can provide a new strategy to prohibit wax deposition. In this paper, conversion films on carbon steel with hierarchical micro/nanostructure are fabricated through a novel in situ alternating-current deposition method. The flower-like conversion films are composed of amorphous iron phosphate and present superhydrophilicity in air and superoleophobicity underwater. The conversion films can efficiently prevent the deposition of wax in water-contained crude oil, showing excellent self-cleaning performance. This facile and low-cost fabrication of a self-cleaning film provides a good strategy for underwater-oil prevention.