NiOx thin film exhibited excellent bistable unipolar resistive switching (RS), which has a high potential in nanoscale nonvolatile-memory applications. The underlying reaction of RS in NiOx is still in debate. We studied the chemical bonding states of Ni 2p and O 1s at high/low resistance spots using focused x-ray photoelectron spectroscopy. The disproportionation and comproportionation reactions of 3NiONi+ Ni2 O3 accounted for the RS of NiOx. The calculated Gibbs energy of the reaction interpreted its reversibility in thermodynamics. The expansion and contraction of the filaments with switching were observed by conducting atomic force microscopy. ? 2011 American Institute of Physics.