How much data is there on a CD?
A compact disc stores sound as 44,100 samples a second for each of two channels, each sample a 16-bit number. That comes to about 1,411 kilobits for every second of music, or roughly 10 megabytes a minute.
A typical MP3 at 128 kilobits a second uses one eleventh of that. A modern streaming service at 96 kilobits with a newer codec uses one fifteenth.
Can the data simply be squeezed, like a zip file?
Only a little. Lossless compression finds redundancy and removes it in a way that can be exactly undone. Applied to music it typically saves 40 to 50 per cent. Formats such as FLAC work this way, and what comes out is bit for bit what went in.
To reach a tenth, information has to be thrown away for good. The art lies in choosing information the listener will not miss.
How can anything be removed without being noticed?
Because hearing is far from a perfect instrument. Psychoacoustics, the study of how sound is perceived, has mapped its limitations in detail, and three of them matter here.
The threshold of hearing. The ear's sensitivity depends on frequency. It is keenest between about 2,000 and 5,000 hertz, where speech consonants lie, and much duller at the extremes. A quiet component at 16,000 hertz that would be plainly audible at 3,000 is simply not heard. There is no need to store it.
Simultaneous masking. A loud sound makes quieter sounds at nearby frequencies inaudible. A strong tone at 1,000 hertz will hide a much weaker one at 1,100. This is why you cannot hear a conversation next to a road drill, and it happens constantly within music: a loud cymbal covers quieter detail in the same range.
Temporal masking. A loud sound also hides quieter ones that come just after it, for something like a tenth of a second, and, more surprisingly, ones that come a few thousandths of a second before it. The brain processes loud sounds faster than soft ones, and the later loud sound overtakes the earlier quiet one.
How does an encoder use this?
In four broad steps.
- Split into bands. The signal is divided into short frames, about a fortieth of a second each, and each frame is transformed into its frequency components.
- Run the psychoacoustic model. For each frame, the encoder works out a masking threshold: at every frequency, the level below which a sound would be inaudible, given everything else in that frame and its neighbours.
- Quantise. Each frequency component is stored with only as much precision as needed. Storing a number coarsely introduces error, which is heard as noise. The encoder chooses the precision in each band so that this noise stays just below the masking threshold. Components entirely below the threshold get no bits at all.
- Pack. The resulting numbers are compressed losslessly, with shorter codes for commoner values.
The encoder is in effect adding noise to the music, deliberately, and shaping that noise so that the music itself hides it.
What is the bitrate, then?
The budget. At a high bitrate, the encoder can keep the noise well below the threshold everywhere. At a low one, there are not enough bits, and it must let noise rise above the threshold somewhere and decide where that will do least harm.
Variable bitrate encoding spends more on complex passages and less on simple ones, which gives better quality for the same average size.
Where did MP3 come from?
From research in Germany in the late 1980s, principally at the Fraunhofer Institute in Erlangen, in a project led by Karlheinz Brandenburg. It was standardised in the early 1990s as layer 3 of the audio part of a video compression standard, which is where the name comes from.
Brandenburg has told the story of tuning the encoder against one particular recording: Suzanne Vega's unaccompanied song "Tom's Diner". The solo voice, warm and close with no instruments to mask the coding noise, sounded dreadful through early versions. He listened to it thousands of times while refining the algorithm.
The last of the patents expired in 2017.
What does a compressed file sound like when it goes wrong?
There are characteristic faults.
Pre-echo. A sharp attack, such as castanets or a snare drum, is preceded by a faint smear of noise. The quantisation noise spreads across the whole frame, including the silent part before the hit, and backward masking is too brief to cover it. Encoders reduce the problem by switching to shorter frames when they detect a transient.
Swirling or warbling. A watery, shifting quality in sustained high sounds such as cymbals, strings and applause, as the encoder keeps and drops different high-frequency components from frame to frame.
Dullness. At low bitrates, encoders cut off everything above about 16,000 hertz, or lower, to save bits for what matters more.
Collapsed stereo. The width of the image narrows, since a common economy is to encode what the two channels share and treat the difference between them sparingly.
Applause, harpsichord, solo voice and crisp percussion are the classic hard cases.
Can people actually hear the difference?
This is where properly controlled testing matters, because the question is very sensitive to expectation.
The standard method is the ABX test. The listener hears sample A, sample B, and then X, which is one of the two chosen at random, and has to say which. Neither the listener nor the person running the test knows. Repeated enough times, it shows whether a person can truly distinguish them or is guessing.
The results of many such tests, including large public ones run by enthusiasts, are fairly consistent.
- At 128 kilobits, older MP3 encoders can be distinguished from the original by many attentive listeners on suitable material.
- With modern encoders at around 192 kilobits and above, and with newer codecs at lower rates still, most listeners cannot reliably tell the compressed version from the CD in blind conditions, on most music, even with good equipment.
- Trained listeners who know the artefacts can pick out problem passages at higher rates.
Sighted comparisons, in which the listener knows which is which, routinely produce confident reports of differences that vanish when the test is blind.
What about formats better than CD?
High-resolution audio uses more bits per sample and higher sampling rates. The arguments are that more bits lower the noise floor and higher rates capture frequencies beyond 20,000 hertz.
CD already has a noise floor below the level of any normal listening room and covers the whole range of human hearing. A well-known study published in 2007 inserted a CD-quality conversion into the playback chain of high-resolution recordings and tested several hundred listeners over a year. They could not detect it. A later analysis combining many studies found a small ability to discriminate, mainly among trained listeners. The question is not entirely closed, and any audible benefit is clearly small.
High resolution is valuable for recording and production, where signals are processed repeatedly and headroom is useful.
What replaced MP3?
Technically, quite a lot. AAC, standardised in 1997, achieves the same quality at roughly two thirds of the bitrate and is the default on most phones and streaming services. Opus, an open standard from 2012, performs well from very low rates for speech up to transparent music, with a short delay that suits calls. Ogg Vorbis is used by some streaming services.
All rest on the same principles as MP3, with better transforms and better models.
Is machine learning changing this?
Yes. Neural audio codecs, which appeared from about 2021, train a network to squeeze audio into a very compact code and another to reconstruct it. They are optimised directly for how the result sounds, without a hand-built model of the ear. They achieve intelligible speech and passable music at a few kilobits a second, a small fraction of what traditional codecs need.
These work differently, and it shows in how they fail. A traditional codec, starved of bits, sounds degraded. A neural one may produce something clean and plausible that differs from the original, such as a consonant that was never spoken. For speech in particular this raises questions about fidelity.
The same compact codes are what speech and music generation systems are built on.
What should I actually use?
- For archiving anything you may want to convert again later: lossless. Each lossy conversion discards something more, and converting one lossy format to another compounds the losses.
- For everyday listening: a modern codec at a moderate rate. Above about 192 kilobits for MP3, or 128 to 160 for AAC or Opus, the bottleneck is almost certainly somewhere else.
- Where to spend effort instead: the quality of the recording and mastering, the loudspeakers or headphones, and the room. These produce differences anyone can hear without a blind test.
What is the idea worth keeping?
That a lossy codec is a working model of a listener. Every bit it saves corresponds to a claim about something a human ear will not detect. The format succeeded because those claims are largely correct, and its artefacts mark the places where the model of hearing is wrong.
If you would like to hear what was removed, there is a simple experiment. Take a track in lossless form and the same track as a low-bitrate MP3, align them in an audio editor, invert one and add them together. What is left is the difference: a ghostly, hissing outline of the music, made of everything the encoder judged you would not miss.



