MixiderMixider

How Lossy Audio Compression Works: MP3, AAC and Opus

Learn what MP3, AAC, Opus and FLAC actually throw away, why you rarely hear it, and how to run a blind test to find the quality you can truly hear.

Black over-ear headphones lying on a bright yellow background
Mixider team
Oct 6, 2026
8 min read

In the late 1980s, the engineer Karlheinz Brandenburg kept listening to Suzanne Vega's a cappella track "Tom's Diner" while tuning an early audio compressor. A single unaccompanied voice is brutally honest: any artifact shows up immediately. If the codec could make that voice sound natural at a fraction of the original data, it could handle almost anything. That obsession with one fragile recording helped produce the MP3.

Today nearly every song you stream, download or hear in a video has been through a lossy codec. Understanding what these codecs throw away, and why you mostly cannot hear it, explains a lot: why some files sound brittle, why Bluetooth headphones behave differently from wired ones, and when paying for lossless actually makes sense.

The problem: raw audio is enormous

A CD stores stereo audio sampled 44,100 times per second with 16 bits per sample. That works out to about 1,411 kilobits per second, or roughly 10 megabytes for every minute of music. A four-minute song is about 40 MB before any compression.

That was fine for a disc, but painful for dial-up modems, early portable players with a few hundred megabytes of storage, and mobile networks. The goal of a lossy codec is to shrink the data by 10 times or more while keeping the result perceptually close to the original. The key word is perceptually.

How lossy codecs decide what to delete

Lossy codecs rely on psychoacoustics, the study of how human hearing actually works rather than how a microphone measures sound. A few effects do most of the work.

Frequency masking

A loud sound makes quieter sounds at nearby frequencies inaudible. If a bass guitar is booming at 100 Hz, the faint noise just above it is effectively hidden from you. The codec analyzes the signal in small chunks, estimates what is masked in each frequency band, and spends fewer bits there, or none at all.

Temporal masking

Masking also works in time. A loud hit, like a snare, briefly hides quieter sounds just before and after it. Codecs exploit this window, which lasts only tens of milliseconds, to simplify what happens around sharp transients.

The limits of hearing

Healthy young ears hear from about 20 Hz to 20 kHz, and sensitivity drops sharply at the extremes. Hearing at the top end declines with age, and many adults cannot detect anything above 15 or 16 kHz. Codecs often low-pass the signal, cutting everything above a chosen frequency. A typical 128 kbps MP3 made with the LAME encoder is low-passed somewhere around 16 kHz, which is why very high cymbal shimmer is the first thing to go.

Spending the bit budget

After analysis, the encoder converts the audio into frequency data, then quantizes it: it rounds the values coarsely where masking hides the error, and finely where it would be audible. Finally it packs the result with entropy coding, the same idea behind ZIP files. The "bitrate" you see is just how large that budget is per second.

A short tour of the codecs you actually meet

The formats differ mainly in how efficiently they spend that budget, and in what they were designed for.

Codec Introduced Typical use Notes
MP3 1993 (MPEG-1 Layer III) Downloads, old libraries, car stereos Universal compatibility, least efficient of the group
AAC 1997 (MPEG-2) Apple Music, YouTube, iTunes, Bluetooth Better than MP3 at the same bitrate
Ogg Vorbis Early 2000s Spotify streaming Open and royalty free
Opus 2012 (RFC 6716) YouTube, WebRTC calls, Discord Excellent at low bitrates, very low latency
FLAC 2001 Archiving, lossless downloads Lossless, usually about half the original size

MP3: the survivor

MP3 was standardized in the early 1990s and became the format of the file-sharing era. Its design is dated: it uses relatively crude frequency resolution and has trouble with sharp attacks. Modern encoders squeeze impressive results out of it, and at 256 or 320 kbps it is transparent for most listeners. It remains useful because absolutely everything plays it.

AAC: the quiet default

Advanced Audio Coding came out of the same research lineage and generally sounds better than MP3 at the same bitrate. Apple Music streams AAC at 256 kbps, and YouTube uses AAC for many videos. If you edit video and export with the default audio setting, you are very likely producing AAC.

Opus: the modern workhorse

Opus was standardized by the IETF in 2012 and is documented openly in RFC 6716. It can run from about 6 kbps for speech up to 510 kbps for music, and it can switch frame sizes from 2.5 ms to 60 ms, which makes it equally good for a live voice call and a studio recording. It combines two older techniques internally, one built for speech and one for music. In listening tests at moderate bitrates it consistently beats older codecs, and you can read more at the project site, opus-codec.org.

FLAC: lossless, not magic

