The aim of the present study was to compare the effect of exposure to sodium hypochlorite (NaOCl) and ethylenediaminetetraacetic acid (EDTA) on the surface topography and roughness of HyFlex controlled memory (CM) and HyFlex electrical discharge machining (EDM) using atomic force microscopy (AFM). Twenty HyFlex EDM (25/.08) and 20 HyFlex CM (25/.06) files were divided into five groups (n = 4). One group served as a negative control group. The files in the other groups were exposed to 5.25% NaOCl and 17% EDTA solutions at 37 degrees C for 5 and 10 min, respectively, and examined using AFM after each exposure. The data were analyzed using one-way ANOVA test. The lowest values were observed in the control group of HyFlex EDM files (p < .05). The highest values were observed in the HyFlex EDM and HyFlex CM files immersed in EDTA for 10 min (p < .05). In conclusion, the tested irrigants had a significant negative effect on the surface porosity of NiTi files. The immersion of NiTi files in irrigants during cleaning and sterilization procedures results in corrosion and surface deformation of the files, and this can lead to unexpected file fracture during clinical use. Thus, the investigation of effect of ethylenediaminetetraacetic acid (EDTA) and sodium hypochlorite (NaOCl) on surface topography of HyFlex files is important.