.fw files.wiki
FLAC

FLAC Files

Free Lossless Audio Codec

FLAC is an open, lossless compressed audio format that preserves PCM audio while reducing file size.

Free Lossless Audio Codec audio file

Developer
Xiph.Org Foundation / Josh Coalson
Category
Audio
MIME type
audio/flac
Format
Binary
Magic bytes
66 4C 61 43
First released
2001
Latest version
1.5.0 reference codec; format version 1.0
Open standard
Yes

Open a .FLAC file online

Reading file…

What is a .FLAC file?

The .flac file usually includes free lossless audio codec (abbreviated as “FLAC”), which is a compressed PCM audio format initially introduced and later maintained by the Xiph.org Foundation with Joshua (Josh) Coalson being its creator. Natively FLAC encoded files include ASCII marker fLaC with offset 0 (equivalent of hex 66 4C 61 43) and no major unrelated production format uses the same extension. FLAC stores exactly the original PCM samples; therefore decoding returns the originally-encoded audio samples without psychoacoustic losses, unlike to MP3, AAC, Vorbis or even Opus. It allows the compression of audio samples for monos, stereos and multiple channels including music tracks for 44.1 and 48 kHz and even 24bit/96khz/24 bit/192 kHz according to format specification. Usual size of native FLAC-encoded files is more than size of files in MP3/AAC format and less than size of WAV/AIFF but the music is usually compressed in about 40% to 70% compared to original uncompressed PCM files. Users of audio format usually meet FLAC format in CD rips, Bandcamp downloads, high resolution music sites, archives for audio samples, their own music databases.

How to open a .FLAC file

Open a .FLAC file on Windows

  1. 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
  2. 2 Double-click your .FLAC file if you have an app for .flac files on your computer. In case it does not open, move on to step three.
  3. 3 Right-click your .FLAC file -> select Open with -> Choose another app.
  4. 4 Choose VLC media player in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .flac files" and click OK.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Windows

Open a .FLAC file on macOS

  1. 1 In the Finder app, locate your .FLAC file.
  2. 2 Just double-click your .FLAC file in order to automatically launch the program which is connected with it.
  3. 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select Open With -> VLC media player.
  4. 4 If it isn't in the list, choose Other… and find the application manually.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for macOS

Open a .FLAC file on Linux

  1. 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
  2. 2 Double-click the file.
  3. 3 Or choose another program by right-clicking the file -> Open With -> VLC media player.
  4. 4 Install VLC media player (if it is not installed on your computer) from the software centre, repository or Flathub.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Linux

Open a .FLAC file on Android

  1. 1 Launch Files or another file management app.
  2. 2 In Downloads, find the .FLAC file and open it by tapping.
  3. 3 A list of apps capable of opening the file will be shown. Tap VLC media player and press Always to permanently connect the file type with this app.
  4. 4 No apps able to open this file? Download VLC media player from the Google Play Store.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Android

Open a .FLAC file on iPhone / iPad

  1. 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
  2. 2 Tap the .FLAC file you want to open.
  3. 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
  4. 4 Touch and hold the file to get the context menu -> choose Share -> select VLC media player from the list of apps.
  5. 5 If there is no such option, download the app first from the App Store and then tap the document again.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for iPhone / iPad

Open a .FLAC file online

  1. 1 Move to the online viewer at the top of this page.
  2. 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Online

More details about opening .FLAC files

On Windows, FLAC is directly supported in recent Microsoft Media Player as well as compatible with players such as VLC, foobar2000, MusicBee, AIMP, Winamp, JRiver Media Center and also in editors like Audacity.

The playback in the FLAC format can occur in VLC, foobar2000 on Mac OS, Elmedia Player, JRiver Media Center on Mac OS or using audacity for Mac OS. The command line options that can be considered are ffplay(FFmpeg)and also the flac utilities from the terminal. If converting the file into an older format in the context of working on Apple Music Library and iTunes, you might prefer doing conversion into an ALAC first because these applications work mainly with this lossless encoding format.

For the Linux-based distributions, there are usually GStreamer-supported players VLC, Rhythmbox, audacious clementine, DeaDBeeF, Strawberry and command line audio player for FLAC support and also some other players. The FLAC can be played easily on different Android operating systems because of system's built-in codecs and also the typical apps which are VLC,Poweramp,AIMP,foobur2000 ,Neutron Music Player etc., Also in case of iPhone and iPad, the native application Files allows to playback this files by some particular versions while quick look in iPhone also works for playing. There are also several different players such as VLC, foobur2000 and Neutron.

