How to Use Terminal to Convert Audio Files to Ringtones in OS X

Most of you will have a number of songs in your iTunes library, and chances are some will have hundreds and thousands of songs in their library. You might also like a sound bite or two and would like to use them as a ringtone for your phone. While there are a number of third-party apps that’ll let you do this, your simplest option is to use a utility available in OS X’s Terminal to convert audio files to ringtones for your iOS device.

This particular utility is called “afconvert” and has been included in OS X since 2003. “afconvert” stands for “Audio File Convert,” and as the name suggests, it lets you convert one audio file to another format. This utility also lets you perform a number of other actions on audio files such as managing quality settings, extracting channels, managing bitrates and the sort.

To get started, simply type in the terminal:

This will display a list of the audio file formats supported by this utility. One of these formats is the format that is used for ringtones, which is m4r (Mpeg-4 Ringtone).


To start, drag your audio file to some handy location such as the Desktop. Make sure the file is cropped to the length you want it. Once your file is prepared, open Terminal from the Spotlight and perform the following steps:

1. Enter the following command in Terminal, followed by a single space (do not press Enter yet):


2. Drag the audio file from its location to Terminal, and you’ll see a full path to the file appear, similar to the screenshot below:



3. Now drag the file to Terminal again, which will result in entering another full path to it. But in this new path, delete the filename suffix (.mp3, .aac etc.) and replace it with “.m4r”. The full command will look something similar to the one below:


4. Press Enter to execute the command, and a new file with the .m4r format will be placed in the same location as the original.


Once this whole procedure is finished, simply drag the new .m4r file into iTunes or import it into your library. It should now show up in the ringtones section of your iTunes library. From here you can sync it with your iPhone or iPad.

On your iPhone/iPad, simply navigate to “Settings -> Sounds” to use this ringtone for various notifications.

Shujaa Imran Shujaa Imran

Shujaa Imran is MakeTechEasier's resident Mac tutorial writer. He's currently training to follow his other passion become a commercial pilot. You can check his content out on Youtube


  1. Excellent article, especially for someone like me who prefers to use the command line capabilities of Mac via Terminal. It would be helpful, however, to include information on applications that do the cropping of the input audio file from which the ringtone file is created: “Make sure the file is cropped to the length you want it.” I have used Audacity for this in the past, but it has fairly extensive capabilities and is not so easy to use, in my opinion, for something simple like cropping a file (it usually takes me the better part of an hour, maybe more, to find the directions on what needs to be done to accomplish this with Audacity). What software or procedure would you recommend to do this important first step before creating the ringtone file? Thanks for the fine article.

    1. Hi,

      Thank you for your comment. I do agree, cropping an audio file can be quite a difficult task, sometimes even for me. I however, use iTunes for it. After reading your comment, I thought I’d write an article on how to use iTunes to crop audio files easily (subject to editor’s approval.) I’ll try to write it in the next few days, and hope to get it published especially for you soon :)

  2. Thank you very much. I look forward to learning how to use iTunes to crop an audio file, and encourage your editor’s approval of such an article.

    1. Hi,

      Article just published, check it out here:

Comments are closed.