Table of Contents
- Before Converting Install yt-dlp
- Building YouTube to mp3 command
- Convert YouTube to mp3 script
- How to create the script?
Before converting a YouTube video to mp3
You must install the yt-dlp program.
If you already have it, jump to the next step.
yt-dlp requires additional parameters to convert YouTube clips to mp3.
I’ll show you step-by-step how to create your own youtube to mp3 downloader.
Building the YouTube to mp3 converter command
We start with:
yt-dlp
Then we add -x to tell it to extract audio.
yt-dlp -x
Then we specify the audio format as mp3
yt-dlp -x –audio-format mp3
Then add the audio quality
yt-dlp -x –audio-format mp3 –audio-quality 0
And finally add the link to the video to convert:
yt-dlp -x –audio-format mp3 –audio-quality 0 YOUTUBE_LINK
To start the download:
- copy the command above
- replace YOUTUBE_LINK with a video or playlist link
- run from the command line
That looks complicated.
Let’s automate the download.
Convert YouTube to mp3 script for download
Let’s create a simple youtube to mp3 converter script.
On Windows, you can create a .BAT file to automoate the command.
This is what the script should contain:
@echo off
yt-dlp -x –audio-format mp3 –audio-quality 0 YOUTUBE_LINK
pause
Make sure to replace YOUTUBE_LINK with a YouTube video link or a YouTube playlist link.
If you double click the script or press Enter, it will start the download and will put your mp3 in the current folder after a few seconds.
How to create the script?
In Windows Explorer, navigate to your Downloads folder.
Right click and create a new text file in that folder.
Name it GET_AUDIO.BAT
Now right click the new file and press Edit from the menu.
It opens up with Notepad. You can edit it in any other text editor.
Add this line to the beginning of the file:
@echo off
Next, paste the long command in there.
Finally, add a pause to the script.
This allows us to check the output in case something went wrong.
All you have to do now is double click GET_AUDIO.BAT from Windows Explorer.
It will start the download.
Here is what happens when you run the script and have successfully converted a YouTube clip to mp3 for free.

Happy downloads!