Codec

Quick Definition

Software or hardware that encodes audio into a compressed format for storage or transmission and decodes it back for playback. Common audio codecs include AAC, MP3, FLAC, and Opus.

In-Depth Explanation

A codec (coder-decoder) is a technology that compresses audio data into a smaller file for storage or streaming and decompresses it for playback. Codecs use mathematical algorithms to reduce file size, either by discarding data (lossy) or by packing it more efficiently without loss (lossless). Every streaming platform, digital distributor, and media player relies on codecs to handle audio.

How Codecs Work

Audio files in uncompressed form (WAV, AIFF) are large. A 4-minute song at 16-bit/44.1 kHz takes roughly 40 MB. Streaming that file to a mobile phone on a cellular network would consume excessive bandwidth and buffer constantly. Codecs solve this by reducing the file size to something manageable.

There are two categories of audio codec:

Lossy Codecs

Lossy codecs discard audio data that the human ear struggles to perceive, using a technique called perceptual coding. They analyze the audio and remove frequencies masked by louder sounds (auditory masking) and frequencies outside the range of human hearing. Once the data is discarded, it cannot be recovered.

  • AAC (Advanced Audio Coding): The codec used by Apple Music, YouTube, and most video platforms. At 256 kbps, AAC delivers near-transparent quality for most listeners. Apple Music has streamed AAC at 256 kbps since launch and added ALAC for its lossless tier in 2021.
  • MP3 (MPEG-1 Audio Layer III): The oldest widely used lossy codec, introduced in 1993. At 320 kbps, MP3 approaches transparency but is less efficient than AAC or Opus at the same bitrate. Spotify uses Ogg Vorbis (a relative of MP3) at up to 320 kbps for its highest quality tier.
  • Opus: An open-source codec developed by the Xiph.Org Foundation and standardized by the IETF. Opus is used by YouTube for lower-bitrate streams, Discord for voice chat, and many real-time communication platforms. It outperforms AAC and MP3 at bitrates below 128 kbps.
  • Ogg Vorbis: An open-source codec used by Spotify for its streaming tiers. Spotify Premium streams Ogg Vorbis at up to 320 kbps. In 2025, Spotify added FLAC streaming for its lossless tier, giving Premium subscribers bit-for-bit CD quality.

Lossless Codecs

Lossless codecs compress audio without discarding any data. The decompressed file is identical to the original. They act like a ZIP file for audio.

  • FLAC (Free Lossless Audio Codec): The industry standard for lossless audio. Open-source, widely supported, and used by Spotify's lossless tier, Tidal, Amazon Music HD, and Qobuz. FLAC reduces file size by approximately 50% compared to WAV.
  • ALAC (Apple Lossless Audio Codec): Apple's proprietary lossless codec. Used by Apple Music for its lossless and hi-res tiers, supporting resolutions up to 24-bit/192 kHz.

Real-World Example

You master a single at 24-bit/44.1 kHz and upload the WAV file to your distributor. The file is 45 MB. Here is what happens to that file on each platform:

  • Apple Music: Encodes the WAV to AAC at 256 kbps for standard streaming. The file shrinks to approximately 7.5 MB. For Apple Music Lossless subscribers, the platform also stores and streams an ALAC file at roughly 22 MB.
  • Spotify: Encodes the WAV to Ogg Vorbis at 320 kbps for Premium subscribers. The file shrinks to approximately 9.4 MB. For Spotify's lossless tier (launched in 2025), the platform streams FLAC at roughly 22 MB.
  • YouTube Music: Encodes to Opus at 256 kbps. The file shrinks to approximately 7.5 MB. YouTube Music does not offer a lossless tier as of 2026.

The listener on a standard tier hears the lossy version. The listener on a lossless tier hears the FLAC or ALAC version. In both cases, the platform handles the encoding from your uploaded WAV. This is why you must upload the highest quality source file possible.

Why It Matters for Independent Artists

  1. Always upload WAV files to your distributor. Let the platform handle codec conversion. If you upload an MP3, the platform encodes it again, causing generation loss (double compression). Upload 24-bit WAV at 44.1 kHz or 48 kHz minimum.
  2. Understand what each platform uses. Apple Music uses AAC at 256 kbps. Spotify uses Ogg Vorbis at up to 320 kbps and now FLAC for lossless. YouTube Music uses Opus at 256 kbps. Knowing this helps you preview your masters in the right codec before release.
  3. Preview your master through codecs before uploading. iZotope Ozone 11 includes a Codec Preview module that simulates AAC, MP3, and Opus encoding. Hear how your mix sounds after compression and adjust your EQ and mastering chain accordingly. High-frequency content above 15 kHz is the first thing lossy codecs discard.
  4. Do not distribute MP3s to fans. If you send promo copies or free downloads, send FLAC or WAV files. MP3s circulated online get re-encoded repeatedly, degrading quality with each conversion.

Read our guide on mastering for streaming platforms to understand how each platform's codec affects your masters, and our comparison of music distribution services to see which distributors handle format delivery correctly.

Related Terms

  • Lossless - Compression that preserves all audio data (FLAC, ALAC)
  • Bit Depth - Determines the dynamic range of the source file before codec encoding
  • Sample Rate - Determines the frequency range of the source file before codec encoding
  • Bitrate - The data rate at which a codec operates, directly affecting quality
  • Mastering - The final production stage where codec compatibility is checked

Related Terms

View All

From the Blog

View All

Calculators

View All

Directories

View All

Production Tools

View All