MP3 Converter

Published Updated

Turn WAV, OGG, M4A, FLAC and other audio your browser can decode into a 128 kbps MP3 you can play before you save it.

One setting: 128 kbps, stereo at most

The page decodes your file with the browser's decodeAudioData method and hands the samples to lamejs, a JavaScript port of the LAME encoder. There are no quality options. Output is 128 kbps constant bitrate, mono or stereo according to the source, with at most two channels.

At that bitrate a minute of audio takes 960,000 bytes, so file size depends only on the length, not on the source.

A 3-minute song, before and after

Sizes follow from the bitrate, so you can estimate any file.

SourceSize of the sourceMP3 at 128 kbpsShare
WAV, 44.1 kHz, 16-bit stereo31.75 MB2.88 MB9%
M4A at 256 kbps5.76 MB2.88 MB50%
MP3 at 128 kbps2.88 MBAbout 2.88 MB100%

The last two rows start from a lossy file, so quality drops a little further, and re-encoding a 128 kbps MP3 at 128 kbps does not make it smaller.

Converting audio to MP3

  1. Step 1

    Add an audio file

    Pick WAV, OGG, M4A, FLAC or any other audio your browser can decode. The page shows the length and detected format.

  2. Step 2

    Press Convert to MP3

    The audio is decoded by the Web Audio API and encoded at 128 kbps, as stereo if the source has two or more channels.

  3. Step 3

    Play and download

    A built-in player lets you listen to the MP3 before you save it.

What you give up

Convert from a lossless original whenever you can. These are the things the output will not have:

  • No tags: title, artist, album and cover art are not written.
  • No bitrate or VBR choice, and no joint-stereo or quality setting.
  • No cutting or fading. For that, use Audio Cutter, and to shrink an existing MP3 use MP3 Compressor.
  • Very long recordings, because of the memory figures in the FAQ.

Formats we fed it, and what each browser did

We ran the page's own steps (read the file, decode it with the browser's decodeAudioData, keep at most two channels, encode with the site's lamejs 1.2.1 encoder) in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app). The inputs were generated 5-second tones: WAVs written by a script, other formats converted from them with macOS afconvert, an Ogg Opus file recorded with Firefox's MediaRecorder, and MP3 and Ogg Vorbis files from this site's own encoders. Nothing was played. We read the decoded length and channels and the bytes of each MP3.

Input (generated)Chrome 156Chromium 153Firefox 155WebKit build
WAV, plain PCM: 8, 16 and 24-bit and 32-bit float; 22.05, 44.1, 48 and 96 kHz; mono, stereo and 6 channelsConvertedConvertedConvertedConverted
WAV with A-law or µ-law samplesConvertedConvertedConvertedConverted
WAV with IMA ADPCM samplesRefused (ADPCM message)Refused (ADPCM message)Refused (ADPCM message)Converted
AAC-LC and HE-AAC in .m4a, AAC in a raw .aac fileConvertedConvertedConvertedConverted
FLAC, Ogg Vorbis, Ogg Opus, MP3ConvertedConvertedConvertedConverted
Apple Lossless (ALAC) in .m4aRefused (ALAC message)Refused (ALAC message)Refused (ALAC message)Converted
AIFF and CAF, 16-bitRefused (general message)Refused (general message)Refused (general message)Converted
First half of an AAC .m4a, as if a download stopped midwayConverted 2.07 sConverted 2.07 sRefused (general message)Converted 2.00 s
First half of a WAVConverted 2.50 sConverted 2.50 sConverted 2.50 sConverted 2.50 s
50,000 random bytes named .mp3; an empty fileRefusedRefusedRefusedRefused

When a file is refused, the page reads its first bytes to say why. In our runs it named the problem for the ADPCM WAV (it holds IMA ADPCM audio rather than plain PCM), for the Apple Lossless file and for the empty file (0 bytes). For AIFF, CAF, the cut-short .m4a in Firefox and the random bytes it showed the general message: the browser could not decode it, the format or codec may not be supported, or the file may be damaged or cut short.

What came out, whatever went in

Every MP3 began with the same frame header: MPEG-1 Layer III, 128 kbps, 48,000 Hz, mono for a mono source and stereo otherwise. The 48,000 Hz is the rate of the browser's audio context, which all four engines reported on our test Mac. The decoder resamples to that rate (as MDN describes for decodeAudioData), so the 22.05 kHz WAV and the 96 kHz WAV both gave 48 kHz MP3s. By default the context takes the output device's preferred rate (MDN, AudioContext constructor), so another device may write another rate. A browser rate above 48,000 Hz is written as 48,000 Hz (checked up to 192,000 Hz).

