We investigated the use of an automated routine to determine moment magnitudes from the displacement spectra of local and regional earthquakes. Two algorithms, a genetic algorithm and a converging grid search, were developed and tested with earthquake data from Mexico, Norway, and Deception Island (Antarctica). It was found that compared with manual analysis, the algorithms give reliable automatic moment magnitude (Mw) estimates in the range -1 < M < 8. The converging grid search appeared to be more cost-effective than the genetic algorithm. Mw at local and regional distances seems superior to amplitude-based magnitudes that saturate for large earthquakes. The application of the automated algorithm in near real time may help to obtain a nonsaturated magnitude estimate in the case of a large earthquake immediately after the earthquake has occurred. Also, the method can be useful for processing large amounts of data.