Nitinol (nickel-titanium) alloys have a unique property, superelasticity, which allows the manufacture of minimally invasive self-expanding stents. Nitinol is approximately composed of 50% nickel, which is known to be toxic. Therefore, corrosion resistance is key to the good biocompatibility of this material, especially considering the aggressive environment of the body. We tested the effects of the surface roughness and different passivation techniques on the corrosion resistance of nitinol using potentiodynamic measurements. Furthermore, we applied environmentally friendly treatments to nitinol, boiling in hydrogen peroxide and boiling in distilled water, which substantially improved the corrosion resistance. The effects of these treatments on the oxide layer composition and morphology was investigated using x-ray photoelectron spectroscopy, grazing incidence x-ray diffraction, and scanning electron microscopy. We found that due to these treatments a more homogeneous titanium dioxide oxide layer was formed. The pitting corrosion of nitinol was also observed in real time using a microscope. This gave us novel information about the spatial distribution of corrosion.