Step 1: Add you favorite song to the iTunes library and right click on the song > Get Info and select the options tab.

Now in the option tab select the time frame of you choice, but it has to be 30 seconds. Click Ok and test the song whether you have selected the correct part of the song.

Step 2: Right click on the song and select Create AAC Version to convert the Mp3 file to a AAC version.
Once the file gets converted you can see the new AAC version on the library with the timeframe of 30 seconds.
Note: Some might not be able to see the “Create AAC Version” and this is due to the default import option . To get rid of this, go to Edit > Preference > General and click on Import settings. Here set the import option to AAC Encorder. Thats it

Step 3: You are almost done, finally right click on the file and select Show in Windows Explorer (for Windows) and Show in Finder (for Mac) to see the song. Now change the file format of the song from.m4a to .m4r
Your custom made ringtone is ready to be transferred to your iPhone.