Convert M4B to ALAC — Free Online Tool

Convert M4B audiobooks to ALAC (Apple Lossless Audio Codec) stored in an M4A container, transcoding the compressed AAC audio into a bit-perfect lossless format. This is ideal for preserving your audiobook library at the highest possible fidelity while staying fully within Apple's ecosystem.

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, a lossy codec that achieves compression by permanently discarding audio data deemed perceptually insignificant. When converting to ALAC, FFmpeg decodes the AAC stream back to raw PCM audio and then re-encodes it using Apple Lossless compression. The result is a lossless file — meaning no further audio data is lost beyond what AAC already removed — stored in an M4A container. Chapter markers and metadata tags present in the M4B source are preserved during the process, since both formats share the MPEG-4 container structure. The ALAC encoder applies mathematically lossless compression, so every playback will decode to identical PCM samples.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool. In the browser-based version of this tool, FFmpeg runs locally via WebAssembly (FFmpeg.wasm), so no audio data leaves your device.
-i input.m4b Specifies the input file — your M4B audiobook. FFmpeg reads the MPEG-4 container, identifies the AAC audio stream, and extracts any chapter markers and metadata tags for processing.
-c:a alac Instructs FFmpeg to encode the audio stream using the Apple Lossless Audio Codec (ALAC). The AAC audio from the M4B is fully decoded to PCM and then re-encoded as ALAC, producing a lossless output with no further audio data loss.
-c:a alac A duplicate of the preceding audio codec flag — redundant but harmless, as FFmpeg applies the last matching flag value. The effective result is identical: the output audio codec is ALAC. A single '-c:a alac' is sufficient in a manually written command.
output.m4a Defines the output file. The M4A extension tells FFmpeg to write an MPEG-4 audio container, which is the standard container for ALAC and is natively recognized by iTunes, Apple Music, QuickTime, and most modern media players.

Common Use Cases

  • Archiving purchased audiobooks in a lossless format to future-proof your library against further quality degradation if you need to convert again later
  • Importing M4B audiobooks into iTunes or Apple Music with lossless quality so macOS and iOS devices can stream them at maximum fidelity via the lossless audio pipeline
  • Preserving chapter markers from an M4B audiobook in a lossless M4A file for use with chapter-aware players like Overcast or Apple Podcasts on Apple devices
  • Preparing audiobook files for high-end DAC playback setups where AAC decoding introduces unwanted processing and a lossless source is preferred
  • Stripping the audiobook-specific M4B extension to a standard M4A container for compatibility with media servers like Plex or Jellyfin while retaining all audio detail
  • Creating a master lossless copy of a self-produced or narrated audiobook before distributing compressed versions in other formats

Frequently Asked Questions

No — ALAC is lossless, but that only means no additional quality is lost during this conversion. The original M4B file uses AAC, a lossy codec, so any audio data discarded when the M4B was first created cannot be recovered. What you gain is a stable lossless archive: future conversions from this ALAC file will not introduce any further degradation, unlike re-encoding from a lossy AAC source.
Yes. Both M4B and M4A use the MPEG-4 container format, which supports chapter metadata in the same structural way. FFmpeg copies the chapter atoms from the input to the output by default, so chapter navigation should remain intact in compatible players such as Apple Podcasts, QuickTime, and VLC.
ALAC uses lossless compression, which preserves every audio sample and therefore cannot achieve the same compression ratios as AAC. A typical AAC stream at 128 kbps might expand to several times that size when re-encoded as ALAC, since ALAC must represent the full decoded PCM data in a losslessly compressed form. For audiobooks sampled at standard rates like 44.1 kHz or 22.05 kHz, the size increase can be substantial — expect the ALAC file to be roughly 3–6 times the size of the original M4B.
ALAC has been open-sourced by Apple since 2011 and enjoys broad software support beyond the Apple ecosystem. VLC, foobar2000, MusicBee, Plex, Jellyfin, and most modern media players can decode ALAC. However, many Android devices and non-Apple portable players do not natively support ALAC, so this format is best suited for Apple-centric workflows or desktop playback.
The displayed command processes a single file, but you can batch convert on the command line using a shell loop. On Linux or macOS, run: for f in *.m4b; do ffmpeg -i "$f" -c:a alac "${f%.m4b}.m4a"; done. On Windows Command Prompt, use: for %f in (*.m4b) do ffmpeg -i "%f" -c:a alac "%~nf.m4a". This applies the same ALAC encoding to every M4B in the directory.
In this generated command, '-c:a alac' appears twice, which is redundant but harmless — FFmpeg processes the flags sequentially and the second instance simply overrides the first with the same value. The effective instruction is a single '-c:a alac', which tells FFmpeg to encode the audio stream using the Apple Lossless codec. A cleaned-up equivalent command would be: ffmpeg -i input.m4b -c:a alac output.m4a.

Technical Notes

The conversion from M4B (AAC) to ALAC is a full transcode, not a remux, because the two audio codecs are fundamentally different — AAC is lossy and ALAC is lossless. FFmpeg decodes the AAC bitstream to intermediate PCM and then compresses it with the ALAC encoder. The ALAC encoder does not expose quality parameters because, by definition, lossless compression always produces a bit-identical decoded output regardless of compression effort. The output M4A container retains ID3-style metadata tags (title, author, album, track number) and chapter data from the MPEG-4 atom structure of the source M4B. One known limitation is that some M4B-specific features — such as bookmarking state stored by certain audiobook apps — may not transfer, since those are often application-level data rather than container-level metadata. The -movflags +faststart flag used in some M4B workflows is not applied here, as ALAC M4A files are typically used for local playback rather than progressive streaming. Audio sample rate and channel layout are preserved as-is from the source AAC stream.

Related Tools