Resistive random-access memory (ReRAM) devices are currently the object of extensive research to replace flash non-volatile memory. However, elucidation of the conductive-filament formation mechanisms in ReRAM devices at nanoscale is mandatory. In this study, the different states created under real operation conditions of HfO 2 -based ReRAM devices are characterized through transmission electron microscopy and electron energy-loss spectroscopy. The physical mechanism behind the conductive-filament formation in Ni/HfO 2 /Si ReRAM devices based on the diffusion of Ni from the electrode to the Si substrate and of Si from the substrate to the electrode through the HfO 2 layer is demonstrated.