WAV to MP3 Converter: Compress Audio Online
Convert WAV files to compressed MP3 right in your browser. Choose your bitrate, preview both versions, and download, no upload to any server.
How this WAV to MP3 converter decodes and re-encodes audio without a native codec in sight
Browsers do not ship an MP3 encoder. Decoding MP3 for playback, yes, every browser can do that. Writing one from scratch is a different job, and there is no browser API for it. This tool solves that with lamejs, a pure JavaScript port of the LAME encoder, the same encoding library that has been the de facto standard for MP3 quality since the early 2000s. Decoding the source file, whatever format it arrives in, is handled by the browser’s own Web Audio API.
Everything happens in your tab. The file is read with FileReader, decoded with AudioContext.decodeAudioData(), converted to 16-bit PCM by hand, and encoded to MP3 frames with lamejs, all before a single byte leaves your machine. There is no upload and no server involved anywhere in the pipeline.
The decode, convert, encode pipeline
FileReader.readAsArrayBuffer(), giving raw bytes with no assumption yet about their format.
AudioContext.decodeAudioData() parses those bytes into an AudioBuffer: floating point samples, one channel array per audio channel, at the file’s native sample rate. This step is what actually reads the WAV container and its PCM data, and it will also happily decode MP3, OGG or AAC input if you feed it one, since decoding is a native browser capability regardless of source format.
lamejs.Mp3Encoder in blocks of 1152, the fixed number of samples per MP3 frame defined by the format itself. Each call to encodeBuffer() returns a chunk of encoded MP3 data, which gets collected until flush() empties the encoder’s internal buffer at the end.
| Property | Where it comes from |
|---|---|
| Bitrate | Fixed setting passed straight to Mp3Encoder, selectable from the bitrate dropdown |
| Sample rate | Inherited from the decoded AudioBuffer.sampleRate, not resampled |
| Channels | Capped at 2; a mono source encodes as mono, stereo sources keep both channels |
| Frame size | 1152 samples per frame, fixed by the MP3 format itself, not configurable |
Two details the name does not tell you
Despite the name, input isn’t limited to WAV
Because decoding runs through the Web Audio API rather than a WAV-specific parser, this tool accepts any format the browser’s audio decoder understands, including MP3, M4A, OGG and FLAC. The file type check looks at the MIME type and a handful of common extensions rather than strictly enforcing WAV.
Longer files run on a timer, not a worker
Encoding happens on the main thread inside a setTimeout callback rather than a Web Worker, which keeps the UI able to show a converting message but means a very long recording will still tie up the tab while it encodes.
Encoder documentation
- MDN decodeAudioData(), the Web Audio API method this tool uses to turn raw file bytes into sample data.
- lamejs on GitHub, the pure JavaScript port of the LAME encoder doing the actual MP3 compression here.
- LAME project, the original C encoder lamejs is ported from, and the reference implementation most MP3 quality comparisons are measured against.
- ISO/IEC 11172-3, the MPEG-1 Audio Layer III specification defining the 1152-sample frame structure this encoder writes.
When compression is the right call
Shrinking uncompressed WAV recordings from a podcast session or field recorder down to a size that’s actually practical to email or upload, converting voice memos for a smaller phone footprint, preparing audio for platforms that reject WAV uploads outright, and standardizing a folder of mixed format audio clips into one consistent MP3 bitrate for a media library.
FAQ: WAV to MP3 converter
No, the entire conversion happens locally in your browser using the Web Audio API for decoding and the lamejs JavaScript library for MP3 encoding, your audio content is never transmitted to any server. This also means conversion works without an internet connection once the page has fully loaded.
WAV stores every audio sample uncompressed, which is why a typical 3 to 4 minute stereo song in WAV format takes up 30 to 40MB, while the same audio compressed to MP3 at 192 kbps takes up only about 4 to 5MB, roughly an 85 to 90% reduction. MP3 achieves this through psychoacoustic compression, discarding audio information that’s largely imperceptible to human hearing rather than simply storing fewer samples.
For music where quality matters, 320 kbps (the maximum standard MP3 bitrate) is essentially indistinguishable from the original for most listeners and equipment. 192 kbps is a well-regarded balance point used as the default by many services, offering very good quality at roughly 60% the file size of 320 kbps. 128 kbps noticeably reduces file size further but can introduce audible artifacts in complex audio, it’s most appropriate for voice recordings, podcasts, or situations where storage space matters more than audio fidelity.
Yes, since the tool relies on the browser’s built-in audio decoder (the same one used by the HTML5 audio element), it can generally decode any format your browser supports, including MP3, OGG, M4A/AAC, and FLAC, not just WAV. WAV to MP3 is the primary use case since WAV files benefit the most from compression, but re-encoding other formats to standardize on MP3 or reduce bitrate also works.
Encoding is a computationally intensive process performed entirely on your device’s processor rather than a powerful server, so a 5-minute song might take several seconds to encode depending on your device’s speed, and much longer audio files (an hour-long podcast, for example) can take a noticeable amount of time. This is the trade-off for keeping your audio completely private and never uploading it anywhere.
No, MP3 compression is lossy, meaning some audio information is permanently discarded during encoding and can never be recovered, even if you convert the MP3 back to WAV afterward, the file will be larger again but the lost detail is gone for good. If you need to preserve a pristine master copy, always keep your original WAV file and treat the MP3 as a compressed copy for playback or distribution.
There’s no hard limit built into the tool itself, since everything processes in your browser’s memory rather than through a server upload quota, but very long audio files (over an hour) may take a while to encode and could use a significant amount of memory, particularly on mobile devices with less available RAM.
This tool encodes up to 2 channels (mono or stereo); if your source file has more than 2 channels (like 5.1 surround), only the first two channels will be used in the resulting MP3, since standard MP3 encoding is built around mono and stereo audio rather than multi-channel surround formats.