The resistance switching characteristics of Ni/HfOx /Ni capacitor structures with CF 4/O 2 plasma post-treatment of different gas flow rate ratios were investigated. The HfOx film was deposited by an electron-gun evaporator, followed by the CF 4/O 2 plasma post-treatment with different gas flow rate ratios. According to the filament model, conducting filaments (CFs) are formed by the percolation of various types of defects such as oxygen ions and oxygen vacancies. Moreover, the incorporation of oxygen/fluorine may terminate the oxygen vacancies to form Hf-F bonds and eliminate both fixed and interface traps, which can help to form fixed CFs in the film owing to local stronger Hf-F bonds. In this work, the improvement in the stability of resistance switching and current in the high-resistance state (HRS) was achieved by suitable plasma posttreatment. This may be attributed to the formation of Hf-F bonds as observed through electron spectroscopy for chemical analysis.