Most of us stream the vast majority of our music, but sometimes that's not an option. That's where downloading songs or music videos for offline listening comes in. If YouTube is your music platform of choice, there are plenty of methods to download music for when you have spotty or no internet connectivity.
Downloading music from YouTube is legal if you pay for YouTube Premium. All other methods to download songs from YouTube are free, but they may not always be legal. Remember that it's okay to download your own music or copyright-free songs from YouTube, but if you're trying to rip popular music that you didn't create, you're probably going against the site's terms of service.
Download music from YouTube by subscribing to YouTube Premium
The most reliable method for downloading music from YouTube is by paying for the service—which, I know, is probably not what you want to hear.
You can either get YouTube Premium for $13.99 per month, or you can subscribe to just YouTube Music Premium for $10.99 per month. These are two separate services: YouTube Premium comes with YouTube Music Premium, but not the other way around.
Both services allow you to download music from YouTube, plus come with other features such as removing ads. YouTube Premium comes with a host of extra features focused on the video side of the platform, so if you only want music, you can save a little money by just subscribing to YouTube Music Premium.
All other methods for downloading music from YouTube are unofficial and may violate the site’s terms of service, but YouTube probably won't do much to stop you. (Just don't upload any copyright-protected material). In addition, know that using unofficial YouTube downloaders could compromise your security if the app gets bought by malicious developers down the line. I've done my best to recommend safe programs, but I can't predict what the future holds. Always do research before downloading an unofficial app from the internet.
How to download music from YouTube on Android
If you have an Android phone, try using NewPipe to download music from YouTube. This app is not available on the Google Play store because it essentially gives you all of YouTube Premium's features for free, including the ability to download music from YouTube. Here's how to install it:
Download the Newpipe apk.
Open the downloaded file on your Android phone. You may see a warning and a request for your permission to install NewPipe. Grant this request and go back to the installer.
Once the installation is complete, open NewPipe and search for the music you want to download.
Tap Download, followed by Audio, and NewPipe will save the song for you.
How to download music from YouTube on iPhone
On your iPhone, the best (unofficial) way to download music from YouTube is via Apple’s Shortcuts app. Follow these steps to download music from YouTube to your iPhone:
Download the YouTube Download shortcut from RoutineHub, a third-party gallery for shortcuts for your iPhone.
Install two more apps on your iPhone: Scriptable and a-Shell mini.
Open the YouTube video in Safari or in the YouTube app. Tap the Share button, which will reveal the share sheet.
Scroll down and select YouTube Download from the list of shortcuts towards the bottom.
YouTube Download will ask for a bunch of permissions. Unfortunately, you'll need to grant all of these for the shortcut to do its job. When it asks whether you want to download audio or video, select Download Audio. You can also choose the audio format you prefer. (I chose mp3.)
Finally, the shortcut will ask where you want to save the downloaded file. You can pick iCloud Drive or the On My iPhone folder in the Files app.
The downloaded audio file will then be saved on your iPhone. You can repeat this process for pretty much any video on YouTube.
Download music from YouTube on Windows or Mac
On your laptop or desktop, use the 4K YouTube to MP3 app to get music from YouTube.
Install 4K YouTube to MP3.
Paste the YouTube URL in the app and let the app handle the rest.
The app downloads music in mp3 by default, but you can also get m4a or ogg audio files.
The free version of the app allows 15 downloads per day, which is good enough for most people, but it may be a problem if you’re trying to download large playlists in one go. The app allows you to remove the download restriction at a starting price of $15 for a permanent license.
If you're comfortable with using command-line tools to download YouTube songs, then the excellent yt-dlp is another great choice that doesn't come with limits. Personally, I find the initial setup a bit cumbersome. Since I mostly only download one or two things from YouTube once every few months, 4K YouTube to MP3 does the job faster for me.