The basics
What is a FLAC file?
FLAC is the standard way to store music without losing any of it. It works like a ZIP file made for sound: the encoder shrinks the audio, and the decoder rebuilds exactly the original samples. Rip a CD to FLAC, decode it again, and you get the same bits as the disc. That makes it the usual choice for music archives, CD rips, high-resolution downloads and anyone who wants to keep a perfect master and make MP3 or AAC copies from it later.
It's open in every sense. The format has no known patents, the reference encoder and decoder are free software, and since December 2024 the format has been an IETF standard, RFC 9639. Browsers, phones, music players and audio editors all read it.
How much smaller than a WAV? It depends on the recording. Quiet, simple music shrinks more than loud, dense music full of noise and cymbals, because FLAC works by predicting the next sample, and noise is unpredictable. Our featured sample, made of clean generated chords, comes out at 128,784 bytes for 705,880 bytes of WAV, 18% of the size. Real recordings shrink much less than synthetic tones like these.
Lossless only goes one way
Converting an MP3 or AAC file to FLAC gives you a bigger file with exactly the same lost detail. FLAC preserves whatever it's given; it can't restore what a lossy encoder threw away.
Anatomy
What's inside a FLAC file
A FLAC file is the 4-byte signature fLaC, a chain of metadata blocks, then audio frames. Each metadata block starts with a 4-byte header: 1 bit that says whether it's the last block, 7 bits for the type and 24 bits for the length. Here are the real bytes of sample-cd-quality.flac, our 4-second sample. Numbers are big-endian.
offset bytes meaning
0 66 4C 61 43 "fLaC"
4 00 00 00 22 STREAMINFO block, 34 bytes
8 10 00 10 00 block size: 4,096 samples
12 00 00 BB 00 0B CE frame size: 187 to 3,022 bytes
18 0A C4 42 F0 00 02 B1 10 44,100 Hz, 2 ch, 16 bits, 176,400 samples
26 AF D4 C9 2E 93 AC 8E 8A 7C CB D0 73 … MD5 of the decoded audio
42 03 00 00 48 SEEKTABLE block, 72 bytes: 4 points
118 04 00 01 50 VORBIS_COMMENT block, 336 bytes
122 20 00 00 00 72 65 66 65 72 65 6E 63 … vendor string, then 8 tags
458 06 00 26 27 PICTURE block, 9,767 bytes
462 00 00 00 03 00 00 00 09 69 6D 61 67 … type 3 (front cover), "image/png"
10,229 81 00 04 00 PADDING block, 1,024 bytes, last block
11,257 FF F8 C9 88 00 23 … audio frame 0
… 44 frames in all
128,784 end of file- 1
66 4C 61 43The signature
fLaCin ASCII, the format's magic number. Some tools put an ID3v2 tag in front of it. That isn't part of the FLAC format, and not every decoder skips it. - 2
00 00 00 22A metadata block header
First bit 0: more blocks follow. Type 0: STREAMINFO. Length
0x22, 34 bytes. STREAMINFO is required and always comes first. - 3
10 00 10 00 · 00 00 BB 00 0B CEBlock and frame sizes
Every frame holds 4,096 samples per channel (the encoder's default block size). The smallest frame is 187 bytes and the largest 3,022: quiet passages compress far better than loud ones.
- 4
0A C4 42 F0 00 02 B1 10The format, bit-packed
20 bits of sample rate (
0x0AC44= 44,100), 3 bits of channels minus 1, 5 bits of bit depth minus 1 (15, so 16 bits) and 36 bits of total samples per channel (176,400, which is 4.000 seconds). A total of 0 means the length is unknown. - 5
AF D4 C9 2E …The MD5 signature
A checksum of the original audio samples. A decoder that recalculates it can prove the file decodes to exactly what was encoded:
flac -tdoes this. It matches the MD5 of the PCM samples in our WAV sample, because this file is that audio. - 6
03 00 00 48The seek table
4 seek points, one per second here, each giving a sample number and the byte offset of the frame that contains it. Players use it to jump to a time without scanning the file.
- 7
04 00 01 50Vorbis comments: the tags
The same tag format Ogg Vorbis uses: a vendor string naming the encoder, then
NAME=valuepairs in UTF-8, such asTITLE=,ARTIST=,ALBUM=. Note that the lengths inside this block are little-endian, unlike the rest of the file. - 8
06 00 26 27The picture
An embedded image with a picture type (3 is the front cover), its MIME type, a description, its dimensions and the image file itself, here a 300×300 PNG.
- 9
81 00 04 00Padding, and the last-block flag
0x81: the first bit is set (this is the last metadata block) and the type is 1, PADDING. 1,024 zero bytes leave room to add tags later without rewriting the audio. - 10
FF F8 C9 88 00 23An audio frame header
The sync code
FF F8(fixed block size), thenC9: block size code 12 (4,096 samples) and sample rate code 9 (44.1 kHz);88: left/side stereo, 16 bits;00: frame number 0;23: a CRC-8 of the header. Every frame ends with a CRC-16, so damage is detected frame by frame.
Under the hood
How FLAC compresses without losing anything
- 1Split into blocks. The audio is cut into blocks, usually 4,096 samples per channel (about 93 ms at 44.1 kHz). Each block becomes one frame, which decodes on its own.
- 2Use the stereo image. For stereo, the encoder can store left and right, or one channel plus the difference between them (left/side, side/right, mid/side), whichever is smaller. The difference is often small when both channels are alike.
- 3Predict. Each channel's samples are predicted from the previous few, with either a fixed polynomial predictor or a linear predictor (LPC) whose coefficients are stored in the frame. In our featured file, 77 of the 88 channel blocks use a fixed predictor and 11 use LPC.
- 4Store the error. What's left, the difference between the prediction and the real sample (the residual), is usually small, and is packed with Rice coding, which uses few bits for small numbers.
- 5Check everything. Each frame carries a CRC, and STREAMINFO holds an MD5 of the whole original, so any corruption shows up.
The flac encoder's levels -0 to -8 only decide how hard it searches for good predictions. Every level is lossless; higher levels make slightly smaller files and take longer to encode, while decoding stays about as fast. Level 5 is the default.
Structure
Metadata blocks: tags, cover art and more
| Type | Block | What it holds |
|---|---|---|
| 0 | STREAMINFO | Required, always first: sample rate, channels, bit depth, total samples, block and frame sizes, MD5. |
| 1 | PADDING | Zero bytes reserved so tags can grow without rewriting the file. |
| 2 | APPLICATION | Data for a specific program, identified by a registered 4-byte ID. |
| 3 | SEEKTABLE | Seek points: sample numbers and the byte offsets of their frames. |
| 4 | VORBIS_COMMENT | The tags: NAME=value pairs in UTF-8, the same system Ogg uses. Common names: TITLE, ARTIST, ALBUM, ALBUMARTIST, TRACKNUMBER, DATE, GENRE, plus ReplayGain values. |
| 5 | CUESHEET | Track and index points, so a whole CD can be one FLAC file. |
| 6 | PICTURE | An embedded image with a picture type: 3 is the front cover, 4 the back cover, and so on. |
Unknown block types are skipped by length, so new kinds can be added without breaking old decoders. FLAC files don't normally use ID3 tags; when a tool adds one in front of fLaC, some players cope and some refuse the file.
Variants
Bit depth, sample rate, hi-res and surround
FLAC stores whatever PCM it's given, from 4 to 32 bits per sample and from 1 to 8 channels. Common combinations, with the uncompressed data rate the FLAC file starts from:
| Format | Where it's used | Uncompressed per minute |
|---|---|---|
| 16-bit, 44.1 kHz, stereo | CD audio | About 10.6 MB |
| 24-bit, 48 kHz, stereo | Video soundtracks, studio work | About 17.3 MB |
| 24-bit, 96 kHz, stereo | Hi-res downloads | About 34.6 MB |
| 24-bit, 192 kHz, stereo | Hi-res downloads | About 69.1 MB |
| 16-bit, 48 kHz, 5.1 | Surround mixes | About 34.6 MB |
With 3 to 8 channels, FLAC has a fixed default order. For 6 channels it's front left, front right, front centre, LFE (subwoofer), then back or surround left and right. Our sample-5.1-surround.flac plays a tone on each speaker in that order, a second at a time. A file with a different layout says so with a WAVEFORMATEXTENSIBLE_CHANNEL_MASK tag.
A higher sample rate only adds frequencies above what a 44.1 kHz file can hold (22.05 kHz), which most adults can't hear. Our hi-res sample sweeps up to 40 kHz to make that range visible in an analyser. Converting a CD rip to 24-bit or 96 kHz makes it bigger, not better.
Related formats
FLAC vs WAV, ALAC, MP3 and AAC
| Format | Compression | Notes |
|---|---|---|
.flac | Lossless | Smaller than WAV, with proper tags, cover art and a built-in checksum. The open standard for lossless music. |
.wav | None | The working format of audio editors. Bigger, and its tag support is weak, but every tool reads it. Limited to 4 GB. |
.m4a (ALAC) | Lossless | Apple Lossless: similar compression to FLAC, best supported in Apple's apps. Converting between ALAC and FLAC is lossless. |
.mp3 | Lossy | A fraction of the size, some detail gone for good. For listening and sharing. |
.m4a, .aac (AAC) | Lossy | Better than MP3 at the same bit rate. What most streaming and phone audio uses. |
FLAC audio can also travel inside other containers: in Ogg (as .oga), in Matroska (.mka, .mkv) and in MP4. Those files use the container's structure and tags, not the fLaC layout above, though the audio frames are the same.
Troubleshooting
Common FLAC problems and their causes
- No duration shown, or seeking doesn't work: the file was encoded from a stream (a live recording or a pipe), so STREAMINFO's total samples is 0 and there's no seek table. Re-encode it with
ffmpeg -i in.flac fixed.flac, which writes the length and MD5, then add a seek table withmetaflac --add-seekpoint=10s fixed.flac. Oursample-streamed-no-length.flacis a file like this. flac -treports an MD5 mismatch: the audio has been damaged or edited by a tool that didn't update the checksum. If the frames' CRCs also fail, the file is corrupt; decode withflac -d -Fto recover what's left.- A car stereo or old player won't play it: many older devices only handle 16-bit, 44.1 or 48 kHz stereo FLAC. Convert hi-res or surround files:
ffmpeg -i in.flac -sample_fmt s16 -ar 44100 out.flac. - Tags or cover art not shown: the tags may be in an ID3 tag in front of the file instead of in Vorbis comments, or the picture may not be marked as the front cover (type 3).
- Clicks between tracks of a CD rip: usually the ripper, not FLAC. FLAC itself is gapless: it stores the exact sample count, with no encoder delay or padding.
How to
How to open, edit and convert a FLAC file
- Play it: Windows 10 and 11 play FLAC in their built-in Media Player app. On a Mac, VLC or another third-party player is the dependable choice. Android plays FLAC natively, and every current browser plays it when you drag the file in or put it online.
- Edit the sound: Audacity (free, Windows, macOS, Linux) opens and exports FLAC. Edits change the samples, but saving again as FLAC adds no compression loss.
- Edit tags: Mp3tag, Kid3, foobar2000, MusicBrainz Picard, or
metaflac --set-tag=TITLE="New title" file.flacon the command line. - Check a file:
flac -t file.flacdecodes it and compares the MD5.metaflac --list file.flacshows every metadata block. - Convert: from WAV,
flac -8 in.wavorffmpeg -i in.wav out.flac. To MP3,ffmpeg -i in.flac -c:a libmp3lame -q:a 2 -map_metadata 0 out.mp3. To ALAC for Apple's Music app,ffmpeg -i in.flac -c:a alac out.m4a.
Free downloads
Sample FLAC files to download
Free sample FLAC files for testing players, tag readers, upload forms and lossless pipelines. The sounds are generated chords, tones and sweeps, encoded with the reference flac 1.4.3 encoder at level 8. Each file was checked with flac -t, ffprobe and a full decode.
What's inside sample-cd-quality.flac
A 4-second, CD-quality FLAC (16-bit, 44.1 kHz, stereo) with tags, cover art, a seek table and padding: the file shown byte by byte in the anatomy above.
The music
Four one-second chords (C, A minor, F, G), exactly the audio in our 4-second WAV sample. Decode one and compare it with the other: the samples are identical.
Compression
705,600 bytes of PCM become 117,527 bytes of audio frames, and 128,784 bytes in all with the metadata.
STREAMINFO
44,100 Hz, 2 channels, 16 bits, 176,400 samples per channel, and the MD5
afd4c92e93ac8e8a7ccbd0731a2b8b08.Seek table
4 seek points, one per second.
Vorbis comments
Title, artist, album, date, genre, track number, a comment and a contact URL pointing to this page.
Cover art
A 300×300 PNG in a PICTURE block with type 3, front cover.
Padding
A 1,024-byte PADDING block, marked as the last metadata block, so tag editors can add fields in place.
All sample FLAC files
CD quality with tags and cover art
sample-cd-quality.flac · 125.8 KB (128,784 bytes)
4 seconds, 16-bit, 44.1 kHz stereo, with Vorbis comments, a front-cover PNG, a seek table and padding. The same audio as our WAV sample.
- Checking a player, host or upload form handles standard FLAC
- Testing tag readers and cover art display
Hi-res: 24-bit, 96 kHz
sample-24bit-96khz.flac · 219.9 KB (225,179 bytes)
A 3-second sine sweep from 20 Hz to 40 kHz, stereo. The top half of the sweep is above human hearing and above what a 44.1 kHz file can store. Turn the volume down: it's a test tone.
- Testing hi-res support in players and devices
- Checking whether a pipeline resamples or truncates to 16 bits
5.1 surround channel test
sample-5.1-surround.flac · 93.2 KB (95,391 bytes)
6 channels at 48 kHz, 16-bit. A tone plays on one speaker at a time, in FLAC's order: front left (440 Hz), front right, front centre, LFE (55 Hz), back left, back right. A DESCRIPTION tag lists them.
- Checking channel order and mapping in players and converters
- Testing what a stereo device does with multichannel FLAC
Streamed FLAC with no length or MD5
sample-streamed-no-length.flac · 58.2 KB (59,637 bytes)
4 seconds of mono chords encoded from a pipe: STREAMINFO says total samples 0 and the MD5 is all zeros, with no seek table. Valid, but players can't know the duration in advance.
- Testing duration display and seeking when the length is unknown
- Validators that wrongly reject an unset MD5
1 MB FLAC file
sample-1mb.flac · 1 MB (1,048,576 bytes)
36 seconds of the chords on a loop, 16-bit, 44.1 kHz stereo, with a PADDING block sized to make the file exactly 1,048,576 bytes (1 MiB).
- Upload and size-limit tests
- Streaming and buffering tests
Ways to test with them
- Losslessness: decode
sample-cd-quality.flacwithffmpeg -i sample-cd-quality.flac -f s16le - | md5sum. The result,afd4c92e…, is the MD5 stored in its STREAMINFO and the MD5 of our WAV sample's audio. - Hi-res: play
sample-24bit-96khz.flacthrough your pipeline and check the output's sample rate and bit depth. A spectrum analyser shows the sweep continuing above 22 kHz only if nothing downsampled it. - Channel mapping: play
sample-5.1-surround.flacon a surround system; the tones should move around the room in the order listed. On stereo, check how the converter downmixes. - Unknown length:
sample-streamed-no-length.flacshould still play. Watch what the player shows for duration and whether seeking works. - Upload limits:
sample-1mb.flacis exactly 1 MiB, so you can test a limit at the boundary.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have a FLAC file? Give it a link.
Drop a FLAC on 99helpers and it gets its own address that plays in the browser at full, lossless quality, with nothing to install. Handy for sending a master or a mix for review.
Questions
FLAC files, frequently asked
What does FLAC stand for?
Free Lossless Audio Codec. Free because it's open and royalty-free, lossless because decoding gives back exactly the original audio.
Is FLAC better than MP3?
It keeps everything, so it's better for archiving and for making other copies from. For everyday listening, a good MP3 or AAC is much smaller and most people can't tell the difference.
Is FLAC better than WAV?
For storing and sharing, usually yes: the same audio in a smaller file, with proper tags, cover art and a checksum. WAV is simpler and is still what many audio editors and studio tools prefer to work with.
Does converting MP3 to FLAC improve quality?
No. The detail an MP3 discarded is gone. The FLAC copy is lossless relative to the MP3, so it just takes more space.
Can browsers play FLAC?
Yes. All current major browsers play FLAC files. Very high sample rates or more than two channels may be resampled or mixed down by the browser.
Does iPhone play FLAC?
Yes, iPhones can play FLAC files, for example from the Files app. Apple's own lossless format is ALAC, which converts to and from FLAC without loss.
What's the best FLAC compression level?
Any of them: all levels are lossless and decode equally fast. Level 5 is the default; level 8 saves a little more space for a slower encode.
How do I check a FLAC file isn't corrupt?
Run flac -t file.flac. It decodes every frame, checks each frame's CRC and compares the result with the MD5 stored in the file.
Related formats
Other file types explained
Keep going
Related
Sources
- RFC 9639: Free Lossless Audio Codec (FLAC)
- Xiph.Org: FLAC 1.0 is out (July 2001)
- Library of Congress: FLAC, Free Lossless Audio Codec
- MDN: Media container formats (FLAC)
- MDN: Web audio codec guide
Last reviewed 27 October 2026.