The magnitude scale is logarithmic so that an earthquake of magnitude 5 produces 10 times the shaking of a magnitude 4. A magnitude 6 earthquake produces motion 100 times greater than a magnitude 4.
There are various ways to determine magnitude. This results in different "magnitude scales". One method is based on the amplitude of the P-wave; this yields the body wave magnitude mb. Another is based on the amplitude of seismic surface waves; this yields the surface wave magnitude Ms. Another method gives moment magnitude or Mw and is based on the amplitude of the ground motion at very low frequency. The coda magnitude scale Mc is based on how long the shaking lasts as recorded by seismograms.
All magnitude scales are designed to give roughly the same number for a particular earthquake. In practice, some methods work better than others depending on the size of the earthquake. For example, the moment-magnitude is known to give the best estimate of the size of very large earthquakes.