Convert M4B to FLAC — Free Online Tool

Convert M4B audiobook files to FLAC, decoding the AAC audio stream and re-encoding it as lossless FLAC. This is ideal for archiving audiobooks in a format that preserves every detail of the audio without the lossy compression inherent to AAC.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

M4B files store audio using AAC (Advanced Audio Coding), a lossy codec, inside an MPEG-4 container that also carries chapter markers, bookmarks, and podcast metadata. During this conversion, FFmpeg decodes the AAC audio stream to raw PCM and then re-encodes it using the FLAC codec at compression level 5. Because AAC is lossy, the original audio signal has already undergone some quality reduction — FLAC cannot recover that lost information, but it will capture the decoded audio exactly and compress it without any further quality loss. The M4B chapter data, bookmarking flags, and podcast-specific metadata are not carried over, as the FLAC container does not support these structures. Basic metadata tags such as title, artist, and album can be preserved in FLAC's Vorbis comment metadata block.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg command-line tool, which handles the full pipeline of reading the M4B container, demuxing the AAC audio stream, decoding it to PCM, re-encoding to FLAC, and writing the output file.
-i input.m4b Specifies the input M4B audiobook file. FFmpeg reads the MPEG-4 container, locating the AAC audio stream along with any chapter markers and metadata atoms stored inside.
-c:a flac Instructs FFmpeg to encode the audio stream using the FLAC codec, decoding the source AAC audio to PCM first and then compressing it losslessly into FLAC format.
-compression_level 5 Sets the FLAC compression effort to level 5 on a scale of 0 to 8. This is the FLAC default and balances encoding speed with file size; it has no effect on audio quality since all FLAC compression levels are lossless and produce bit-identical decoded audio.
output.flac Defines the output filename. The .flac extension signals to FFmpeg to write a standard FLAC file containing the losslessly compressed audio decoded from the source M4B's AAC stream.

Common Use Cases

  • Archiving a purchased M4B audiobook in a lossless format so future format conversions start from the highest-quality source rather than re-encoding an already-lossy AAC file
  • Importing an audiobook into audio editing software like Audacity or Adobe Audition that works more reliably with FLAC than with M4B containers
  • Preserving a rare or out-of-print audiobook recording in a lossless open format that does not depend on proprietary Apple or MPEG-4 licensing
  • Preparing M4B podcast recordings for professional post-production workflows that require lossless input files for mastering or noise reduction
  • Playing an audiobook on a hi-fi or audiophile media player or DAC that supports FLAC but not the M4B container format
  • Stripping the DRM-free M4B container to get a FLAC file compatible with library management tools like Beets or MusicBrainz Picard

Frequently Asked Questions

No. M4B audio is encoded with AAC, which is a lossy codec — some audio detail is permanently discarded at the point the M4B was created. Converting to FLAC re-encodes the decoded AAC output losslessly, meaning no additional quality is lost in the conversion itself, but the quality ceiling is still limited by the original AAC encoding. The result is a bit-for-bit accurate capture of what the AAC decoder produces, stored without further compression artifacts.
They are not transferred to the output FLAC file. Chapters and bookmarks are features of the MPEG-4 container format that M4B uses, and the FLAC format has no equivalent internal chapter structure. If preserving chapter information is important, you could consider splitting the M4B into per-chapter FLAC files using FFmpeg's chapter-aware segment options before converting, or keeping the M4B alongside the FLAC archive.
AAC is a lossy codec that achieves very high compression by discarding audio data the encoder deems imperceptible. FLAC is lossless and retains all decoded audio information, compressing it only through mathematical prediction — no data is discarded. A typical M4B audiobook encoded at 64–128 kbps AAC will expand significantly when converted to FLAC, often by a factor of five to ten times, because FLAC must store the full uncompressed PCM data in compressed form.
Adjust the value after the -compression_level flag. Valid values are 0 through 8, where 0 is the fastest encoding with the largest file size and 8 is the slowest encoding with the smallest file size. For example, use -compression_level 8 for maximum compression or -compression_level 0 for fastest processing. Importantly, this only affects file size and encoding speed — all compression levels produce bit-identical audio output because FLAC is always lossless.
The command shown processes a single file, but you can batch process using a shell loop. On Linux or macOS, run: for f in *.m4b; do ffmpeg -i "$f" -c:a flac -compression_level 5 "${f%.m4b}.flac"; done. On Windows Command Prompt, use: for %f in (*.m4b) do ffmpeg -i "%f" -c:a flac -compression_level 5 "%~nf.flac". This is especially useful for converting an entire audiobook library at once.
FLAC stores metadata in Vorbis comment blocks, which support arbitrary key-value text tags. Standard fields like ARTIST, ALBUM, TITLE, and TRACKNUMBER map across well. Album art can also be embedded in a FLAC file as a PICTURE block. However, M4B-specific iTunes atoms such as the narrator tag or the audiobook category flag do not have standardized FLAC equivalents, so those fields may be dropped or require manual remapping using a tag editor like MusicBrainz Picard or beets after conversion.

Technical Notes

The conversion pipeline involves two codec stages: AAC decoding and FLAC encoding. FFmpeg uses its native AAC decoder to produce uncompressed PCM at the source file's original sample rate and bit depth — typically 44.1 kHz or 22.05 kHz for audiobook content, often at 16-bit depth. The FLAC encoder then compresses this PCM losslessly. One technical consideration specific to M4B is that the container may carry a gapless playback delay value (an iTunSMPB tag) inserted by iTunes encoders to handle the AAC encoder's priming samples. FFmpeg handles trimming these samples during decode where possible, but the output FLAC may have a slightly different sample count than the nominal audio duration. FLAC's -compression_level 5 is the widely recommended default, balancing encode speed and file size without any audio quality trade-off since all levels produce identical decoded output. Because M4B does not support multiple audio tracks and FLAC is a single-stream format, no track selection decisions are needed. The special -movflags +faststart flag used when creating M4B files is irrelevant for reading and has no counterpart in FLAC output.

Related Tools