Interacting quantum systems are expected to thermalize, but in some situations in the presence of disorder they can exist in localized states instead. This many-body localization is studied experimentally in a small system with programmable disorder. When a system thermalizes it loses all memory of its initial conditions. Even within a closed quantum system, subsystems usually thermalize using the rest of the system as a heat bath. Exceptions to quantum thermalization have been observed, but typically require inherent symmetries1,2 or noninteracting particles in the presence of static disorder3,4,5,6. However, for strong interactions and high excitation energy there are cases, known as many-body localization (MBL), where disordered quantum systems can fail to thermalize7,8,9,10. We experimentally generate MBL states by applying an Ising Hamiltonian with long-range interactions and programmable random disorder to ten spins initialized far from equilibrium. Using experimental and numerical methods we observe the essential signatures of MBL: initial-state memory retention, Poissonian distributed energy level spacings, and evidence of long-time entanglement growth. Our platform can be scaled to more spins, where a detailed modelling of MBL becomes impossible.