There are a number of ways to measure the magnitude of an earthquake. 

Richter scale

The first widely-used method, the Richter scale, was developed by Charles F. Richter in 1934. It used a formula based on the amplitude of the largest wave recorded on a specific type of seismometer and the distance between the earthquake and the seismometer. That scale was specific to California earthquakes; other scales, based on wave amplitudes and total earthquake duration, were developed for use in other situations and they were designed to be consistent with Richter’s scale.
Richter scale, do not provide accurate estimates for large magnitude earthquakes.

The Moment Magnitude Scale
The moment magnitude scale, abbreviated MW, is preferred because it works over a wider range of earthquake sizes and is applicable globally. The moment magnitude scale is based on the total moment release of the earthquake. The moment is a product of the distance a fault moved and the force required to move it. It is derived from modeling recordings of the earthquake at multiple stations. Moment magnitude estimates are about the same as Richter magnitudes for small to large earthquakes. But only the moment magnitude scale is capable of measuring M8 (read ‘magnitude 8’) and greater events accurately.
www.ElectricAcademy.in