This paper presents a novel method to prepare hydrophilic nanoporous functional surface with combined dealloying and annealing treatment to improve the corrosion resistance and biocompatibility of NiTi components. Surface modification mechanism is discussed with microscopic characterization of NiTi nanoporous structures. Hydrophilic and biocompatible performance is achieved through specifically tailoring the dimensions and chemical compositions of nanoporous layer. The corrosion resistance of NiTi samples is investigated in 0.9 wt% NaCl solution and evaluated with potentiodynamic polarization and electrochemical impedance spectroscopy tests. The results indicate that material corrosion resistance is significantly enhanced with TiO2 formation during dealloying treatment, while annealing promotes the oxidation and densification of dealloyed layer raising the energy barrier for ion transportation during corrosion. Furthermore, as the dealloying temperature increases, the surface defects of the sample decrease resulting in better corrosion resistance. The research can provide guidance for NiTi surface modification to enhance its biomedical applications.