Neutrons are valuable probes for various material samples across many areas of research. Neutron imaging typically has a spatial resolution of larger than 20 µm, whereas neutron scattering is sensitive to smaller features but does not provide a real-space image of the sample. A computed-tomography technique is demonstrated that uses neutron-scattering data to generate an image of a periodic sample with a spatial resolution of ∼300 nm. The achieved resolution is over an order of magnitude smaller than the resolution of other forms of neutron tomography. This method consists of measuring neutron diffraction using a double-crystal diffractometer as a function of sample rotation and then using a phase-retrieval algorithm followed by tomographic reconstruction to generate a map of the sample's scattering-length density. Topological features found in the reconstructions are confirmed with scanning electron micrographs. This technique should be applicable to any sample that generates clear neutron-diffraction patterns, including nanofabricated samples, biological membranes and magnetic materials, such as skyrmion lattices.