MP4 to MP3 Extractor

Pulling the audio out of a video is normally a server-side job, because it needs a real media pipeline. This page runs FFmpeg compiled to WebAssembly instead, so the video is decoded and re-encoded inside the browser tab and never uploaded.

How to use it

  1. Drop in an .mp4 file.
  2. FFmpeg loads as WebAssembly on first use, then decodes the audio track and re-encodes it with LAME.
  3. The .mp3 downloads when the transcode finishes.

This is a transcode, not an extraction

The wording matters because it explains the quality outcome. Audio inside an MP4 is almost always AAC. MP3 is a different codec, so producing an MP3 means fully decoding the AAC to raw samples and re-encoding those samples with a second lossy encoder.

Each lossy encode discards information judged inaudible, and the two codecs make different judgements. The second pass therefore throws away things the first pass kept, and it also spends bits preserving artefacts the first pass introduced. The result is audibly worse than the AAC it came from, though for speech, podcasts, and casual listening the difference is generally not noticeable.

A genuine extraction would copy the AAC stream into an .m4a container without re-encoding, which is lossless and near-instant. That is the better choice if your player accepts it. MP3 remains worth targeting only when you need compatibility with older hardware, car stereos, and devices that predate widespread AAC support.

Why the first conversion is slow

FFmpeg is a large program, and the WebAssembly build is roughly 30 MB. It is fetched on first use, compiled by the browser, and then held in memory for the rest of the session. That download is why the first conversion has a long pause before anything appears to happen, and why the second conversion in the same session starts immediately.

The build used here is single-threaded. Multi-threaded WebAssembly depends on SharedArrayBuffer, which browsers only expose to cross-origin isolated pages, and enabling that isolation would block the third-party frames this site relies on. The practical effect is that transcoding runs slower than native FFmpeg on the same machine, roughly in the region of real time rather than many times faster.

The log output shown during conversion is FFmpeg own stderr stream, which is worth watching if a file fails, since it usually names the codec it could not handle.

Practical limits

The input file, the decoded audio, and the output all sit in browser memory simultaneously. A short clip or a typical podcast episode is comfortable; a two-hour film is likely to exhaust the tab, particularly on a phone.

Video with no audio track produces an error rather than an empty file, which is the correct behaviour but occasionally surprises people working with screen recordings made without audio capture.

Encoding uses the LAME defaults, which land around 128 kbps. That is transparent enough for speech and acceptable for music given that the source has already been through one lossy encode.

At a glance

Accepted input.mp4
Output.mp3, LAME encoder
EngineFFmpeg compiled to WebAssembly, single-threaded
First runAround 30 MB engine download, cached for the session

Frequently asked questions

Why did the first conversion take so long to start?

The FFmpeg WebAssembly build is about 30 MB and is downloaded and compiled on first use. Subsequent conversions in the same tab reuse the loaded engine and start immediately.

Is the audio quality the same as the original?

No. MP4 audio is normally AAC, and producing MP3 requires decoding and re-encoding with a different lossy codec. The loss is usually inaudible for speech and modest for music, but it is real.

Can I extract without re-encoding?

Only by keeping the original codec, which means an .m4a file rather than an MP3. That is lossless and much faster. Choose MP3 when you specifically need compatibility with older devices.

My long video failed partway through.

Most likely memory exhaustion, since the input, decoded audio, and output all sit in the tab at once. Trim the video first, or use desktop FFmpeg for feature-length files.

Read more

Audio and video: containers, codecs, and transcoding — An MP4 is not a format, it is a box. Knowing what is in the box explains most media conversion behaviour.

Related tools