FLAC (Free Lossless Audio Codec) is an open, royalty-free lossless audio codec that compresses PCM audio without discarding any information, so decoding returns a bit-identical copy of the original samples. Among audio formats and codecs, it is the most widely supported lossless option for music archiving, high-resolution distribution and personal libraries.
A FLAC file typically takes about 50 to 70 percent of the size of the equivalent WAV file, depending on the music. The format is specified openly, was standardized by the IETF as RFC 9639, and has reference encoders and decoders available as free software.
How FLAC compresses audio without loss
FLAC splits the audio into blocks of samples, commonly 4,096 samples per channel, and compresses each block independently. Within a block, the encoder first exploits inter-channel redundancy, for example by coding the left channel and the difference between channels instead of two full channels.
The central step is linear prediction: the encoder fits a predictor of up to 32 coefficients that estimates each sample from the preceding ones, and stores only the coefficients and the prediction residual. Because music changes smoothly from sample to sample, the residual values are small and can be stored with far fewer bits.
The residual is then coded with Rice coding, an entropy code that represents small numbers in very few bits. Every frame carries a CRC checksum, and the file header stores an MD5 signature of the original audio, so a decoder can verify that the output matches exactly.
| Stage | What it does | Why it saves space |
|---|---|---|
| Blocking | Splits audio into short frames | Lets the encoder adapt to changing music |
| Channel decorrelation | Codes side or difference signals | Removes information shared by channels |
| Linear prediction | Estimates samples from earlier ones | Leaves only small residual values |
| Rice coding | Entropy-codes the residual | Uses fewer bits for small numbers |
| Checksums | Adds CRC per frame and MD5 per file | Detects corruption, adds negligible size |
Compression levels and supported parameters
The reference encoder offers compression levels from 0 to 8. Higher levels search harder for good predictors, which slows encoding but changes the output size only by a few percent; decoding speed stays almost the same at every level, and the audio is identical in all cases.
| Parameter | Supported range | Common values |
|---|---|---|
| Bit depth | 4 to 32 bits per sample | 16-bit and 24-bit |
| Sample rate | Up to several hundred kHz | 44.1, 48, 96 and 192 kHz |
| Channels | 1 to 8 | Stereo, sometimes 5.1 |
| Compression level | 0 to 8 | Default level 5 |
| Typical size versus WAV | About 50 to 70 percent | Lower for sparse, quiet music |
Compression ratio depends on the content: solo piano or quiet classical music compresses well, while dense, heavily limited rock or electronic music and recordings with substantial noise compress least. Metadata is stored in Vorbis comment tags, and cover art can be embedded in a picture block.
FLAC compared with other audio formats
FLAC sits between uncompressed PCM and lossy codecs: it saves storage like a codec but keeps every bit like WAV. Its closest relative is ALAC, which uses similar techniques and offers similar compression.
| Format | Type | Typical size versus WAV | Typical use |
|---|---|---|---|
| WAV | Uncompressed PCM | 100 percent | Recording and editing |
| FLAC | Lossless, open | About 50 to 70 percent | Archiving and lossless distribution |
| ALAC | Lossless | About 50 to 70 percent | Lossless audio on Apple platforms |
| MP3 | Lossy | About 10 to 20 percent | Legacy downloads and players |
| AAC | Lossy | About 10 to 20 percent | Streaming and video soundtracks |
| Opus | Lossy | Often under 10 percent | Voice, streaming, low latency |
A key advantage of lossless audio is transcoding without generation loss: a FLAC master can be converted to any lossy format repeatedly, each time from the full-quality source. Converting one lossy format into another, by contrast, compounds artifacts.
When to use FLAC and when not to
FLAC is the right choice when exact preservation matters and playback devices support it. It is less suitable during active production, where editing software and delivery specifications usually expect WAV or BWF files.
| Situation | Recommended format | Reason |
|---|---|---|
| Archiving a CD collection | FLAC | Exact copy at about half the space |
| Studio editing session | WAV | Universal support in editing software |
| Selling lossless downloads | FLAC, often with ALAC | Broad player compatibility |
| Mobile listening with little storage | AAC or Opus | Much smaller files |
| Broadcast delivery | WAV or BWF | Required by most specifications |
Common misconceptions about FLAC
- Higher compression levels do not sound better or worse: every level decodes to identical audio.
- A FLAC file is only as good as its source: converting an MP3 to FLAC keeps the MP3’s losses in a larger file.
- High-resolution FLAC is not automatically better: a 24-bit / 192 kHz file mainly adds size unless the recording and playback chain benefit from it.
- Lossless does not mean uncompressed: the data is compressed, but nothing is thrown away.
In plain words
FLAC works like a zip file made especially for music. It packs a recording into roughly half the space. When the file is played, it unpacks to exactly the same sound that went in.
Formats such as MP3 save space by throwing away sounds that listeners are unlikely to notice. FLAC throws away nothing. That makes it the choice for people who want a perfect copy of their music, and are willing to use more storage than with MP3.
A real-world example
A community radio station digitizes 2,000 CDs from its music library before the discs deteriorate. Ripped as WAV, the collection would need about 1.4 TB; encoded as FLAC at level 8, it fits in roughly 850 GB, with album, artist and track tags stored inside each file.
Each rip is verified against the disc, and the MD5 signature stored in every FLAC file lets the archivist confirm years later that no file has been corrupted. When the station needs MP3 files for an online player, it converts them directly from the FLAC archive, so the originals stay untouched and the conversion can be repeated whenever a better codec appears.