The moderator structure for a neutron spectrometer was optimized with the Monte Carlo code MCNP-4B. The spectrometer consists of a cylindrical moderator and a position-sensitive thermal neutron detector and obtains energy spectra from thermal neutron distribution along its cylindrical axis. The structure of the moderator was improved by using a low hydrogen density material on one end and a high hydrogen density on the other, and inserting a neutron absorber that eliminates thermal neutron diffusion. This design improves the energy resolution of the spectrometer, especially for low-energy neutrons from a few to 100keV. The designed spectrometer can be applied to the measurement of energy spectra over a neutron energy range from a few keV to 20MeV.