MP4 to MP3
Published Updated
Pull the soundtrack out of an MP4 video and save it as a 128 kbps MP3 you can play before downloading.
128 kbps MP3 from the video's soundtrack
The tool hands the MP4 to the browser's decodeAudioData, which pulls out and decodes the audio track, then encodes it as a constant 128 kbps MP3 with the lamejs encoder. The picture is ignored, so the MP3 size depends only on the length of the video's sound track.
There are no settings. If you need a smaller MP3 afterwards, MP3 Compressor can re-encode it at 64 or 96 kbps.
Size and memory by video length
MP3 size is 128,000 bits per second divided by 8. Memory is the decoded sound held as 32-bit samples, two channels at 48,000 Hz:
| Video length | MP3 size | Decoded audio in memory |
|---|---|---|
| 3 minutes | 2.9 MB | about 69 MB |
| 10 minutes | 9.6 MB | about 230 MB |
| 30 minutes | 28.8 MB | about 691 MB |
| 60 minutes | 57.6 MB | about 1.4 GB |
The video file itself is in memory too while it is decoded, so add its size to the last column.
Nine test files through the extractor
We loaded the page's real MP4 to MP3 component in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app) and handed it generated clips through its file input, which goes through the same handler as a file dropped on the box. For each one we clicked Extract Audio, downloaded the MP3 from the page's own link and decoded it again in the same browser to read its length. Nothing was played and we did not listen to the results; the clips carry test tones, one run per engine. In every engine the browser's audio context ran at 48,000 Hz on our test Mac.
| Input (generated) | Chrome 156 | Chromium 153 | Firefox 155 | WebKit build |
|---|---|---|---|---|
| MP4, H.264 + AAC stereo (macOS avconvert), 634,269 bytes | 63,744 bytes, 3.98 s | 63,744 bytes, 3.98 s | 64,512 bytes, 4.03 s | 63,744 bytes, 3.98 s |
| Fragmented MP4 (H.264 + AAC) written by Chromium's MediaRecorder, 633,699 bytes | 64,512 bytes, 4.03 s | 64,512 bytes, 4.03 s | 64,512 bytes, 4.03 s | 63,744 bytes, 3.98 s |
| AAC-LC .m4a, sound only, 5 s | 80,640 bytes, 5.04 s | 80,640 bytes, 5.04 s | 81,408 bytes, 5.09 s | 80,640 bytes, 5.04 s |
| QuickTime .mov, AAC in a version 1 sound description | 63,744 bytes, 3.98 s | 63,744 bytes, 3.98 s | 64,512 bytes, 4.03 s | 63,744 bytes, 3.98 s, after the page rewraps the sound as .m4a |
| WebM, VP8 + Opus | 57,216 bytes, 3.58 s | 57,216 bytes, 3.58 s | 57,216 bytes, 3.58 s | 57,216 bytes, 3.58 s |
| MP4 with 5.1 AAC sound, 5 s | 80,640 bytes, 5.04 s | 80,640 bytes, 5.04 s | 80,640 bytes, 5.04 s | 80,640 bytes, 5.04 s (other channels, see below) |
| MP4 with a picture and no sound track | No audio track message | No audio track message | No audio track message | No audio track message |
| 40,000 random bytes named .mp4 | Could not read this video file | Could not read this video file | Could not read this video file | Could not read this video file |
| An empty .mp4 (0 bytes) | Stopped by the upload box | Stopped by the upload box | Stopped by the upload box | Stopped by the upload box |
Every MP3 began with the same frame header: MPEG-1 Layer III, 128 kbps, 48,000 Hz, stereo. None had an ID3 tag or a Xing or Info frame. The MP3 follows the sound track, not the picture: the avconvert clip shows 4.14 seconds of picture but its sound track header says 3.99 seconds, and its MP3 read back as 3.98 seconds (4.03 in Firefox 155, which decoded the AAC a little long, as it did the .m4a). The result card rounds the length to whole seconds, here 0:04.
For the picture-only MP4 the page says the video has no audio track, so there is no sound to extract. The random bytes stopped at the first step, with the card saying the browser could not open the video and suggesting another browser or Video Converter.
Surround sound: which two channels reach the MP3
The page keeps the first two channels the browser's decoder hands over and drops the rest without mixing them in. To see which two those are, we wrote a 5-second 5.1 AAC MP4 with macOS afconvert, one tone per speaker: 300 Hz front left, 500 Hz front right, 700 Hz centre, 60 Hz LFE, 1,100 Hz surround left, 1,300 Hz surround right. macOS afinfo lists the file's own layout as C L R Ls Rs LFE. We then told each decoded channel apart by its tone.
| Engine | Decoded channel order | MP3 left | MP3 right |
|---|---|---|---|
| Chrome 156 | L, R, C, LFE, Ls, Rs | Front left | Front right |
| Chromium 153 | L, R, C, LFE, Ls, Rs | Front left | Front right |
| Firefox 155 | L, R, C, LFE, Ls, Rs | Front left | Front right |
| The WebKit build | C, L, R, Ls, Rs, LFE | Centre | Front left |
Chrome 156, Chromium 153 and Firefox 155 handed the channels over in the order the W3C Web Audio API sets for 5.1 (front left, front right, centre, LFE, surround left, surround right), so the centre tone was missing from their MP3s. The WebKit build handed them over in the file's own order, so its MP3 had the centre tone on the left, the front-left tone on the right and no front-right tone. We tested one AAC file; other codecs and other 5.1 layouts may behave differently.
A one-minute and a five-minute video
For length we built two MP4s with macOS AVFoundation: the generated picture repeated end to end, with one continuous AAC sound track of two tones and light noise (60 and 300 seconds of sound, 10,233,520 and 49,938,290 bytes). Times run from the click on Extract Audio to the result card, one run per engine.
| Engine | 60 s of sound: time, MP3 | 300 s of sound: time, MP3 |
|---|---|---|
| Chrome 156 | 3.8 s, 960,384 bytes | 18.9 s, 4,800,384 bytes |
| Chromium 153 | 3.5 s, 960,384 bytes | 17.8 s, 4,800,384 bytes |
| Firefox 155 | 6.3 s, 961,536 bytes | 28.0 s, 4,801,536 bytes |
| The WebKit build | 3.6 s, 960,384 bytes | 17.4 s, 3,696,000 bytes: only 231 s of sound |
Where the whole sound came through, the MP3 was 960,384 bytes for 60 seconds and 4,800,384 bytes for 300, so each added minute cost 960,000 bytes, as the table at the top of this page works out. Those MP3s read back 0.024 seconds longer than the sound (0.096 in Firefox 155). In the WebKit build the five-minute video came out as a 3:51 MP3. Decoding that file again outside the page returned 230.975 seconds of sound, twice, while a 150-second video of the same kind and the same five minutes of sound on their own as an .m4a decoded in full; Chrome 156 decoded all three in full. We did not find the cause. The result card shows the length before you download, so a short result can be spotted there. We did not test videos longer than five minutes.
Pulling the audio out of an MP4
Step 1
Add an MP4 video
The video's length is read first; a file the browser cannot open stops here with an error.
Step 2
Extract the audio
The whole file is decoded by the browser's audio engine and the sound is encoded as MP3 at 128 kbps.
Step 3
Listen, then download
A player lets you check the result. The MP3 keeps the video's file name.
What the MP3 does not include
- Channels beyond the first two of a surround track.
- Song titles, artist or cover art; no tags are written.
- Any part of the picture.
To cut the audio afterwards use Audio Cutter. For other audio files, MP3 Converter encodes WAV, M4A, FLAC and more.
MP4 to MP3: questions
What bitrate is the MP3?
Always 128 kbps constant bitrate, which works out to 960,000 bytes per minute of audio. A 10-minute video gives an MP3 of about 9.6 MB, however large the video file was.
Is the sound quality the same as in the video?
Close, but not identical. The audio in an MP4 is already compressed, usually as AAC, and turning it into MP3 compresses it a second time. At 128 kbps that is fine for speech and casual listening; keep the video if you need the best possible copy.
Why does it fail on a long or very large video?
The entire video file is read into memory, and the decoded sound is held as uncompressed samples: an hour of stereo audio at 48,000 Hz needs about 1.4 GB. Phones and older laptops run out first. Trim the video before extracting.
What if the video has more than two audio channels?
Only the first two channels the browser's decoder hands over are kept, with no mixdown. In our 5.1 test, Chrome 156, Chromium 153 and Firefox 155 used the order the Web Audio specification sets, so the MP3 held front left and front right, and dialogue that sits in the centre channel was lost. WebKit used the file's own AAC order: its MP3 held centre and front left, and front right was lost.
Why is the sample rate different from the original?
Decoding happens at the rate of the browser's audio context, which follows your sound hardware (commonly 48,000 or 44,100 Hz). The MP3 keeps whatever rate the decoder produced. The result card shows the rate that was used.
Can it extract audio from MOV, WebM or MKV files?
The file chooser here is set to MP4 files, but a file dropped on the box is opened whatever its type. In our test a QuickTime MOV and a WebM (VP8 and Opus) converted in all four engines we tried; for the MOV, the WebKit build needed the sound rewrapped as .m4a, which the page does on its own. MKV was not tested. Video to MP3's file chooser is set to any video type, and it extracts the sound the same way.
Why is the MP3 shorter than my video?
Because it follows the sound track, and a video's sound can end before its picture. Our test MP4 shows 4.14 seconds of picture and carries 3.99 seconds of sound; its MP3 read back as 3.98 seconds in Chrome 156, Chromium 153 and the WebKit build, and 4.03 seconds in Firefox 155. If the gap is much larger than that, check the length on the result card before downloading.
Why does it say the video has no audio track?
The page found no sound track in the file, so there is nothing to extract. A picture-only MP4 gave that message in all four engines.
Does it work with recordings made in the browser?
In our test, yes: a fragmented MP4 written by Chromium's MediaRecorder (H.264 with AAC) converted in all four engines, giving 4.03 seconds of MP3 in Chrome 156, Chromium 153 and Firefox 155 and 3.98 seconds in the WebKit build.
How long does a long video take?
A video with five minutes of sound took 17.4 to 18.9 seconds in Chrome 156, Chromium 153 and the WebKit build, and 28.0 seconds in Firefox 155, from the click to the result card. Check the length on the card: in the WebKit build that file came out at 3:51 instead of 5:00.