Apple Lossless Audio Codec (.alac)

Apple Standard

Apple Lossless Audio Codec (ALAC) is a lossless audio compression format developed by Apple. It reconstructs the encoded PCM samples, and file size savings vary with the audio and encoding settings.

Convert ALAC to FLAC

Free in-browser ALAC to FLAC converter. Convert files instantly on your device.

Inspect & Metadata

Operating systems and file analyzers identify ALAC files by inspecting the leading binary byte sequence:

Select or drop files here

Private - files never leave your device

or paste Ctrl+V
Zero-Network-Transmission Privacy Guarantee: 0 bytes uploaded to external servers. All processing occurred locally in your browser sandbox.

Byte-Level Header Signature (Magic Bytes)

Operating systems and file analyzers identify ALAC files by inspecting the leading binary byte sequence:

HEX SIGNATURE (OFFSET 0):

?? ?? ?? ?? 66 74 79 70

ASCII REPRESENTATION: ????ftyp

Standardization: Apple Open Source / ISO 14496-12

Technical Specifications

Container ArchitectureISO Base Media File Format (MPEG-4 Part 14) container with 'alac' atom
CompressionAdaptive Linear Predictive Coding (LPC) and Rice-Golomb entropy coding
Byte EndiannessBig-Endian container atoms; frame payload bit-packed
Color SpacesN/A (Lossless Audio Stream)
Channels & StructureUp to 8 audio channels (stereo, 5.1 surround, and 7.1 surround)
Max DimensionsSample rates from 44.1 kHz to 192 kHz at 16, 24, or 32-bit resolution
Transparency100% mathematically lossless reconstruction of uncompressed PCM data
Streaming & ProgressiveNative QuickTime 'moov' atom placement at front of file enables instant byte-range streaming

Technical Comparison Matrix: ALAC vs Competitors

Technical AttributeALAC (Current)FLACWAVAPE
Compression Quality100% mathematically lossless100% mathematically losslessUncompressed lossless100% mathematically lossless
Apple Ecosystem SupportNative support on some Apple devices and software; playback depends on device and codec supportRequires third-party player or quicklook pluginNative uncompressedUnsupported without third-party tools
Decoding ComplexityExtremely light; hardware-friendly for battery lifeVery light and fastZero CPU decompression overheadHigh; heavy CPU requirements
Container WrapperMPEG-4 Part 14 container (.m4a)Native Ogg/FLAC bitstream (.flac)RIFF container (.wav)Custom Monkeys Audio container (.ape)

Common Corruption Modes & Hex Recovery Guide

Audio file plays for a few seconds then abruptly terminates or player shows 0:00 duration.

Root Cause: Missing or truncated 'moov' atom due to incomplete download or audio recorder crashing before closing the file.

Recovery: Use untrunc or MP4Box to recover and transplant a valid moov atom from a sister recording made with identical settings.

Security Analysis & Parser Attack Vectors

ALAC decoders parse complex MPEG-4 atom trees and adaptive LPC prediction coefficients which can expose memory corruptions if bounds are unchecked.

Known Attack Vectors

  • Buffer overflow in LPC predictor order parsing when receiving coefficient orders exceeding 32.
  • Out-of-bounds frame write during multichannel downmixing inside legacy QuickTime components (CVE-2011-3258).
  • Atom size integer overflow causing insufficient heap buffer allocation during decoding.

Defensive Best Practices: Enforce strict atom size limits and validate predictor coefficients against maximum allowable bit-depth prior to allocation.

Historical Origins & Milestones

2021Apple Music offers lossless ALAC for its catalog, with supported resolution varying by track and playback setup.
2011Apple releases ALAC reference encoder and decoder as open source under the Apache 2.0 license.
2004Introduced alongside QuickTime 6.5.1 and iTunes 4.5 for lossless ripping and playback.

Key Advantages & Pros

  • Lossless decoding reconstructs the encoded source samples; it cannot restore information absent from the source.
  • Apple platforms support ALAC playback, with availability depending on device, software, app, and playback route.
  • Full support for embedded high-resolution artwork, chapter markers, and rich iTunes-style metadata.

Technical Limitations & Cons

  • Non-Apple hardware support for ALAC is less common than for the widely supported open FLAC format.
  • Typically compresses 2% to 5% larger than FLAC due to conservative Rice-Golomb coder tuning.
  • Shares the identical .m4a file extension with lossy AAC, causing user confusion about file compression type.

Interesting Technical Trivia

  • Apple AirPlay transmits real-time audio over local Wi-Fi streams encoded in 16-bit/44.1 kHz ALAC.
  • Before Apple open-sourced ALAC in 2011, reverse engineer David Hammerton wrote the first open decoder by studying iTunes disassembly.
  • An ALAC stream inside an MP4 file is identified by the four-character code 'alac' inside the 'stsd' sample description atom.

Frequently Asked Technical Questions

How can I tell if my .m4a file is lossy AAC or lossless ALAC?

Because Apple uses .m4a for both, inspect the file in a player or converter. An ALAC file typically has a bitrate between 700 and 1100 kbps, whereas an AAC file ranges from 128 to 320 kbps.

Can I convert FLAC to ALAC without losing any audio quality?

Yes. Both formats are mathematically lossless. Converting from FLAC to ALAC is bit-identical and results in zero generational loss.

Why did Apple create ALAC instead of adopting FLAC?

In 2004, Apple needed an audio codec that integrated directly with their QuickTime and iPod hardware architectures, ensuring seamless DRM and metadata management inside the MP4 container.