MP4 to MP3 Converter logoMP4 to MP3

Audio Compression Explained

MP3 shrinks audio by 10x by discarding sounds the human ear cannot hear. Here is how the psychoacoustic model, masking, and entropy coding actually work.

Quick Answer

MP3 compression works by combining a psychoacoustic model with quantization and entropy coding. The model identifies sounds the human ear cannot perceive because they are masked by louder frequencies nearby, throws those sounds away, then losslessly packs what remains. The result is a file roughly ten times smaller than raw PCM with no audible difference at sensible bitrates. MP4toMP3.online uses the libmp3lame encoder to do exactly this in your browser.

Why audio compression exists at all

Uncompressed CD-quality audio is 1,411 kilobits per second — about 10 MB per minute of stereo sound. A four-minute song is 40 MB, an album is 400 MB, and a phone full of music would not fit any music at all. Storage and bandwidth realities forced a question: how much of that 1,411 kbps can we throw away without anyone noticing? The MP3 standard, finalized in 1993, answered by leaning on the limits of human hearing rather than on a brute mathematical squeeze.

That is the core insight: audio compression is not a single algorithm but a pipeline, and the most important stage is the one that decides what to discard. Everything else — the transform, the quantization, the entropy coding — is well-understood signal processing. The trick is the perceptual model that tells the encoder which details are dispensable.

Step 1: the psychoacoustic model

The psychoacoustic model is a software approximation of how human hearing works. It runs in parallel with the actual encoding and produces, for every moment of audio, a threshold curve: anything below the threshold is inaudible and can be discarded; anything above must be preserved. The model is built from two observed phenomena.

Simultaneous frequency masking

A loud tone at one frequency raises the hearing threshold for nearby frequencies. A 1 kHz tone at 80 dB makes a 1.1 kHz tone at 30 dB effectively inaudible. The encoder can simply not encode the quieter tone, and the listener never notices.

Temporal masking

Masking also works across time. A loud sound masks quiet sounds that arrive shortly after it (forward masking, up to ~200 ms) and, more weakly, sounds that arrive just before it (backward masking, up to ~5 ms). The encoder exploits both.

There is also absolute threshold of hearing: very quiet sounds below about 20 dB SPL at most frequencies are inaudible regardless of masking. Combine all three curves — absolute, simultaneous, temporal — and you get the moment-by-moment threshold that drives every other stage.

Step 2: the transform and filter bank

To work in the frequency domain, the encoder slices incoming PCM into overlapping frames of 1,152 samples (about 26 ms at 44.1 kHz) and runs them through a hybrid filter bank: a polyphase filter followed by a Modified Discrete Cosine Transform. The output is a set of 32 subbands further split into 576 frequency lines per granule. This is where the audio stops being a waveform and starts being a spectrum the psychoacoustic model can reason about.

The window shape and block switching (long blocks for steady sounds, short blocks for transients like drum hits) trade frequency resolution for time resolution. Get this wrong and you hear pre-echo — a faint smeared copy of a sharp transient before it actually happens — which is one of the most audible MP3 artifacts at low bitrates.

Step 3: quantization — where data is actually lost

For each frequency line, the encoder picks a step size and rounds the value to the nearest multiple of that step. Large steps mean small encoded numbers (few bits) but large rounding error; small steps mean the opposite. The psychoacoustic model's threshold decides which lines can tolerate coarse quantization and which need fine.

This is the only truly lossy step in the entire pipeline. A line representing a masked frequency might be quantized to zero and dropped entirely. A line representing the fundamental of a clear vocal is quantized finely enough that the rounding error is below the threshold of hearing. The bitrate you choose — 128, 192, 320 kbps — is effectively a budget for how many bits the encoder is allowed to spend across all the lines in all the frames. Our bitrate explainer goes deeper on what each tier actually sounds like.

Step 4: entropy coding — lossless squeezing of what remains

After quantization, the encoder has a stream of small integers. It then applies Huffman coding — the same lossless technique used in ZIP files — to pack them into the fewest possible bits. Common values get short codes; rare values get long ones. Because this stage is reversible, it adds no further quality loss; it just shrinks the lossy output one more time.

The final bitstream is a sequence of frames, each carrying a header with the bitrate, a block of Huffman-coded data, and optional ancillary data. Variable bitrate mode simply lets each frame declare its own bitrate, so quiet passages spend less and complex passages spend more. For the practical tradeoff between fixed and variable bitrate, the VBR vs CBR guide has the details.

What actually gets discarded

  • Frequencies above ~16 kHz at low bitrates. The ear is least sensitive in the very high end, so encoders cut there first. At 128 kbps the cutoff may be 16 kHz; at 320 kbps it is back near 20 kHz.
  • Quiet sounds near loud ones. Masked tones are either zeroed or coarsely quantized. You do not hear them disappear because the loud neighbor dominates perception.
  • Stereo redundancy. Most stereo content is highly correlated between channels. Joint stereo encodes the mid and side signals separately so the side (the difference) can be compressed harder.

Why MP3 still wins for video extraction

Newer codecs — AAC, Opus — beat MP3 on raw efficiency. But when you pull audio out of an MP4, your destination usually dictates the format. Car stereos, dedicated MP3 players, audio editing tools, and most hardware in the wild still expect MP3. The MP3 inside libmp3lame, the encoder that powers Audacity, FFmpeg, and the browser-based converter on this site, is mature, well-tuned, and produces output indistinguishable from source AAC at the bitrates most people use.

If you want to push quality to MP3's ceiling, the 320 kbps setting is it. For a broader framing of why the MP4 and MP3 formats coexist in the first place, the MP4 vs MP3 overview covers the container-versus-codec distinction that makes this whole conversion question make sense.

The takeaway

MP3 compression is not magic and it is not sloppy. It is a carefully engineered pipeline that uses a model of human hearing to spend bits only where they will be noticed. The artifacts it introduces are real but, at sensible bitrates, sit below the threshold of perception for almost everyone on almost all gear. That is why a 4 MB MP3 of a song can sound the same to your ears as the 40 MB original — and why MP3 remains the sensible default for audio pulled out of video files.

Sources & References

  1. 1Psychoacoustics — Wikipedia — WikipediaThe perceptual model that lets MP3 and AAC discard inaudible sound.
  2. 2Lossy compression — Wikipedia — WikipediaTransform coding and quantisation as used by modern audio codecs.
  3. 3MP3 — Wikipedia — WikipediaMPEG-1 Audio Layer III as the canonical example of psychoacoustic compression.
  4. 4LAME MP3 encoder — Wikipedia — WikipediaThe reference encoder implementation of the MP3 psychoacoustic model.

Convert MP4 to MP3 in your browser

Browser-based, no upload, no sign-up. Your file never leaves your device.

Convert MP4 to MP3