Size follows length, not the input format: every source that decoded to 5.000 seconds gave an MP3 of 80,640 bytes, the 24-bit and 96 kHz WAVs included. AAC files were the exception, because some browsers decoded them a little long: Firefox 155 read our .m4a as 5.062 seconds (81,408 bytes) and the HE-AAC file as 5.133 seconds, and Chrome 156 read the raw .aac as 5.062 seconds.

The 6-channel WAV came out as stereo. Its MP3 had the same two-to-one level between left and right (0.269 and 0.134 RMS) as channels 1 and 2 of the source (0.283 and 0.141), so the other four channels were left out rather than mixed in.

None of the MP3s had an ID3 tag at either end, and none had a Xing or Info frame. Some encoders write that frame to record the samples added at the start and padded at the end to complete the last frame (LAME tag specification). The browsers we used read every MP3 back 0.024 to 0.047 seconds longer than its source, for example 5.04 seconds for a 5-second WAV.

Long recordings: time and size

For speed we built 16-bit 44.1 kHz stereo WAVs in the page (two tones plus a little noise) and ran them through the same decode and encode steps, one run per engine. The time includes decoding; encoding was most of it (18.1 of the 18.6 seconds for the 300-second file in Chrome 156).

Engine60 s WAV (10,584,044 bytes)300 s WAV (52,920,044 bytes)
Chrome 1563.6 s18.6 s
Chromium 1533.9 s19.2 s
Firefox 1556.8 s33.3 s
The WebKit build3.2 s18.4 s
MP3 size, all four engines960,384 bytes, reads back 60.024 s4,800,384 bytes, reads back 300.024 s

So a minute of audio costs 960,384 bytes here, against the 960,000 bytes that 128 kbps works out to. The page holds the whole decoded file in memory while it works, which is why the FAQ below gives memory figures for long files.

MP3 conversion FAQ

Can I choose the bitrate?

No. The encoder is set to a fixed 128 kbps, constant bitrate. For 192 or 320 kbps, or for variable bitrate, use a desktop encoder.

Which files can I upload?

Whatever your browser can decode. PCM WAV, MP3, AAC (.m4a and .aac), FLAC, Ogg Vorbis and Ogg Opus files converted in Chrome 156, Chromium 153, Firefox 155 and WebKit, while ADPCM WAV, Apple Lossless, AIFF and CAF converted only in the WebKit build. If the page cannot read a file, try a different browser or export a WAV first.

Are titles, artist names and cover art copied over?

No. The MP3 is written without any ID3 tags, so you will need to add the title, artist and cover art in a tag editor afterward.

What happens to surround-sound or multichannel files?

Only the first two channels are encoded, and they are not mixed down. A 5.1 file would keep its front left and right channels and lose the rest.

Why does a long file fail?

The whole file is decoded into memory as 32-bit floating point numbers at the browser's audio rate (48 kHz in all four engines we used), and the encoder then makes a 16-bit copy. Ten minutes of stereo at 48 kHz takes about 230 MB before that copy, and an hour about 1.38 GB. Split very long recordings first.

Does the MP3 have the same sample rate as my file?

Not necessarily. The browser decodes audio at its own audio-context rate, commonly 44,100 or 48,000 Hz, and the MP3 is written at that rate, or at 48,000 Hz when the browser's rate is higher.

Why is the MP3 a little longer than the original?

Every test MP3 read back 0.024 to 0.047 seconds longer than its source: 5.04 seconds for a 5-second WAV and 60.024 seconds for a 60-second one. The file has no Xing or Info frame, which is where some encoders record the padding they add.

Can I convert Apple Lossless, AIFF or CAF files from a Mac?

Only where the browser can decode them. The WebKit build converted all three, while Chrome 156, Chromium 153 and Firefox 155 refused them; for the Apple Lossless file the page said so by name. AAC and WAV versions of the same tone converted in all four engines.

Does a 24-bit or 96 kHz file give a better MP3?

Not here. A 24-bit 44.1 kHz WAV, a 16-bit 96 kHz WAV and a 16-bit 44.1 kHz WAV of the same 5-second tone all gave 80,640-byte MP3s at 128 kbps and 48,000 Hz in all four engines we tried, because the browser decodes to its own rate and the encoder has one setting.

My file was cut off while downloading. Can it still be converted?

It depends on the format and the browser. The first half of a WAV converted to 2.50 seconds in all four engines. The first half of an AAC .m4a converted to 2.07 seconds in Chrome 156 and Chromium 153 and to 2.00 seconds in the WebKit build, while Firefox 155 refused it with the general could-not-decode message.

Related guide

MP3, OGG, WAV: when to convert or compress audio. The guide compares a 240-second WAV with a 128 kbps, 192 kbps and 320 kbps MP3 and checks the size formula against bytes written by the site's encoder.

Related Tools