Video to MP3

Published Updated

Save the sound of an MP4, WebM or any other video whose sound your browser can decode as a 128 kbps MP3, and listen to it before you download.

Two checks your video has to pass

First, the page loads the file into a hidden video element to read its length. If the browser cannot open the container or its codecs, the page says Couldn't read this video file. Second, Extract Audio reads the whole file and asks the browser's decodeAudioData to decode its sound. A video with no sound, or with an audio codec the browser lacks, stops there with the message that the audio track could not be extracted, followed by the reason where the file shows one: no audio track, or the name of the codec.

According to the MDN container guide, every browser handles MP4 and WebM, while QuickTime (MOV) support belongs to older Safari versions. The guide adds that container support implies nothing about codecs.

Test results in Google Chrome 158

Four 3-second videos recorded in the browser with MediaRecorder, then opened in the page's own tool (the length is that of the decoded sound track):

VideoSound trackDecoded
MP4, H.264AAC, stereoYes, 2.88 s at 48,000 Hz
WebM, VP9Opus, stereoYes, 2.94 s at 48,000 Hz
MP4, H.264NoneNo: "This video has no audio track"
WebM, VP9NoneNo: "This browser could not decode the video's sound"

Decoded sound is resampled to the audio context's rate (48,000 Hz on our test Mac), as the MDN decodeAudioData page states, so the MP3 follows your device rather than the video.

Getting the audio out of a video

  1. Step 1

    Pick a video

    Any video type can be chosen. The page first asks the browser to open the file; once it reports a length, the Extract Audio button appears.

  2. Step 2

    Extract Audio

    The whole file is read into memory, its sound is decoded, and lamejs writes a 128 kbps MP3 from the first one or two channels.

  3. Step 3

    Play and download

    The result line gives length, mono or stereo, sample rate and size. The file is named after the video, ending in .mp3.

Long videos and memory

Nothing is streamed. The video file sits in memory while its sound is decoded into 32-bit samples, which at 44.1 kHz stereo is about 21 MB per minute. A two-hour film needs roughly 2.5 GB for the decoded sound alone, on top of the video file itself, and the MP3 comes to about 115 MB.

For a long recording, cut the part you need with Trim Video, then extract that.

Other ways to get there

  • MP4 to MP3 runs the same extraction with a picker limited to MP4 files.
  • Audio Converter turns audio files, rather than videos, into WAV, MP3 or Ogg Vorbis.
  • Audio Cutter trims the MP3 to a clip once it is extracted.

Which videos give an MP3, by engine

We ran the tool's own steps (read the file, decodeAudioData, keep up to two channels, encode MP3) in Google Chrome 156.0.8078.80, Chromium 153.0.8010.12 (the build that ships with Playwright, headless, not Google Chrome), Firefox 155.0 and Playwright's WebKit build (user agent Version/26.6, not the Safari app), on generated test videos with a 440 Hz tone. The same clip was saved as WebM (VP8 and Opus), as MP4 (H.264 and AAC) and as MOV (H.264 and AAC, made with macOS avconvert). We checked the length and size of the result.

VideoChrome 156Chromium 153Firefox 155Playwright's WebKit
WebM, 3.97 s picture57,216 bytes57,216 bytes57,216 bytes57,216 bytes
MP4, 3.97 s picture63,744 bytes63,744 bytes64,512 bytes63,744 bytes
MOV, 3.97 s picture63,744 bytes63,744 bytes64,512 bytes63,744 bytes, after the sound was rewrapped as .m4a (see below)

The WebM gave 3.54 seconds of sound for a picture of 3.97 seconds, in all four engines. The MP3 reads back about 0.04 seconds longer than the sound it was made from (3.576 against 3.54 for WebM, 3.984 against 3.945 for MP4). Firefox measured the MP4 sound at 3.989 seconds instead of 3.945 and wrote 768 bytes more.

In all cases that worked, the file was stereo at 48,000 Hz with 128 kbps frames, which is what the page writes whatever the video's own audio. The MOV in the WebKit build needed a second step: decodeAudioData reported Decoding failed on the file as it was, while the same engine decoded the MP4 of the same clip. The section below shows what the tool does then.

A six-channel track and long videos

