A complete and consistent inversion technique is proposed to derive an accurate interaction potential from an effective-range function for a given partial wave in the neutral case. First, the effective-range function is Taylor or Padé expanded, which allows high precision fitting of the experimental scattering phase shifts with a minimal number of parameters on a large energy range. Second, the corresponding poles of the scattering matrix are extracted in the complex wave-number plane. Third, the interaction potential is constructed with supersymmetric transformations of the radial Schrödinger equation. As an illustration, the method is applied to the experimental phase shifts of the neutron-proton elastic scattering in the