Alejandro Rioja.
Scripts

How To Convert Youtube Videos To Mp3?

Alejandro Rioja
Alejandro Rioja
6 min read
TL;DR

The only reliable, safe method in 2026 is yt-dlp + ffmpeg. Most browser-based converter sites are adware traps or have been shut down. Here's how to do it cleanly from the command line — and what the legal limits are.

Free newsletter

Every Wednesday. 28,400+ operators. Zero fluff.

Table of contents

Open Table of contents

What changed since this post was first written

When I originally wrote this in 2022, there were half a dozen web-based “YouTube to MP3” converters that actually worked. By 2026, almost all of them are gone, broken, or dangerous:

The original youtube-dl tool also became sluggish and poorly maintained. Its active fork, yt-dlp, is the community standard now — it’s actively maintained, handles YouTube’s current anti-bot measures, and is the tool I actually use.

Why convert YouTube audio at all in 2026?

Before getting into the how, worth being direct about when this is actually appropriate:

If you just want offline music, YouTube Premium is the cleanest path: it includes offline downloads inside the YouTube app and YouTube Music, and you’re not violating anyone’s terms. For personal archiving of your own uploads or legitimately licensed audio, yt-dlp is the right tool.

The actual method: yt-dlp + ffmpeg

This is what I use. It runs on macOS, Linux, and Windows.

Step 1: Install yt-dlp

On macOS with Homebrew:

bash
brew install yt-dlp

On Linux (most distros):

bash
pip install yt-dlp

On Windows, download the .exe from the yt-dlp GitHub releases page and add it to your PATH.

Step 2: Install ffmpeg

yt-dlp uses ffmpeg to convert the audio stream. On macOS:

bash
brew install ffmpeg

On Ubuntu/Debian:

bash
sudo apt install ffmpeg

On Windows, download ffmpeg from ffmpeg.org and add the bin folder to your PATH.

Step 3: Extract the audio

bash
yt-dlp -x --audio-format mp3 --audio-quality 0 "https://www.youtube.com/watch?v=VIDEO_ID"

What each flag does:

The file lands in your current directory with the video title as the filename.

Batch download a playlist

bash
yt-dlp -x --audio-format mp3 --audio-quality 0 "https://www.youtube.com/playlist?list=PLAYLIST_ID"

yt-dlp handles the pagination automatically. It will skip already-downloaded files if you run the command again.

Add metadata (optional but useful)

bash
yt-dlp -x --audio-format mp3 --audio-quality 0 --add-metadata "URL"

This embeds the title, uploader, and thumbnail into the MP3’s ID3 tags so your media player can display them.

Keeping yt-dlp working

YouTube occasionally rolls out changes that break yt-dlp temporarily. When downloads start failing, update first:

bash
yt-dlp -U

That self-update command pulls the latest release. The maintainers typically push a fix within a day or two of YouTube breaking something.

Why I’m not recommending browser-based converters

I originally listed ByClick Downloader, 320YTmp3, MyConverters, Mp3Download, YTMp3, and DVDVideoSoft. Here’s where things stand:

I’m not linking to any of them. If you want a GUI-based tool and don’t want to use the command line, 4K Video Downloader+ has a reasonable track record, though verify its current status before installing.

Summing it up

In 2026, yt-dlp + ffmpeg is the only combination I can recommend without reservation. It’s open source, actively maintained, free, and produces clean output without adware. The command is three flags and a URL.

If you’re extracting audio you own or have explicit rights to, this is a clean workflow. If you’re ripping music you’d otherwise buy, understand that you’re in legal gray (or red) territory — see the FAQ below.


This guide is part of alejandrorioja.com — written by Alejandro Rioja, who now builds AI agent systems for founders. Including the agent that keeps this site current. How it works →

Updated for May 2026

YouTube and the broader video-download tools landscape changed materially in 2024–25:

The how-to in this post still works for the cases it covers; just verify the tool you pick is still up before you commit a workflow to it.

YouTube to MP3 — 2026 FAQ

It depends on what you’re converting. YouTube’s Terms of Service prohibit downloading content without explicit permission from YouTube or the rights holder. Beyond the ToS, extracting copyrighted audio (music, for example) you don’t own violates copyright law in most jurisdictions — the fact that the video is publicly viewable doesn’t grant you a license to create a local copy. You’re on solid ground if you’re archiving your own uploads, downloading Creative Commons-licensed material, or the creator has explicitly given permission. For everything else, streaming services like YouTube Music, Spotify, or Apple Music are the legally clean path.

Was youtube-dl shut down or is it still working?

youtube-dl was briefly removed from GitHub in 2020 following an RIAA takedown request, but it was restored. It continues to exist but development has slowed significantly. The community forked it into yt-dlp, which is updated frequently and handles YouTube’s current bot-detection measures. I use yt-dlp exclusively — there’s no good reason to use the original anymore.

Why do so many YouTube-to-MP3 websites have fake download buttons?

These sites monetize through advertising. The legitimate “download” button is often buried among several large fake buttons that trigger ad clicks, browser extension installs, or redirect chains. Some deliver actual malware. The sites are built to maximize ad revenue from users who aren’t technical enough to distinguish the real button from the decoys. The command-line approach via yt-dlp has none of this — the output is exactly what you asked for.

What’s the best audio quality I can get?

YouTube streams audio at a maximum of 128 kbps for most videos (AAC or Opus codec). Some videos have higher-quality streams available, up to 256 kbps Opus. When you run yt-dlp with --audio-quality 0, it selects the best available source. Converting to MP3 at that point is a lossy-to-lossy transcode — you won’t get better quality than the source stream, and re-encoding always introduces some degradation. If audio quality matters, use --audio-format opus or --audio-format m4a to avoid the extra transcode step.

Related reading:

Keep reading

Get the AI playbook in your inbox

Every Wednesday. 28,400+ operators. Zero fluff.

↵ to see all results esc esc to close