FLAC is a lossless codec: decode it and you get back exactly the bits that went in. Typical music compresses to somewhere between 50 and 60 percent of the original size, depending on how dense the recording is. Quiet acoustic music shrinks more than a loud, compressed rock master. Lossless matters for archiving and for editing, because it keeps you from stacking compression errors.

What lossy compression sounds like when it goes wrong

Most of the time you hear nothing. When artifacts appear, they have recognizable signatures.

  • Pre-echo. A sharp transient, like a clap, smears backward in time as a faint ghost just before the hit. It comes from quantization noise spreading across a whole analysis block.
  • Swirly or watery highs. Cymbals and reverb tails sound like they are underwater. The codec is zeroing out some frequency bands and not others, and the pattern changes from frame to frame.
  • Lost air. The very top of the spectrum is gone, so recordings feel flat and closed in.
  • Birdie noise. Tiny chirps that come and go, a side effect of bands switching on and off.

These problems get worse at low bitrates and with demanding material: applause, castanets, harpsichord, and dense electronic music with lots of sharp hi-hats.

Generation loss: the real enemy

The most common way people ruin audio is not choosing a bad bitrate. It is converting a lossy file to another lossy file. Each encode throws away a fresh set of details, and the errors stack. A song downloaded as a 128 kbps MP3 and then re-exported at 320 kbps is not better: it is the same degraded audio stored in a larger file.

Practical rules that follow from this:

  1. Keep the highest quality source you have, ideally lossless, and encode to the delivery format once, at the end.
  2. If you only have a lossy source, keep it in its original format when possible instead of converting.
  3. When editing video, export from the original project, not from a previous export. This also applies to audio you pull from a finished clip, as covered in our guide to cutting video on the beat.
  4. Never judge a file by its bitrate alone. A 320 kbps MP3 converted from a 128 kbps source is still a 128 kbps listening experience.

Bluetooth adds its own layer

Wireless headphones are a second compression stage, and it is a separate one from the file you are playing. Your phone decodes the song, then re-encodes it for the Bluetooth link. The mandatory codec is SBC, which is serviceable but not outstanding. AAC is common on Apple devices. Sony's LDAC can run up to 990 kbps, while newer headsets and phones increasingly support the LC3 codec from the LE Audio standard, which delivers good quality at lower bitrates and uses less power.

The practical consequence: a lossless file played over a basic Bluetooth connection is still being squeezed on the way to your ears, and the headphone's own tuning and noise cancellation make a bigger audible difference than the file format. If sound quality matters, a wired connection removes that second stage entirely.

Loudness and codecs interact

Codecs and the loudness war meet in an uncomfortable spot. Heavily limited masters leave less room between peaks, and lossy encoding can push the decoded waveform above full scale, producing clipping. That is one reason streaming services recommend leaving a little headroom. For the background on how loudness targets work, see how loudness normalization ended the loudness war.

A blind test you can run on your own ears

Claims about audible quality are cheap, so test yourself. This takes about twenty minutes and needs nothing but a decent pair of wired headphones.

  1. Pick three tracks you know well: one acoustic and sparse, one dense and loud, one with sharp percussion.
  2. Get a lossless version of each, either a CD rip or a purchased FLAC.
  3. Encode copies at 128 kbps MP3, 256 kbps AAC and 320 kbps MP3 using a free tool such as ffmpeg or an audio editor.
  4. Use an ABX tester (foobar2000 has a free ABX plugin) so you do not know which file is which. You pick which one is "X" and the tool tallies your hits.
  5. Aim for at least 12 or 16 trials per pair. A score near 50 percent means you cannot reliably tell them apart.

Most people find 128 kbps MP3 easy to spot on the sparse track, 256 kbps AAC very hard to separate from lossless, and 320 kbps basically impossible. Your results may differ, and that is the whole point.

What to take away for everyday listening

Choose your battles. If you stream, any current high-quality setting is plenty for headphones, a phone speaker or a party. If you archive music or edit audio, keep lossless masters and export once. If you are building a playlist for friends, a clean source matters far more than a bitrate argument: a well-recorded track at 160 kbps beats a muddy recording at any setting.

Try this tonight

Open your music app and find its audio quality setting. Compare the lowest and highest options on a song with plenty of cymbals and a quiet intro, such as an acoustic live recording. Then do one pass of the ABX test above on a single track. Two minutes of honest listening will tell you more about your own ears than any spec sheet, and it might save you from paying for quality you cannot hear.

Build your next playlist with Mixider

Mix YouTube, SoundCloud, Bandcamp and more in one shared playlist, and let your friends add their picks.

Try Mixider for free

Keep reading