How to Convert M4A to MP3 with ffmpeg
ffmpeg is the engine behind a huge share of the world’s audio and video tools — including, in a WebAssembly build, parts of the converter on this site. Using it directly gives you complete control over bitrate, channels, tags and naming, and it handles thousands of files as easily as one. The downside is that it is a command-line program with hundreds of options. This guide gives you the handful of commands you actually need for M4A to MP3, explains what each flag does, and covers the errors people most often hit.
Install ffmpeg
- Windows: download a “full” or “essentials” build from gyan.dev or BtbN on GitHub, unzip it, and add the
binfolder to your PATH. Alternatively runwinget install ffmpeg. - macOS:
brew install ffmpegwith Homebrew. - Linux:
sudo apt install ffmpeg(Debian/Ubuntu),sudo dnf install ffmpeg(Fedora with RPM Fusion) or your distribution’s equivalent.
Check that the MP3 encoder is available:
ffmpeg -hide_banner -encoders | grep mp3
You should see libmp3lame. On Windows PowerShell use findstr mp3 instead of grep.
The one command most people need
ffmpeg -i input.m4a -c:a libmp3lame -q:a 2 output.mp3
-i input.m4ais the source file.-c:a libmp3lamechooses the LAME MP3 encoder.-q:a 2asks for variable bitrate (VBR) quality level 2, which averages roughly 170–210 kbps and is transparent for most listeners on most music.output.mp3is the destination; the extension tells ffmpeg to write an MP3 file.
That is all. ffmpeg reads the AAC or ALAC audio, decodes it, and encodes MP3.
Constant bitrate instead of VBR
Some car stereos, older hardware players, podcast hosts and DJ software expect constant bitrate (CBR). Use -b:a:
ffmpeg -i input.m4a -c:a libmp3lame -b:a 192k output.mp3
Common choices are 128k for speech, 192k for general music and 320k for archival copies from lossless sources. Our CBR vs VBR guide explains which to choose and why VBR is usually the better default.
VBR quality levels at a glance
| -q:a | Typical average | Use for |
|---|---|---|
| 0 | ~245 kbps | Highest VBR quality |
| 2 | ~190 kbps | Music, recommended default |
| 4 | ~165 kbps | Casual listening |
| 6 | ~115 kbps | Speech with some music |
| 9 | ~65 kbps | Voice only, smallest files |
Averages depend on the content; quiet speech produces lower bitrates than dense rock.
Voice recordings: mono and lower sample rate
Voice memos and lectures rarely need stereo. Downmixing to mono halves the data the encoder has to spend, so you can use a lower bitrate without losing clarity:
ffmpeg -i memo.m4a -ac 1 -c:a libmp3lame -b:a 64k memo.mp3
-ac 1 sets one audio channel. You can go further with -ar 22050 to resample to 22.05 kHz, which is still clear for speech, but most players handle 44.1 kHz better, so only do this if size really matters. The mono vs stereo and sample-rate article goes deeper.
Keep tags and album art
By default ffmpeg copies global tags (title, artist, album) but may skip the cover image and write ID3v2.4, which Windows Explorer and some cars do not read. A more compatible command:
ffmpeg -i input.m4a -map 0:a -map 0:v? -c:a libmp3lame -q:a 2 -c:v copy -id3v2_version 3 -write_id3v1 1 output.mp3
-map 0:aincludes the audio stream.-map 0:v?includes the embedded cover picture if there is one (the?stops ffmpeg failing when there is not).-c:v copycopies the JPEG/PNG cover without re-compressing it.-id3v2_version 3writes ID3v2.3, the most widely supported tag version.-write_id3v1 1adds an old-style ID3v1 tag for very old players.
If the cover still does not appear, see our article on keeping metadata when converting.
Batch convert a whole folder
macOS and Linux (bash/zsh):
for f in *.m4a; do ffmpeg -n -i "$f" -c:a libmp3lame -q:a 2 "${f%.m4a}.mp3"; done
Windows PowerShell:
Get-ChildItem *.m4a | ForEach-Object { ffmpeg -n -i $_.FullName -c:a libmp3lame -q:a 2 ($_.BaseName + ".mp3") }
Windows Command Prompt:
for %f in (*.m4a) do ffmpeg -n -i "%f" -c:a libmp3lame -q:a 2 "%~nf.mp3"
The -n flag tells ffmpeg never to overwrite existing files, so you can re-run the loop safely after an interruption. To process subfolders too, use find on Unix or Get-ChildItem -Recurse in PowerShell. Our dedicated batch conversion guide includes a version that mirrors the folder structure into a separate output directory.
Trim, normalise or fade while converting
Because ffmpeg decodes the audio anyway, you can apply simple edits in the same pass:
- Trim:
-ss 00:00:05 -to 00:10:00keeps 5 seconds to 10 minutes. - Fade in:
-af "afade=t=in:d=2"adds a 2-second fade-in. - Loudness normalise:
-af loudnorm=I=-16:TP=-1.5:LRA=11targets −16 LUFS, a common podcast level. See how to normalise audio volume.
Example combining trim and normalisation:
ffmpeg -ss 5 -i talk.m4a -af loudnorm=I=-16:TP=-1.5 -c:a libmp3lame -b:a 128k talk.mp3
Common errors and fixes
“Unknown encoder ‘libmp3lame’” — your build lacks LAME. Install a full build as described above.
“moov atom not found” — the M4A is incomplete, often from a recording that was interrupted or a download that did not finish. The audio index sits at the end of the file and is missing. Tools such as untrunc can sometimes rebuild it using a healthy file from the same device as a reference.
“Invalid data found when processing input” — the file is not really M4A (it may be a renamed WebM, OGG or even an HTML error page). Run ffprobe input.m4a to see what it actually is.
Output is silent — check that you did not use -vn together with -map 0:v, and that the input really has an audio stream (ffprobe lists it).
“Protected” or DRM errors — .m4p files from the old iTunes Store are encrypted; ffmpeg cannot and should not decrypt them.
Should you use ffmpeg or a GUI converter?
ffmpeg is unbeatable for automation and consistent results, and it is free. It is overkill if you convert one file a month. For occasional conversions, the browser M4A to MP3 converter gives you the same LAME-quality output with a file picker and bitrate menu, and nothing is uploaded. If you prefer a desktop app, VLC and Audacity both work.
Useful ffprobe checks before and after converting
ffprobe installs alongside ffmpeg and tells you what you are working with. Three commands worth knowing:
ffprobe -hide_banner input.m4a
shows the codec (aac or alac), sample rate, channels, bitrate and duration. If the codec is alac, the source is lossless and it is worth encoding at a higher quality such as -q:a 0 or -b:a 320k.
ffprobe -v error -show_entries format_tags -of default=nw=1 input.m4a
lists the tags (title, artist, album, date) so you can confirm they carried across after conversion — run it on the MP3 too.
ffprobe -v error -show_entries stream=codec_name,bit_rate -of csv=p=0 output.mp3
prints just the codec and bitrate, which is handy in scripts that verify each output.
Choosing settings by source
| Source M4A | Recommended command options |
|---|---|
| iPhone voice memo (AAC ~64 kbps, mono) | -ac 1 -b:a 64k |
| Podcast or lecture (AAC 96–128 kbps) | -b:a 128k or -q:a 5 |
| iTunes purchase (AAC 256 kbps) | -q:a 2 or -b:a 256k |
| Apple Lossless CD rip | -q:a 0 or -b:a 320k |
| Screen recording audio (AAC 48 kHz) | add -ar 44100 for older players |
These are starting points. If a file sounds fine at a lower setting, the smaller file is the better file.
Speed tips
LAME is single-threaded, so one conversion uses one CPU core. On a multi-core machine you can convert several files in parallel. On Linux and macOS with GNU parallel installed:
ls *.m4a | parallel ffmpeg -n -i {} -c:a libmp3lame -q:a 2 {.}.mp3
That runs one ffmpeg per core and can turn an hour-long batch into ten minutes. Use -loglevel error to keep the terminal output readable when running many jobs at once.
Summary
For nearly every case, ffmpeg -i input.m4a -c:a libmp3lame -q:a 2 output.mp3 is the right command. Switch to -b:a 192k when something demands constant bitrate, add -ac 1 for voice, add the mapping and ID3v2.3 options to keep album art, and wrap it in a loop for whole folders.
Frequently asked questions
What is the simplest ffmpeg command to convert M4A to MP3?
ffmpeg -i input.m4a -c:a libmp3lame -q:a 2 output.mp3 — this produces a high-quality variable-bitrate MP3 averaging around 190 kbps.
Should I use -b:a or -q:a?
-q:a selects LAME's variable-bitrate quality (0 is best, 9 smallest) and usually gives better quality per megabyte. -b:a sets a constant bitrate, which some old players and upload forms require.
How do I keep album art with ffmpeg?
Map the cover stream and write ID3v2.3 tags: ffmpeg -i in.m4a -map 0:a -map 0:v? -c:a libmp3lame -q:a 2 -c:v copy -id3v2_version 3 out.mp3.
Can ffmpeg convert M4A to MP3 without quality loss?
No. MP3 is a different lossy codec, so the audio must be re-encoded. You can only copy without loss when the target container supports the same codec, such as M4A to AAC.
Why does ffmpeg say 'Unknown encoder libmp3lame'?
Your ffmpeg build was compiled without LAME. Install a full build (for example from your package manager or gyan.dev on Windows) and run ffmpeg -encoders | grep mp3 to confirm.