MP3

On this page 7

MP3, formally MPEG-1 Audio Layer III, is a lossy audio codec that reduces file size by discarding sound components the ear is unlikely to perceive. Among audio formats and codecs, MP3 is the format that made digital music portable: it typically shrinks CD audio to about one-tenth of its size while remaining acceptable to most listeners.

The codec was developed mainly at the Fraunhofer Institute in Germany and standardized as ISO/IEC 11172-3 in 1993, with lower sample rates added in ISO/IEC 13818-3. The last essential patents expired in 2017, so MP3 is now free to implement, and it remains the most universally compatible lossy audio format.

How MP3 compression works

An MP3 encoder processes audio in frames of 1,152 samples, about 26 milliseconds at 44.1 kHz. Each frame passes through a hybrid filter bank: a 32-band polyphase filter followed by a modified discrete cosine transform (MDCT), which together split the signal into 576 frequency lines.

In parallel, a psychoacoustic model analyzes the frame and estimates the masking threshold, the level below which sounds are hidden by louder neighboring sounds. The encoder then quantizes each frequency band so that the resulting noise stays below that threshold wherever the bit budget allows.

The quantized values are packed with Huffman coding, and a bit reservoir lets difficult frames borrow bits saved by simpler ones. For transients such as drum hits, the encoder switches to short blocks to limit pre-echo, a smearing of noise ahead of a sharp attack.

StageFunctionEffect on quality
Hybrid filter bankSplits audio into 576 frequency linesEnables frequency-selective coding
Psychoacoustic modelEstimates what the ear cannot hearDecides where noise can hide
Quantization and rate controlAssigns precision to each bandMain source of loss
Huffman codingPacks values losslesslyReduces size without further loss
Bit reservoirShares bits between framesHelps demanding passages
Main stages of an MP3 encoder

Bit rates, modes and sample rates

MP3 supports bit rates from 32 to 320 kbps in MPEG-1 mode and sample rates of 32, 44.1 and 48 kHz; the MPEG-2 extension adds half rates for speech and low-bandwidth use. Encoders can work in constant bit rate (CBR), variable bit rate (VBR) or average bit rate (ABR) modes.

Bit rateTypical qualityCommon use
64 kbps monoClear speech, limited highsSpoken-word podcasts
128 kbps stereoAcceptable, artifacts audible to trained earsOlder downloads and streams
192 kbps stereoGood for most listenersGeneral music libraries
VBR around 190 to 250 kbpsNear transparent for most materialHigh-quality personal libraries
320 kbps CBRMaximum the format allowsCompatibility-focused distribution
Typical MP3 bit rates and their use

Stereo coding has a large effect at moderate bit rates. Joint stereo with mid-side coding encodes the sum and difference of the channels when they are similar, which saves bits for detail; intensity stereo saves more but degrades the stereo image and is rarely used at music bit rates.

MP3 compared with other audio codecs

Newer lossy codecs achieve similar quality at lower bit rates thanks to better transforms, larger frequency resolution and more flexible tools. Lossless formats avoid the problem entirely at the cost of larger files.

FormatTypeEfficiency relative to MP3Typical role
MP3Lossy, transform codecBaselineUniversal compatibility
AACLossy, improved transform codecBetter, especially below 128 kbpsStreaming, mobile, video
OpusLossy, hybrid speech and musicMuch better at low bit ratesVoice calls, web audio
Ogg VorbisLossy, open codecBetter at mid bit ratesGames and open platforms
FLAC and ALACLosslessNot comparable, larger filesArchiving, high-quality listening
WAVUncompressed PCM containerNot comparable, largest filesProduction and editing
MP3 and neighboring audio formats

Choosing and encoding MP3 files

MP3 remains a sensible choice when maximum device compatibility matters more than efficiency. The decisive rule is to encode once from a lossless source and never use an MP3 as a master.

SituationRecommended settingReason
Music library for any deviceHigh-quality VBR encodeNear transparent, smaller than 320 kbps
Spoken-word podcast64 to 96 kbps mono, 44.1 kHzSmall files, clear speech
Delivery to an unknown playerCBR 192 or 320 kbpsPredictable size and seeking
Archiving or later editingUse FLAC or WAV insteadAvoids generation loss
MP3 decisions by situation

Metadata is stored in ID3 tags, usually ID3v2 at the start of the file for title, artist and cover art. Gapless playback requires an encoder that records encoder delay and padding, because every MP3 adds a short silence at the start and end of the stream.

Limitations and common artifacts

MP3 artifacts become audible when the bit budget is too small for the material or when the psychoacoustic model makes poor decisions. Recognizing them helps decide whether a higher bit rate or a different codec is needed.

  • Pre-echo appears as a soft smear before sharp attacks such as castanets or snare hits.
  • Swirling or watery highs come from bands that switch on and off between frames at low bit rates.
  • A missing top octave results from encoders applying a low-pass filter around 16 kHz or lower to save bits.
  • Generation loss: re-encoding an MP3 into another lossy format adds new artifacts on top of the old ones.
  • Clipping on decode can occur when loud masters overshoot full scale after encoding, so leave about 1 dB of true-peak headroom.

The simple explanation

MP3 is a way to make music files much smaller by leaving out sounds people would not notice anyway. Quiet details hidden behind louder sounds are simplified or removed.

A song that takes about 40 megabytes on a CD becomes roughly 4 megabytes as an MP3. At sensible settings most listeners cannot tell the difference, but the removed details can never be brought back.

How it is used in practice

A community radio station publishes its weekly interview program as a podcast. The producer mixes the show in a 48 kHz, 24-bit WAV project and exports a lossless master for the archive.

For distribution, the producer encodes an MP3 at 96 kbps mono, 44.1 kHz, with ID3 tags for episode title, description and cover art. A 60-minute episode becomes about 43 megabytes, small enough for listeners on mobile data. Because MP3 plays on virtually every phone, car system and podcast app, listeners report no playback problems, and the archived WAV allows a better encode later if the station changes formats.