FLAC can be played in a browser, like in Chrome, Firefox, Edge, and Safari versions if you are having HTML5 and audio player. If playback on double clicking fails, you can install a FLAC-capable player or configure the Open With feature. Also, ffprobe input.flac will show whether VLC player accepts FLAC format properly and not having an error about the association of extension or the installation of the codecs. Use Audacity, Ocenaudio and reaper as editor software.

Technical details

It is a binary bitstream, not a text format. The start of a native FLAC file is always marked by the 32-bit identifier fLaC (bytes hex:66 4C 61 43) starting in the first byte of the datastream. Right after comes various blocks carrying information like metadata, with the STREAMINFO block holding essential stream data (minimum and maximum block size and frame size, sample rate, channel, number of bits of the sample, etc.). Several typical blocks are described in the format document: STREAMINFO, PADDING, APPLICATION, SEEKTABLE, VORBIS_COMMENT, CUESHEET, and PICTURE blocks; the specification also mentions various reserved and illegal codes for the block code type values. Thus, the FLAC native format represents an audio stream with some attached info (and no video or program info); there could be present the FLAC audio frames, tags, cue sheets (the index list), and even optional pictures in addition.

The data stream is represented by several frames that hold audio samples for the channels. FLAC compressing includes blocking of the data and a process of a linear-predictive compression via fixed and LPC predictors, coding the difference between the predicted samples and real (residuals) values via rice codes (also with the interchannel decorrelation of residual value samples for stereophonic audio). In the actual specification the maximum frequency, number of channels and bits per sample are equal to 655350 Hz, 8, and 32 respectively; many decoders allow usage some specific cases (like 24, 16 bit/stereophony/48 or 44.1kHz), although. The corresponding MIME type registration is audio/flac; some old applications can support only audio/x-flac. FLAC stream data can be also used as an Ogg stream and called accordingly the Ogg FLAC (usually has a .oga extension rather than .flac). The reference encoder supports from level 0 up to level 8; at bigger number of the compression level it takes more processor power to create files that are little shorter than in lower levels without any change in the decoded file. Command flac --verify creates and decodes the FLAC stream to check integrity against the embedded MD5.

How to convert .FLAC files

Use ffmpeg to convert FLAC to WAV: ffmpeg -i input.flac output.wav. Use the FLAC software decoder flac to convert with a command like flac -d input.flac. The raw audio is unchanged in content. Tags may translate imperfectly. It's a lossless process, but it takes up much more space.

Use ffmpeg -i input.flac -codec:a libmp3lame -q:a 2 output.mp3 if MP3 is needed by your car audio system, mobile phone (perhaps), or you have very small storage space. The format is broadly compatible, but the lossy compression process destroys audio data that cannot later be recovered.

Use ffmpeg -i input.flac -codec:a aac -b:a 256k output.m4a to convert FLAC to M4As in the AAC encoding format to create lossy audio suited for an all-Apple environment. Alternatively, use ALAC for a lossless conversion: Use ffmpeg -i input.flac -codec:a alac output.m4a

FLAC to Opus, ffmpeg -i input.flac -codec:a libopus -b:a 128k output.opus gives efficient delivery in the Opus codec but remember some players will only read older and more compatible file formats first (e.g.,MP3 or AAC).

dBpoweramp, foobar2000 Converter, MusicBee or fre:ac for Windows, XLD Macintosh batch converter generally handle metadata tags better. Lossless formats do not discard any raw information. It's only metadata fields and associated artwork etc. that can change in the processing step. However, converting a Lossless format to a Lossy format cannot be undone; so store the original.

Convert toToolCommand / note
WAV / .wav ffmpeg ffmpeg -i input.flac output.wav Decodes to uncompressed PCM; no audio quality is lost, but tags may not map perfectly and file size usually increases.
MP3 / .mp3 ffmpeg with libmp3lame ffmpeg -i input.flac -codec:a libmp3lame -q:a 2 output.mp3 Creates a broadly compatible lossy file; audio data discarded by MP3 encoding cannot be recovered.
AAC in M4A / .m4a ffmpeg ffmpeg -i input.flac -codec:a aac -b:a 256k output.m4a Useful for phones, cars, and Apple ecosystems; conversion is lossy unless using ALAC instead.
Ogg Vorbis / .ogg ffmpeg ffmpeg -i input.flac -codec:a libvorbis -q:a 6 output.ogg Open lossy format with good quality at moderate bitrates; not as universally supported as MP3/AAC.
Apple Lossless / .m4a ffmpeg ffmpeg -i input.flac -codec:a alac output.m4a Lossless conversion for Apple software and devices; metadata compatibility should be checked after conversion.
Opus / .opus ffmpeg ffmpeg -i input.flac -codec:a libopus -b:a 128k output.opus Efficient lossy target for speech or music streaming; compatibility is lower than MP3/AAC in older players.
FLAC with different compression level / .flac flac flac -8 --verify input.wav -o output.flac Re-encodes from PCM to maximum standard FLAC compression; compression level affects speed and size, not decoded audio quality.

