Herein, an anticorrosive and hydrophobic surface for Ti–6Al–4V was prepared through one-step anodic etching. The results showed that wettability was adjusted by current density and etching time. In particular, the maximum water contact angle (WCA) reached ~ 160.9° at a current density of 0.25 A cm−2 for 420 s. Energy dispersive spectroscopy and X-ray photoelectron spectroscopy showed the existence of spontaneous surface passivation, which was also verified by Tafel curves. In addition, Ecorr and icorr exhibited good anticorrosion properties on the surface of the Ti–6Al–4V after anodic etching. Furthermore, the change in surface adhesion was consistent with the change in the WCA after anodic etching. In conclusion, the one-step anodic etching can provide a convenient way to realize anticorrosion and superhydrophobic Ti–6Al–4V surface.