Using the richter scale.
Remember that the richter scale is logorithmic so a 9 is 10 times stronger than an 8 on the richter scale
So as far as comparing 2 earthquakes, it isnt as easy as finding the ratio of the magnitudes. I assume you have 2 magnitudes and you want to compare? To get a value that is easy to compare, just find 10^magnitude. For example, we can compare a 4.5 and a 6.2.
value 1: 10^4.5 = 31622.78
value 2: 10^6.2=1584893.19
so then the ratio of the 6.2 and the 4.5 is 31622.78/1584893.19=50 (about)
so a 6.2 is 50 times as strong as a 4.5