FLAC - Free Lossless Audio Codec
FLAC shrinks audio without changing a single sample, so it decodes back to the exact original. You meet it in CD archives and high-quality music downloads.
FLAC stands for Free Lossless Audio Codec, and it does what the name says: it makes an audio file smaller without changing a single sample. Josh Coalson started the project, and it is now looked after by the Xiph.Org Foundation, the non-profit behind Vorbis and Opus. Both the format and its reference software are open and royalty-free, which is one reason FLAC became the standard way to archive a CD collection and the usual download option on artist-run music stores.
How FLAC compresses without losing anything
Lossless compression sounds like a contradiction next to MP3, but it is the same idea a ZIP file uses, tuned for sound. FLAC splits the audio into blocks and, for each block, fits a simple mathematical prediction of where the waveform is heading. It then stores only that prediction and the small errors left over, packed with an efficient coding scheme. Decoding runs the prediction again and adds the errors back, which reproduces the original samples bit for bit. How much you save depends on the music, but a FLAC file is normally far smaller than the same recording as WAV.
FLAC handles up to eight channels, bit depths beyond CD quality and very high sample rates. Like MP3 it is frame-based, so it can be streamed and skipped through without reading the whole file first. Its header also stores an MD5 fingerprint of the uncompressed audio, so software can prove years later that a file still decodes to precisely what was ripped. The same codec can be carried inside an Ogg container as well, though the plain FLAC file is what you normally meet.
What metadata a FLAC file carries
A FLAC file opens with a series of metadata blocks, each with a defined job. STREAMINFO is the technical one and is always present: sample rate, channel count, bits per sample, the total number of samples and that MD5 fingerprint. SEEKTABLE helps players jump around, CUESHEET can describe the track layout of a whole CD, PICTURE holds embedded artwork with its own type and description, and PADDING is simply blank space so that tags can be edited later without rewriting the file.
The descriptive tags live in the VORBIS_COMMENT block, the same tagging system Ogg uses. It is a list of plain-text pairs, each a field name and a value, so it is not limited to a fixed set. TITLE, ARTIST, ALBUM, ALBUMARTIST, DATE, TRACKNUMBER, DISCNUMBER, GENRE, COMPOSER, PERFORMER, COPYRIGHT, ISRC and COMMENT are all common, and any field may appear more than once, which is how a track credits two artists.
Because any program can invent a field, this block often says as much about the software chain as about the music. ENCODER names the tool and version that made the file. Ripping software adds its own entries: identifiers tying the disc to an online music database, ratings, play counts, replay gain measurements and sometimes the drive that read the CD. Those free fields are also where a personal note, a real name or an email address ends up if somebody typed one into a tagger. FLAC has no standard field for a location or a device, so a music file rarely reveals where you were, but anything a person or an application chose to write is sitting there in readable text.
When to use FLAC
FLAC is the right choice for keeping audio: a CD collection, master recordings, anything you may want to convert again later. Against WAV it wins on size and on tagging, and it is still bit-identical to the source. Against MP3 or AAC it is much larger, so it is a poor fit for a phone with little space or for a busy website. Apple devices favour ALAC, another lossless format built on the same idea, and converting between the two costs you nothing at all, because both keep every sample.