Common problems and fixes

"Invalid data found when processing input" in FFmpeg means either corruption of the file, renaming from the other format or truncated data while downloading or copying. Check the bytes in hex editor/xxd; in the native FLAC they start with 66 4C 61 43 offset by 0. If these bytes aren't there, re-download file and make sure it corresponds with checksums with the source copy.

The flac -t tool in command line of the software will show you error messages such as "ERROR: while decoding data" or "MD5 signature mismatch". Such information means that PCM samples have become different as compared to values stored in STREAMINFO; which suggests that encoded audio has somehow got modified or there was an error while ripping original file. Go ahead and use recovery method with the help of file backup or re-rip your disc.

The player which says "unsupported codec", either checks the .flac extension through some optional system decoder; or is refusing to support sample rates, bit depth or channel numbers which don't conform to industry standards. Encode into a standard 16-bit/24-bit flac on 44.1 kHz / 48 kHz or to WAV with the help of ffmpeg -i input.flac output.wav command.

Incorrect artist, album or picture means malformed Vorbis comment fields or possibly corruption of PICTURE meta. Fix them by retagging file with MusicBrainz Picard, Mp3tag, Kid3 or foobar2000.

Gapless function won't work when player skips cue sheets or doesn't properly buffer data; impossible duration/bitrate or zero duration suggests an unfinished file taken from some network location/cloud synk folder.

Security considerations

Standard Native FLAC does not use macros, active scripts, autorun features, or executable components of document type; hence, the potential for danger presented by default .flac file is considerably smaller compared to typical office document or archive. The only significant threat comes from parsing flaws within media players, tag library and operating-system codecs which decode malformed audio chunks, metadata, and/or cover art. Update VLC, your web browser, mobile multimedia programs, FFmpeg or OS audio code libraries before playing media content downloaded from untrusted sources, especially short, large or strange-looking .flac samples. Additionally, the FLAC file format might contain personal information that include artists name, comments, encoder string, purchasing data, MusicBrainz track ID, replay gains statistics, cue sheet and embedded graphics. Before distribution of any .flac files, analyze them using --list command of metaflac, ffprobe, Mp3tag, kid3, or MusicBrainz Picard to see what information is in them, erase what information you don't want to share. Magic number bytes check should be performed with file, ffprobe or mediainfo and unknown .flac files scanned by your antiviruses, because .flac might actually be some other file type.

History and versions

FLAC was created by Josh Coalson; development started approximately in 2000, while the first 1.0 stable release took place in 2001. As its name suggests, this audio format was designed to become a free and open source alternative to various commercial and patented audio codecs and it could boast a set of streaming and seeking features from the outset. During the early 2000’s, FLAC became a part of Xiph.Org Foundation framework along with Ogg, Vorbis, Theora, and eventually - Opus. Reference implementation went through numerous revisions such as the 1.1.x and 1.2.x ones which included better compression efficiency, advanced tagging, additional support in many players and CDs ripper applications. Finally, release FLAC 1.3.0 was published in 2013 after a long gap, followed by 1.3.x and 1.4.x releases focused primarily on efficiency, security and high resolution processing of the files in the reference encoder. Nevertheless, FLAC stays just the open and free format without being a formalized ISO/IEC audio codec and canonical specifications of the format are hosted by Xiph.Org on its website https://xiph.org/flac/format.html.

The WAV (.wav) file stores PCM data, which can be used in almost every production tool, but FLAC compresses the very same PCM data and uses up smaller disk space. AIFF (.aiff, .aif) is another uncompressed, rarely compressed by default format, popularized by Apple, which continues to provide decent compatibility among legacy studios' workflow - still, FLAC should be preferentially used in storage and file downloads, while AIFF still fits older studio workflows. Another compressed format from Apple - Apple Lossless, or ALAC inside MP4 - works well on Mac OS-based products, although FLAC is favored among the free and open-sourced software as well as audiophile devices, download providers, etc. The last one, but surely not the least - Monkey's Audio (.ape) sometimes produces smaller audio sizes, although is quite closed and less supported than FLAC and, especially slow at decompression process.

Comments (0)

Replying to

No comments yet. Be the first to share your experience with this file type.