# Audio codecs overview

Canonical URL: https://encode.wiki/codecs/audio/
Content version: ca42e61ede0a24f789d7287a0001244ad22f4abf
Status: current
License: CC BY-SA 4.0
Checksum (SHA-256): ac5b6b4c63041cced59b08640034ea5aac9f5c55c1a43b7bf8273fd9a22a93ee

New to audio coding? Start with the [intro](/codecs/audio/intro/). Otherwise, this is the short version of what to pick.

## Which codec should I use?

| You want | Use | Notes |
| --- | --- | --- |
| Lossy audio for most things — music, speech, video soundtracks | [Opus](/codecs/audio/opus/) | Best quality per bit across the whole range, from low-bitrate speech to near-transparent music. Ogg, WebM, Matroska, MP4. |
| Lossy audio that has to play on everything, including hardware players, TVs and old phones | [AAC](/codecs/audio/aac/) in MP4/M4A | The safe choice for MP4 video and streaming. |
| Lossy audio for really old devices | [MP3](/codecs/audio/mp3/) | Needs more bitrate than AAC or Opus for the same quality, but plays on anything. |
| Lossless archive or lossless delivery | [FLAC](/codecs/audio/flac/) | Open, fast, supported nearly everywhere. |
| Lossless in an Apple-only library | [ALAC](/codecs/audio/alac/) | Same idea as FLAC; Apple's ecosystem prefers it. |
| Lossless with a lossy-plus-correction hybrid mode | [WavPack](/codecs/audio/wavpack/) | Niche; the hybrid mode is its selling point. |
| Surround on Blu-ray, TVs and receivers | [Dolby](/codecs/audio/dolby/) (AC-3, E-AC-3, TrueHD) | Keep the original track when remuxing; re-encoding costs quality. |
| Object-based or immersive audio | [Spatial audio](/codecs/audio/spatial-audio/) | Atmos, MPEG-H, IAMF and so on are metadata systems on top of codecs. |

[Vorbis](/codecs/audio/vorbis/) and [Speex](/codecs/audio/speex/) are both superseded by Opus. Keep them only for existing files or devices that require them.

## Comparison

| Codec | Type | Typical channels | Containers | Encoders |
| --- | --- | --- | --- | --- |
| Opus | Lossy | Mono and stereo; multichannel via channel mapping families | Ogg, WebM, Matroska, MP4 | libopus (`opusenc`, FFmpeg `libopus`) |
| AAC | Lossy | Up to 5.1 and 7.1 in common profiles | MP4/M4A, MPEG-TS, ADTS, Matroska | Apple, Fraunhofer FDK, FFmpeg native |
| MP3 | Lossy | Mono and stereo only | Raw MP3, Matroska, MP4 | LAME |
| Vorbis | Lossy | 1–255 | Ogg, WebM, Matroska | libvorbis |
| FLAC | Lossless | 1–8 | Native FLAC, Ogg, Matroska | `flac`, FFmpeg |
| ALAC | Lossless | 1–8 | MP4/M4A, MOV | Apple, FFmpeg |
| WavPack | Lossless or hybrid | Many (hundreds supported) | Native WavPack, Matroska | `wavpack`, FFmpeg |
| Speex | Lossy, speech only | Mono and stereo | Ogg | `speexenc` |

FLAC stores 4–32-bit integer PCM. ALAC stores 16, 20, 24 and 32-bit integer PCM, though FFmpeg's encoder writes only 16 and 24-bit. WavPack also stores 32-bit float and DSD.

## Browser support

MP3, AAC in MP4 and FLAC play in every current browser. Opus and Vorbis in Ogg or WebM play in Chrome, Edge and Firefox, and Safari 18.4 added Ogg Opus and Vorbis on recent Apple operating systems. ALAC is effectively Safari-only, AC-3 and E-AC-3 play only where the operating system supplies a licensed decoder (Apple platforms, some Windows and TV browsers), and Speex and WavPack need an application-supplied decoder. The [image and audio support guide](/reference/image-audio-support/) has the detection code.

## Channels versus spatial audio

More channels is not the same as spatial audio. Immersive systems describe objects, scenes and speaker layouts in metadata that a renderer interprets; the actual samples are carried by an ordinary codec. See [spatial and immersive audio](/codecs/audio/spatial-audio/).