A WAV with six channels, used here in place of a video with surround sound, gave a stereo MP3 with the first two channels in every engine. For speed we encoded a generated 60-second stereo track in one run per engine: 1.5 s in Chromium 153 and the WebKit build, 1.6 s in Chrome 156 and 2.4 s in Firefox 155, which is 25 to 40 times faster than playback. A 300-second track took 7.7 to 13.2 seconds. Because the tool decodes the whole soundtrack into memory first, a very long video needs more memory than its MP3 would suggest.

Why a MOV's sound failed in WebKit, and the rewrap

Our MOV keeps its AAC sound the QuickTime way: the file is branded as a QuickTime movie, and the sound description uses QuickTime's version 1 layout, with the decoder settings inside an extra wave box. The MP4 of the same clip uses the ISO layout. To find out which part mattered, we decoded copies of the MOV changed one thing at a time, in Chrome 156, Chromium 153, Firefox 155 and the WebKit build, one run each:

Copy of the MOVChrome 156, Chromium 153, Firefox 155WebKit build
As written by macOSDecodedDecoding failed
Brand changed to an MP4 brand onlyDecodedDecoding failed
Video track removed, QuickTime layout keptDecodedDecoding failed
Sound description in the ISO layout, QuickTime brand keptDecodedDecoding failed
ISO sound description and an MP4 brand, video keptDecodedDecoded, 3.945 s
ISO sound description and an .m4a brand, sound track onlyDecodedDecoded, 3.945 s

Both changes were needed. When the first decode fails, the tool builds the last copy in the table from the MOV: a new file header, a new index holding only the sound track with its description in the ISO layout and its data positions moved, and the original data block copied unchanged, so nothing is decoded or re-encoded in this step. For our 634,520-byte MOV that copy was 632,034 bytes and decoded in the WebKit build; the MP3 was 63,744 bytes, the same as Chrome 156 made from the MOV directly. In the other three engines the first decode worked, so no copy was made.

The rewrap covers only this layout: a QuickTime file with one index and one data block, and AAC sound. Any other file that the browser cannot decode gets the error message instead.

Video to MP3: what people ask

Which video formats can I use?

Any file your browser can open whose sound it can also decode. In Chrome 158, an MP4 with AAC sound and a WebM with Opus sound both worked. MKV and AVI depend on the codecs inside and on the browser.

What does the message about the audio track mean?

The browser opened the video but could not decode any sound from it, and the sentence after the message gives the reason the file shows. In our test an MP4 with no audio track got This video has no audio track, so there is no sound to extract, in all four engines. A silent WebM got the general sentence, that this browser could not decode the video's sound, because the page does not look inside WebM files. Sound in a codec the browser lacks is named where an MP4 or MOV says which codec it is.

Why does it say Couldn't read this video file?

The browser could not open the file at all. The video probably uses a codec your browser does not play. Try another browser, or convert the video to MP4 with Video Converter in a browser that plays it.

Can I extract only part of the soundtrack?

Not here; the full length is always extracted. Shorten the video first with Trim Video, or cut the MP3 afterwards with Audio Cutter, which works to a tenth of a second.

Is 5.1 surround sound kept?

No. The encoder takes the first two decoded channels and drops the rest without mixing them in. For a film, check the MP3 for missing dialogue.

Is the MP3 as good as the sound in the video?

Not identical. Video sound is usually compressed already, and the MP3 encoder compresses it again at 128 kbps, at your browser's audio rate (48,000 Hz on our test Mac), so it is not a copy of the original track. For speech and casual listening that is enough.

Does it work with MOV files?

Our test MOV converted in all four engines. The WebKit build refused the sound of our MOV as it was stored, so the tool rewraps that sound as an .m4a, without decoding or changing it, and decodes the copy; the MP3 came out at 63,744 bytes, as in Chrome 156. Our MOV was written by a macOS tool, and MOV files from other sources may behave differently.

Why is the MP3 shorter than my video?

The MP3 is as long as the audio track. A WebM with a 3.97-second picture had 3.54 seconds of sound, so the MP3 was 3.58 seconds.

Related guide

MP4, MOV and WebM: which video format to use and how to convert. The guide extracts sound from a WebM, a MOV and an MP4: 57,216 to 64,512 bytes at about 16,000 bytes per second, and one MOV whose sound WebKit decoded only after the tool re-packed it as .m4a.

Related Tools