is there any body who share me the formula to calculate the surface wave magnitude with and without using wavefrom of earthquake? any website links or any online solution?
Hello Shahzada Khurram. Many institutions around the world provide waveforms of the networks they managed. One of the most popular ones is the NIED, who gathers some of the currently working Japanese networks. Here you have the website http://www.bosai.go.jp/e/activities/database/earthquake.html
After a free registration, you will be able to download strong motion recordings from the Japanese database.
About the surface wave magnitude, this scalar value can be obtained in the following way. You need to measure the amplitude ($A$) from the largest peak to the zero baseline of the recording. Then you can use the following equation [Stein and Wysession (2002)]
$M_S = \log(A/T) + 1.66\log(\Delta) + 3.3$
or
$M_S = \log(A_{20}) + 1.66\log(\Delta) + 2.0$
where the first equation is a general and the second is specific to the amplitude of the Rayleigh waves, which period is equal to 20 seconds ($T=20$ s.). In these formulas, $A$ is the amplitude of the strong motion peak measured in microns after removing the instrument response from the recording, $T$ is the wave period measured in seconds and $\Delta$ is the distance in degrees. I must say that you can not estimate the surface wave magnitude without a recording.
Finally, there are several empirical relations between magnitude and rupture length. The first paper that pointed out some of these relations was Kanamori and Anderson (1975). In that work you can find that there is a relationship between the area of the rupture to the seismic moment (total energy released by the quake). In addition, the seismic moment is used to estimate another scalar quantity known as moment magnitude. In seismology we prefer to use the moment magnitude, which is related to the energy released, instead of using the surface wave magnitude, that might depend on the site conditions where you record the strong motion. Therefore, there is a relation between the area of rupture and the moment magnitude.
I hope this answer helps you. You can check more about magnitude scales and equations in the book by Stein and Wysession in page 264. You can also easily find the paper by Kanamori and Anderson (1975) "Theoretical basis of some empirical relations in seismology"