  Nuclear level densities are crucial for estimating statistical nuclear
reaction rates. The shell model Monte Carlo method is a powerful approach for
microscopic calculation of state densities in very large model spaces. However,
these state densities include the spin degeneracy of each energy level, whereas
experiments often measure level densities in which each level is counted just
once. To enable the direct comparison of theory with experiments, we introduce
a method to calculate directly the level density in the shell model Monte Carlo
approach. The method employs a projection on the minimal absolute value of the
magnetic quantum number. We apply the method to nuclei in the iron region as
well as the strongly deformed rare-earth nucleus $^{162}$Dy. We find very good
agreement with experimental data including level counting at low energies,
charged particle spectra and Oslo method at intermediate energies, neutron and
proton resonance data, and Ericson's fluctuation analysis at higher excitation
energies.
