In order to clarify the influence of different electron-withdrawing groups on the electronic structures and memory properties of naphthalimides, three 1,8-naphthalimides, namely N-(4-triphenylamino)-1,8-naphthalimide (NA-ATPA), N-(4-triphenylamino)-(4-cyano)-1,8-naphthalimide (NA(CN)-ATPA) and N-(4-triphenylamine)-(4-nitro)-1,8-naphthalimide (NA(NO2)-ATPA), were designed and synthesized using triphenylamine (TPA) as the electron donor and 1,8-naphthalene dianhydride containing different electron-withdrawing moieties (-H,-CN,-NO2) as the electron acceptor. The photophysical properties and electrochemical characteristics of the compounds were investigated by ultraviolet-visible spectroscopy (UV-Vis), fluorescence spectroscopy (FL) and cyclic voltammetry (CyV). The synthesized products were applied as the active layer in sandwich devices, whose memory characteristics were tested. NA-ATPA shows volatile static random access memory (SRAM) behavior, while NACN-ATPA and NANO2-ATPA show nonvolatile flash and write-once read-many times memory (WORM) behavior, respectively. Experimental results indicated that the synthesized compounds possessed small energy gaps and wide absorption ranges. The introduction of electron-withdrawing groups on the 4-position of the 1,8-naphthalimides reduced the LUMO energy level and the energy gap, leading to improved stability of the charge-transfer state and volatile-to-nonvolatile memory transfer. To elucidate the switching mechanism, molecular simulation results, including molecular orbitals, energy levels, optimized geometries, and Mulliken charge populations, were discussed.