FLAC
On the 20th of July 2001, Josh Coalson released version 1.0 of FLAC. The name stood for Free Lossless Audio Codec, and the format carried a guarantee no popular audio software of the time could match. Compress a digital audio file with FLAC, decompress it, and you recover a bit-for-bit copy of the original.
That promise divided the audio world into two philosophies. Lossy formats discard data in exchange for smaller files. FLAC discards nothing. How does compression without data loss even work? What made archivists trust it enough to stake irreplaceable recordings on it? And how does a volunteer codec project become an international standard?
FLAC's reference implementation offers nine compression levels, labeled 0 through 8, and the choice between them involves a specific trade-off. Benchmark data cited by the project shows that going beyond level 5, the default, costs substantially more encoding time for diminishing space savings. Decoding speed barely changes across any of the nine levels.
The encoding process consists of multiple stages, starting with dividing the audio into blocks. If a recording uses multiple channels, each channel becomes a separate subblock and is processed independently. The encoder then searches for a mathematical shortcut. It models the block's waveform by fitting either a simple polynomial or a technique called linear predictive coding. That model description is only a few bytes long.
What remains when the model is subtracted from the actual audio is called the residual. FLAC encodes that residual using Rice coding. This method performs well on the small numbers that typically represent the gap between a prediction and the actual audio. Storing the model description and the Rice-coded residual together usually takes less space than storing raw pulse-code modulation data.
For stereo recordings, FLAC may apply joint encoding. The two channels are represented as a side channel, which is their difference, and a mid channel, which is their sum. The encoder may replace the mid channel with either the left or right channel directly, when doing so saves more space.
The format allows the block size in samples to vary from one block to the next within the same file. More flexible implementations can exploit that variability to optimize beyond what the reference encoder provides.
Every FLAC file opens with the four-character sequence fLaC, a marker the format calls its magic number. Playback software reads this sequence to confirm the file is valid FLAC before proceeding.
Following the magic number comes a metadata block. Sample rate and channel count are always stored there. The metadata section may also carry album cover art. Textual tags such as track title and artist name are stored using the Vorbis comment format.
The encoded audio is divided into frames. Each frame contains a header, a data block, and a CRC16 checksum. The checksum allows software to verify a frame's integrity independently of any other frame in the file. Frame headers begin with a sync word marking the start of a valid frame. They also record the sample count, the frame's position in the stream, and the channel assignment.
Because each frame is self-contained, a media player navigating to a later point in a long recording does not need to process every preceding frame. It can calculate the target position and begin decoding from that point directly.
ZIP, the general-purpose compression format used in everyday file archiving, reduces a CD-quality audio file by roughly 10 to 20 percent. FLAC achieves reductions of 40 to 50 percent on the same material by exploiting patterns specific to how audio data is structured.
If a CD is lost, scratched, or worn beyond reading, a FLAC backup of its audio tracks serves as a complete replacement. An MP3 of the same content cannot make that claim; the data discarded during MP3 compression is permanently gone.
Converting from FLAC to MP3 does not compound quality loss, because the FLAC file already contains the complete original audio. Converting between two lossy formats degrades the audio further with each generation.
When ripping a CD, listeners may optionally create a CUE file alongside the FLAC audio. If the disc is read without errors, the CUE file records the original track order and the pregap timing between tracks. A compatible burning program can then create a new audio CD whose audio content is identical to the original. Lyrics and CD+G graphics are not captured this way. CD-Text data from the CUE sheet may, however, be recovered by some burning programs and written to blank CD-R media.
FLAC's design also supports streaming. The format decodes quickly regardless of the compression level used to create the file. That speed set it apart from other lossless formats of its era.
On the 29th of January 2003, the Xiph.Org Foundation and the FLAC project announced that FLAC would be incorporated under the Xiph.org umbrella. Xiph.org was already home to other free compression formats: Vorbis, Theora, Speex, and Opus. FLAC joined an ecosystem built around royalty-free, openly licensed compression standards.
The format is not known to be covered by any patents, and anyone may write their own FLAC implementation without permission or fees. That open design encouraged FLAC support to spread across a wide range of independent software projects.
The reference implementation is called libFLAC. It provides a C library for encoding, decoding, and metadata manipulation. A C++ wrapper, libFLAC++, is also part of the package. Two command-line tools, flac and metaflac, ship alongside the library and handle encoding and metadata work from a terminal. The library compiles on platforms including Linux, BSD variants, Windows, BeOS, and OS/2.
Version 1.3.0 was released on the 26th of May 2013. At that point, development of the reference implementation moved to the Xiph.org git repository.
In 2019, FLAC was proposed as an IETF standard. In December 2024, the specification was formally published. The standardization effort was driven in part by the specific needs of archival and preservation work.
The National Archives and Records Administration of the United States lists FLAC as a preferred format for digital audio. The IETF process cited archival and preservation use as a core application, connecting institutional recognition to the technical properties that set FLAC apart from lossy formats.
Windows 10 was the first version of Microsoft's operating system to include FLAC playback by default. Android added native support in version 3.1. macOS introduced it in version 10.13, marketed as High Sierra. iOS gained FLAC playback in version 11, though support there depends on the hardware.
Windows Media Player gained FLAC support in its 2022 release. That version also handles FLAC delivered in an Ogg container, allowing playback of live audio streams from services such as Icecast internet radio. Android's native player originally supported only the standard FLAC file format; the Files app from Google later added Ogg FLAC support as well.
The bitstream format that FLAC's December 2024 standard describes was fixed as early as version 0.9, released on the 31st of March 2001. That freeze came more than two decades before the formal standard appeared.
Up next
Updated
Common questions
What does FLAC stand for?
FLAC stands for Free Lossless Audio Codec. It typically reduces digital audio to between 50 and 70 percent of its original size, and decompressing a FLAC file yields a bit-for-bit copy of the original audio data.
Who created FLAC and when was it first released?
Josh Coalson began development of FLAC in 2000. Version 1.0 was released on the 20th of July 2001. On the 29th of January 2003, the project was incorporated under the Xiph.Org Foundation.
Is FLAC audio lossless or lossy?
FLAC is lossless. Decompressing a FLAC file produces an exact, bit-for-bit copy of the original audio data, with no quality loss compared to the source.
Which operating systems support FLAC natively?
Windows 10, macOS 10.13 (High Sierra), Android 3.1, and iOS 11 all include native FLAC support. iOS 11 support depends on the specific hardware in use.
Why does the National Archives use FLAC for audio preservation?
The National Archives and Records Administration of the United States lists FLAC as a preferred format for digital audio. The IETF standardization process cited archival and preservation use as a core application for the format.
Is FLAC an official international standard?
FLAC was proposed as an IETF standard in 2019 and formally published as an official standard in December 2024. The format carries no known patent restrictions and is royalty-free, meaning anyone may write their own implementation.
All sources
28 references cited across the entry
- 1FLAC – formatJosh Coalson — Xiph.Org Foundation
- 2PlayOgg!17 March 2010
- 3Looking at Flac Compression RatiosSteven Pigeon — 7 February 2012
- 4FeaturesXiph.Org Foundation
- 5FLAC Joins Xiph.org29 January 2003
- 6FLAC Joins Xiph!Emmett Plant
- 8Free Lossless Audio CodecMartijn van Beurden et al.
- 9FLAC - FLAC is now formally specified in RFC 9639Josh Coalson
- 10About the FLAC FormatJosh Coalson
- 12lpc.c
- 18FAQ
- 20Links
- 22Android Supported Media Formats27 September 2024