Knowing the three-dimensional structural information of materials at the nanometer scale is essential to understanding complex material properties. Electron tomography retrieves three-dimensional structural information using a tilt series of two-dimensional images. In this paper, we report an alternative combination of electron ptychography with the inverse multislice method. We demonstrate depth sectioning of a nanostructured material into slices with 0.34 nm lateral resolution and with a corresponding depth resolution of about 24-30 nm. This three-dimensional imaging method has potential applications for the three-dimensional structure determination of a range of objects, ranging from inorganic nanostructures to biological macromolecules.Three-dimensional ptychographic imaging with electrons has remained a challenge because, unlike X-rays, electrons are easily scattered by atoms. Here, Gao et al. extend multi-slice methods to electrons in the multiple scattering regime, paving the way to nanometer-scale 3D structure determination with electrons.