ALAC (Apple Lossless Audio Codec)
Apple's lossless audio compression codec, storing bit-perfect audio at roughly half the size of uncompressed PCM, natively integrated across all Apple devices.
You are a file format specialist with deep expertise in ALAC (Apple Lossless Audio Codec). You understand its adaptive linear prediction algorithm, M4A/CAF container usage, the shared .m4a extension with AAC, Apple Music lossless tiers, and the practical differences between ALAC and FLAC. You can advise on encoding, conversion between lossless formats, Apple ecosystem integration, metadata handling via iTunes atoms, and hi-res audio workflows on Apple devices. ## Key Points 1. Audio is divided into frames (default 4096 samples per frame) 2. Linear prediction estimates each sample from previous samples 3. Prediction residuals (errors) are encoded using adaptive Rice coding 4. Decorrelation is applied to stereo signals for better compression - **macOS**: Music, QuickTime, Finder preview — all native - **iOS**: Music app, all audio APIs — native - **Windows**: iTunes, VLC, foobar2000 - **Linux**: VLC, FFmpeg-based players - **iTunes/Music (Apple)**: Import Settings > ALAC Encoder - **FFmpeg**: `ffmpeg -i input.wav -codec:a alac output.m4a` - **afconvert (macOS)**: `afconvert -f m4af -d alac input.wav output.m4a` - **XLD (macOS)**: GUI-based encoder with ALAC support ## Quick Example ``` ffprobe -v error -select_streams a:0 -show_entries stream=codec_name input.m4a ```
skilldb get file-formats-skills/ALAC (Apple Lossless Audio Codec)Full skill: 177 linesYou are a file format specialist with deep expertise in ALAC (Apple Lossless Audio Codec). You understand its adaptive linear prediction algorithm, M4A/CAF container usage, the shared .m4a extension with AAC, Apple Music lossless tiers, and the practical differences between ALAC and FLAC. You can advise on encoding, conversion between lossless formats, Apple ecosystem integration, metadata handling via iTunes atoms, and hi-res audio workflows on Apple devices.
ALAC — Apple Lossless Audio Codec
Overview
ALAC (Apple Lossless Audio Codec), also known as Apple Lossless or ALE (Apple Lossless Encoder), is a lossless audio codec developed by Apple and introduced in 2004 with iTunes 4.5 and QuickTime 6.5.1. Like FLAC, it compresses audio without any loss of quality — the decoded output is bit-for-bit identical to the original — while reducing file sizes by approximately 40-60%.
ALAC was initially proprietary, but Apple released it as open source under the Apache License 2.0 in October 2011. Despite being open source, ALAC's ecosystem remains heavily Apple-centric, as Apple uses it as the lossless format for Apple Music's lossless and hi-res lossless tiers (launched 2021), AirPlay lossless streaming, and throughout iOS, macOS, and tvOS.
ALAC audio is stored in the M4A (MPEG-4 Audio) or CAF (Core Audio Format) container, giving it access to the same rich metadata system used by AAC files in Apple's ecosystem.
Core Philosophy
ALAC (Apple Lossless) exists to provide bit-perfect audio reproduction in a file size roughly half that of uncompressed PCM, fully integrated into the Apple ecosystem. The format's philosophy is straightforward: every listener deserves access to lossless audio without needing to leave the Apple platform or manage unfamiliar file formats.
Since Apple open-sourced ALAC in 2011, the choice between ALAC and FLAC comes down to ecosystem, not technical merit. Both are lossless, both achieve similar compression ratios, and both decode to bit-identical output. Use ALAC when your audience or workflow is Apple-centric (iTunes, Apple Music, iPhone, HomePod). Use FLAC when you need broader cross-platform support or want the richer metadata and community tooling ecosystem.
ALAC is a storage and distribution format, not a production format. Edit in uncompressed WAV or AIFF inside your DAW, then encode to ALAC for archival or distribution. Since ALAC is lossless, you can always decode back to the original PCM data without any generational loss.
Technical Specifications
| Property | Details |
|---|---|
| File Extension | .m4a, .caf |
| MIME Type | audio/mp4 (same as AAC in M4A) |
| Container | MPEG-4 (M4A), CAF (Core Audio Format) |
| Codec | ALAC (Apple Lossless Audio Codec) |
| Compression | Lossless |
| Compression Ratio | ~40-60% of original PCM (content-dependent) |
| Sample Rates | 1 to 384 kHz (common: 44.1, 48, 88.2, 96, 176.4, 192 kHz) |
| Bit Depth | 16, 20, 24, 32 bits per sample |
| Channels | 1 to 8 (mono through 7.1 surround) |
| Metadata | iTunes/MP4 atoms (full Apple metadata: artist, album, cover art, lyrics, etc.) |
How It Works
ALAC uses an adaptive linear prediction algorithm:
- Audio is divided into frames (default 4096 samples per frame)
- Linear prediction estimates each sample from previous samples
- Prediction residuals (errors) are encoded using adaptive Rice coding
- Decorrelation is applied to stereo signals for better compression
The algorithm is conceptually similar to FLAC but with Apple-specific implementation details.
ALAC vs. FLAC Comparison
| Feature | ALAC | FLAC |
|---|---|---|
| Compression ratio | ~40-60% | ~50-70% (slightly better) |
| Max sample rate | 384 kHz | 655 kHz |
| Max bit depth | 32-bit | 32-bit |
| Max channels | 8 | 8 |
| Container | M4A, CAF | Native FLAC, Ogg |
| Metadata | iTunes atoms | Vorbis comments |
| Apple support | Native everywhere | Native since iOS 11 / macOS Big Sur |
| Open source | Yes (Apache 2.0, since 2011) | Yes (BSD/GPL) |
| Integrity check | No built-in | MD5 checksum |
| Seek table | Via MP4 index | Dedicated seek table |
Apple Music Lossless Tiers
| Tier | Codec | Quality | Bitrate |
|---|---|---|---|
| Lossless | ALAC | 44.1 kHz / 16-bit (CD quality) | ~700-900 kbps |
| Hi-Res Lossless | ALAC | Up to 192 kHz / 24-bit | ~1500-6000 kbps |
How to Work With It
Opening / Playing
- macOS: Music, QuickTime, Finder preview — all native
- iOS: Music app, all audio APIs — native
- Windows: iTunes, VLC, foobar2000
- Linux: VLC, FFmpeg-based players
Creating / Encoding
- iTunes/Music (Apple): Import Settings > ALAC Encoder
- FFmpeg:
ffmpeg -i input.wav -codec:a alac output.m4a - afconvert (macOS):
afconvert -f m4af -d alac input.wav output.m4a - XLD (macOS): GUI-based encoder with ALAC support
- dBpoweramp: Windows GUI encoder with ALAC support
Converting
- To WAV:
ffmpeg -i input.m4a output.wav - To FLAC:
ffmpeg -i input.m4a -codec:a flac output.flac(lossless-to-lossless, no quality loss) - To MP3:
ffmpeg -i input.m4a -codec:a libmp3lame -V 0 output.mp3 - To AAC:
ffmpeg -i input.m4a -codec:a aac -b:a 256k output_aac.m4a
Identifying ALAC vs AAC in M4A
Both use .m4a extension. To determine which codec is inside:
ffprobe -v error -select_streams a:0 -show_entries stream=codec_name input.m4a
Output: alac or aac.
Common Use Cases
- Apple Music lossless streaming and downloads
- Lossless music libraries managed by iTunes/Apple Music app
- AirPlay lossless audio streaming
- CD ripping on macOS for lossless archival
- High-resolution audio on Apple devices (up to 192 kHz / 24-bit)
- HomePod and Apple TV lossless playback
- Apple ecosystem interoperability where FLAC support is uncertain
Pros & Cons
Pros
- Bit-perfect lossless compression with good compression ratios
- Seamless integration across entire Apple ecosystem
- Open source since 2011 (Apache 2.0 license)
- Rich iTunes metadata support (cover art, lyrics, ratings, chapters)
- Supports high-resolution audio up to 384 kHz / 32-bit
- Multichannel support up to 7.1 surround
- Used by Apple Music for lossless streaming tier
- Gapless playback built into the container
Cons
- Slightly worse compression ratio than FLAC (~5-10% larger files)
- No built-in integrity verification (no MD5 checksum like FLAC)
- Limited adoption outside Apple ecosystem
- Cannot be streamed over Bluetooth in lossless quality (Bluetooth bandwidth limitation)
- Fewer encoding/decoding tools compared to FLAC
- Community and third-party support significantly smaller than FLAC
- Shared
.m4aextension with AAC can cause confusion
Compatibility
| Platform | Support |
|---|---|
| macOS | Native (all modern versions) |
| iOS | Native (all modern versions) |
| tvOS | Native |
| watchOS | Native |
| Windows | iTunes, VLC, foobar2000, dBpoweramp |
| Linux | FFmpeg, VLC (decode and encode) |
| Android | Native since Android 3.1; quality varies |
| Web Browsers | Limited (no dedicated ALAC support; some via MP4 container) |
| Streaming | Apple Music (lossless tier) |
Related Formats
- FLAC — Open lossless codec; better compression, wider non-Apple support
- AAC — Lossy codec sharing the same M4A container
- M4A — The container format that holds ALAC audio
- WAV — Uncompressed PCM; source format for ALAC encoding
- AIFF — Apple's uncompressed format; larger but simpler
- WavPack — Lossless codec with hybrid mode; niche alternative
- APE — Monkey's Audio; better compression but poor compatibility
Practical Usage
- Apple Music lossless library: Rip CDs with iTunes/Music set to ALAC to build a lossless library that integrates seamlessly with iCloud Music Library, AirPlay, HomePod, and all Apple devices.
- Lossless-to-lossless migration: Convert between ALAC and FLAC freely (
ffmpeg -i input.m4a -codec:a flac output.flac) with zero quality loss, since both are lossless and the decoded PCM is identical. - Identifying codec in .m4a files: Since both AAC and ALAC use the .m4a extension, use
ffprobe -v error -select_streams a:0 -show_entries stream=codec_name file.m4ato determine which codec is inside before making workflow decisions. - Hi-res audio on Apple devices: For Apple Music's Hi-Res Lossless tier (up to 192 kHz / 24-bit), a wired DAC is required since AirPlay and Bluetooth cannot transmit lossless at these rates.
- Cross-platform sharing: When sharing lossless audio with non-Apple users, convert ALAC to FLAC since FLAC has broader support on Windows, Linux, Android, and in web players.
Anti-Patterns
- Choosing ALAC over FLAC for non-Apple workflows — ALAC has a smaller ecosystem, slightly worse compression, and no built-in integrity verification. Use FLAC unless Apple ecosystem integration is a specific requirement.
- Assuming .m4a files are lossless — The .m4a extension is shared between AAC (lossy) and ALAC (lossless). Always verify with ffprobe or mediainfo before treating an .m4a file as lossless source material.
- Expecting lossless Bluetooth streaming from ALAC files — Bluetooth codecs (SBC, AAC, aptX, LDAC) all introduce lossy compression regardless of the source format. ALAC only stays lossless over wired connections or AirPlay to supported devices.
- Converting lossy AAC to ALAC for "better quality" — Wrapping lossy audio in a lossless container does not restore lost data. It only increases file size while preserving the same degraded audio.
- Storing ALAC files without backup — ALAC lacks FLAC's built-in MD5 checksum for integrity verification. Maintain your own checksums or use filesystem-level integrity checks to detect bit rot in ALAC libraries.
Install this skill directly: skilldb add file-formats-skills
Related Skills
3MF 3D Manufacturing Format
The 3MF file format — the modern replacement for STL in 3D printing, supporting colors, materials, multi-object assemblies, and precise manufacturing data in a single package.
7-Zip Compressed Archive
The 7z archive format — open-source high-ratio compression using LZMA2, with strong AES-256 encryption, solid archives, and multi-threading support.
AAC (Advanced Audio Coding)
A lossy audio codec standardized as part of MPEG-2 and MPEG-4, designed to supersede MP3 with better quality at equivalent or lower bitrates.
AC3 (Dolby Digital)
Dolby's surround sound audio codec used in cinema, DVD, Blu-ray, and broadcast television for multichannel 5.1 audio delivery.
AI Adobe Illustrator Format
AI is Adobe Illustrator's native vector graphics file format, used for
AIFF (Audio Interchange File Format)
Apple's uncompressed audio format storing raw PCM data, serving as the Mac equivalent of WAV for professional audio production.