© 2019 American Physical Society. This paper addresses the so-called inverse problem which consists in searching for (possibly multiple) parent target Hamiltonian(s), given a single quantum state as input. Starting from ψ0, an eigenstate of a given local Hamiltonian H0, we ask whether or not there exists another parent Hamiltonian HP for ψ0, with the same local form as H0. Focusing on one-dimensional quantum disordered systems, we extend the recent results obtained for Bose-glass ground states [M. Dupont and N. Laflorencie, Phys. Rev. B 99, 020202(R) (2019)2469-995010.1103/PhysRevB.99.020202] to Anderson localization, and the many-body localization (MBL) physics occurring at high energy. We generically find that any localized eigenstate is a very good approximation for an eigenstate of a distinct parent Hamiltonian, with an energy variance σP2(L)=HP2ψ0-(HP)ψ02 vanishing as a power law of system size L. This decay is microscopically related to a chain-breaking mechanism, also signaled by bottlenecks of vanishing entanglement entropy. A similar phenomenology is observed for both Anderson and MBL. In contrast, delocalized ergodic many-body eigenstates uniquely encode the Hamiltonian in the sense that σP2(L) remains finite at the thermodynamic limit, i.e., L→+∞. As a direct consequence, the ergodic-MBL transition can be very well captured from the scaling of σP2(L).