What Is a .FLAC File?
FLAC audio bitstream data
FLAC Lossless Audio (.flac)
Overview
FLAC (Free Lossless Audio Codec) is an open-source lossless audio compression format that reduces file size without any loss in audio quality. Unlike lossy formats like MP3, FLAC preserves the exact audio data from the original source, making it ideal for audiophiles and professional audio applications.
"Lossless" is a precise claim: decode a FLAC file and you get back the identical samples that went in, bit for bit. The file is smaller than the WAV it came from because the encoder finds mathematical patterns in the audio and stores those instead, the same way a ZIP archive stores a text file. Nothing is thrown away, which is the difference from MP3, AAC and Opus.
Technical Specifications
- File Extension:
.flac(older.flais rare; FLAC inside an Ogg container uses.oga) - MIME Type:
audio/flac(alsoaudio/x-flac) - Category: Audio
- Magic bytes:
66 4C 61 43(fLaC) at offset 0 - Specification: RFC 9639 (2024), maintained by the Xiph.Org Foundation
- Licence: BSD-style, patent-free
- Reference implementation: libFLAC
Identification
00000000 66 4c 61 43 00 00 00 22 12 00 12 00 00 00 0e 00 |fLaC..."........|
00000010 5c 7e 0a c4 42 f0 00 c4 3d 70 ... |\~..B...=p...|
The ASCII fLaC marker is followed immediately by a STREAMINFO metadata block (type 0, 34 bytes) holding the sample rate, channel count, bit depth, total samples and an MD5 of the decoded audio. That embedded MD5 is a built-in integrity check: flac -t file.flac decodes the file and compares, which is how you verify a rip or a download is intact.
Technical Details
Compression Technology
- Lossless compression: Perfect reconstruction of the original audio
- Linear prediction: each block is modelled as a predictor plus a residual; only the residual is stored, Rice-coded
- Typical compression: 30 to 60 percent of the original size for music; less for noise and dense mixes, more for quiet or sparse material
- Fast decoding: Efficient playback with minimal CPU usage, which is why portable players and phones handle it easily
Audio Specifications
- Sample rates: 1 Hz to 655,350 Hz (44.1, 48, 96 and 192 kHz in practice)
- Bit depths: 4 to 32 bits per sample (16-bit CD audio and 24-bit masters in practice)
- Channels: 1 to 8 channels (mono to 7.1 surround)
- Streamable: every frame carries a sync code and header, so playback can start mid-file and damaged sections affect only their own frames
Metadata Support
- Vorbis Comments: flexible
KEY=valuetagging (TITLE, ARTIST, ALBUM, DATE, TRACKNUMBER and anything else) - Embedded cue sheets: track boundaries for an album ripped as a single file
- Album art: embedded PICTURE blocks
- ReplayGain: volume normalisation data
History and Development
FLAC was developed by Josh Coalson and first released in 2001. The format was created to provide a free, open-source alternative to proprietary lossless formats. In 2013, development was transferred to the Xiph.Org Foundation, which continues to maintain and improve the format. The specification was published as an IETF standard, RFC 9639, in 2024, which settled the format for archival use.
How to Open a FLAC File
Support is now nearly universal; the historical gap was Apple, and that closed in 2017.
Windows
- Windows 10 and 11: Media Player and Groove play FLAC natively, and File Explorer shows tags and duration.
- VLC, foobar2000 and MusicBee for anything more than basic playback; foobar2000 is the usual choice for large libraries.
macOS
- QuickTime Player and Finder Quick Look play FLAC since macOS High Sierra.
- Music.app does not import FLAC. Convert to ALAC (Apple Lossless) to add it to a Music library; the conversion is lossless in both directions.
- VLC, IINA and Swinsian play it directly.
Linux
- Native everywhere: Rhythmbox, Audacious, Clementine, Strawberry, mpv and VLC.
iPhone and iPad
- The Files app plays FLAC (iOS 11 and later), and so do VLC, Foobar2000 Mobile and most third-party players.
- Apple Music and the built-in Music app do not; convert to ALAC to sync through them.
Android
- Native support since Android 3.1 in the default player, Google Files and nearly every music app.
Cars, hi-fi and portable players
Most network streamers, AV receivers, and dedicated players (FiiO, Sony Walkman, HiBy) decode FLAC. Car head units vary: USB playback of FLAC is common in newer systems and absent in older ones.
How to Convert a FLAC File
To MP3, AAC or Opus (for phones, cars and sharing)
# MP3, high quality VBR
ffmpeg -i song.flac -codec:a libmp3lame -q:a 0 song.mp3
# AAC, for Apple devices
ffmpeg -i song.flac -codec:a aac -b:a 256k song.m4a
# Opus, best quality per byte
ffmpeg -i song.flac -codec:a libopus -b:a 160k song.opus
Converting to a lossy format discards data; keep the FLAC as the master and treat the MP3 as a copy.
To ALAC (for Apple Music, lossless)
ffmpeg -i song.flac -codec:a alac song.m4a
To WAV (for editing)
flac -d song.flac # writes song.wav
ffmpeg -i song.flac song.wav
From CD, WAV or ALAC to FLAC
flac -8 track.wav # best compression
ffmpeg -i song.m4a -codec:a flac song.flac # ALAC to FLAC, lossless
For ripping CDs, Exact Audio Copy (Windows), XLD (macOS) and dBpoweramp verify each track against the AccurateRip database and write FLAC directly.
Batch conversion
# Every FLAC in a folder to MP3
for f in *.flac; do ffmpeg -i "$f" -codec:a libmp3lame -q:a 0 "${f%.flac}.mp3"; done
fre:ac, dBpoweramp and MediaHuman Audio Converter do the same with a graphical interface.
Encoding Levels
FLAC offers different compression levels (0 to 8):
flac -0 input.wav # fastest encoding, largest file
flac input.wav # default, level 5
flac -8 input.wav # slowest encoding, smallest file
The difference between levels is small, usually 5 to 10 percent in size, and decoding speed is the same regardless. Level 8 is the usual choice for archiving since encoding happens once.
Verifying and Tagging
# Test integrity against the embedded MD5
flac -t album/*.flac
# Read tags
metaflac --list --block-type=VORBIS_COMMENT song.flac
# Write tags
metaflac --set-tag="ARTIST=Example" --set-tag="ALBUM=Example Album" song.flac
# Embed cover art
metaflac --import-picture-from=cover.jpg song.flac
MusicBrainz Picard and Mp3tag tag whole libraries automatically from fingerprints.
Code Example
from mutagen.flac import FLAC
audio = FLAC("song.flac")
print(audio.info.sample_rate, audio.info.bits_per_sample, audio.info.channels)
print(audio.get("TITLE", ["Unknown"])[0], audio.get("ARTIST", ["Unknown"])[0])
print(f"{audio.info.length:.1f} seconds")
import soundfile as sf
data, samplerate = sf.read("input.wav")
sf.write("output.flac", data, samplerate, format="FLAC")
Common Use Cases
- Archiving a music collection: the format to rip CDs into, since every other format can be made from it later
- Studio masters and live recordings: lossless, with metadata and integrity checks
- High-resolution downloads: Bandcamp, Qobuz, HDtracks and most labels sell FLAC
- Streaming: Tidal, Qobuz, Amazon Music and Deezer deliver lossless tiers as FLAC
- Broadcast and radio archives
Advantages and Disadvantages
Advantages
- Lossless quality: bit-identical to the source
- Open and patent-free: no licensing fees, a published RFC
- Wide support: nearly every player, phone and streamer
- Integrity checking: built-in MD5 of the audio
- Rich metadata: comprehensive tagging and embedded art
- Streamable and seekable
Disadvantages
- File size: three to five times larger than a high-bitrate MP3
- Apple Music friction: needs conversion to ALAC for the Music app
- No benefit for lossy sources: converting an MP3 to FLAC makes a bigger file with the same lost data
Related Formats
How to identify .FLAC files from the bytes
FLAC audio bitstream data files carry a fixed byte pattern, the file signature or magic number, that identifies them regardless of the extension. This is what our detector reads.
| Offset | Hex | ASCII |
|---|---|---|
| 0 | 66 4C 61 43 | fLaC |
Check a file yourself: xxd -l 16 file.flac on macOS and Linux, or Format-Hex file.flac | Select-Object -First 1 in PowerShell.Full FLAC signature reference
File Information
FLAC audio bitstream data
Audio
.flac
audio/flac
Related File Types
Other file types in the Audio category you might also need:
Start Analyzing FLAC Files Now
Use our free AI-powered tool to detect and analyze FLAC audio bitstream data files instantly with Google's Magika technology.
⚡Try File Detection Tool