Forming voltage (V Form) and initial resistance of NiO-based resistive switching (RS) cells with various NiO films were investigated. Deposited NiO films were 〈111〉-oriented and the lattice constant was larger than that of bulk. It was revealed from XRD analyses that there were residual compressive stresses in NiO films. The magnitude of the residual stress was different among NiO films depending on their deposition conditions, and V Form monotonically increases with the increase in the magnitude of the residual stress. The relationship between V Form and the residual stress may be ascribed to the changes in the density of oxygen vacancies in NiO films. NiO films were also post annealed in Ar at 450°C. RS cells with annealed NiO films having small oxygen composition exhibited forming-free behavior, indicating the generation of conductive filaments by the annealing. The region whose lattice constant is smaller than that of bulk appeared after annealing only in such NiO films, suggesting that the small lattice-constant region may be linked to the generation of the filaments.