Audio GlossaryEvery digital audio file you play goes through a codec. It decides how small the file is, how good it sounds, and whether your phone, car or editor can open it at all. This guide explains what an audio codec is, the difference between lossy and lossless codecs, the codecs you will actually meet (MP3, AAC, Opus, Vorbis, FLAC, ALAC and a few speech codecs), which one to pick for each job, and how Bluetooth codecs fit in.
The quick answer
An audio codec is the method used to shrink digital audio for storage or streaming and to turn it back into sound for playback. The name comes from coder-decoder. Lossy codecs like MP3, AAC and Opus make small files by dropping detail you are unlikely to hear. Lossless codecs like FLAC and ALAC make smaller files with every sample kept. The term can also mean the chip that turns sound into digital data and back.
- Two meanings — software that compresses audio (MP3, AAC, FLAC), or a hardware chip that converts between analog sound and digital data.
- Lossy vs lossless — lossy codecs can shrink audio by 80–95%; lossless codecs usually save 40–50% and keep every bit.
- No single best codec — AAC or MP3 for music you share, Opus for voice and calls, FLAC for archives and editing.
- Codec ≠ file type — an .m4a can hold lossy AAC or lossless ALAC; the extension names the container, not the codec.
What an Audio Codec Does
The word codec is short for coder-decoder. The coder (or encoder) takes raw digital audio and packs it into fewer bits. The decoder unpacks those bits back into audio your speakers can play.
Raw digital audio is called PCM: a long list of numbers that measure the sound wave many thousands of times a second. CD-quality stereo PCM uses 44,100 samples per second, 16 bits per sample, on two channels. That works out to about 1,411 kbps, or roughly 10.6 MB per minute. That is fine on a hard drive, but large for a phone library and far too large for most streaming or calls.
A codec solves that. MP3 at 128 kbps uses about one eleventh of the data of CD-quality PCM. AAC at 256 kbps, the bitrate the iTunes Store sells music at, uses less than a fifth. FLAC keeps every sample and still usually saves a good share of the space.
The codec is chosen when the file is made. When you press play, your device needs a matching decoder. If it has none, you get an error such as "audio codec not supported", even when the file itself is fine.
The Other Meaning: Audio Codec Chips
In hardware, an audio codec is a chip rather than a program. It contains an analog-to-digital converter, which turns the signal from a microphone into numbers, and a digital-to-analog converter, which turns numbers back into a signal for headphones or speakers. Both run from the same clock.
These chips sit in sound cards, laptops, phones and audio interfaces. They pass data to the rest of the device over standard links such as AC'97, I²S or SoundWire, and most of them work with plain PCM. If you saw "audio codec" in a laptop spec sheet or a driver list, this is the meaning. The rest of this guide is about the software kind, which decides what your files are.
Lossy, Lossless and Uncompressed
Codecs fall into two groups, plus one format that is not compressed at all.
Lossy codecs (MP3, AAC, Opus, Vorbis) use a model of human hearing. Loud sounds hide quieter sounds close to them in pitch and time, and very high frequencies are hard to hear. The encoder spends few or no bits on what you are unlikely to notice. Most modern lossy codecs are built on a transform called the MDCT. MDN's codec guide puts lossy compression at up to 80–95% smaller than the source. What the encoder removes is gone for good.
Lossless codecs (FLAC, ALAC, WavPack) predict each sample from the ones before it and store only the small error. On playback the decoder rebuilds the original exactly. MDN notes you are unlikely to get more than 40–50% compression this way. How much you save depends on the music: quiet, simple recordings shrink most.
Uncompressed PCM, the audio inside most WAV and AIFF files, is not really a codec in the compression sense. It is the raw data that codecs start from and decode back to. It needs no decoding, which is why editors and samplers like it.
The Audio Codecs You Will Meet
MP3 (MPEG-1 Audio Layer III). Finalized in 1992, still the most widely supported lossy codec. Bitrates run from 32 to 320 kbps for normal stereo files. Its patents have expired: in the EU in 2012 and in the US in April 2017, so it is free to use.
AAC (Advanced Audio Coding). Standardized by MPEG in 1997 and designed as MP3's successor; it generally sounds better than MP3 at the same bitrate. It is the standard format of the iTunes Store and is supported on iPhone, Android and YouTube. AAC usually lives in .m4a or .mp4 files, or as a raw .aac stream.
Opus. An open IETF standard (RFC 6716, 2012) that covers everything from low-bitrate speech to high-quality music, at 6 to 510 kbps. It has very low delay, 5 to 66.5 ms by MDN's figures, which is why it is the main codec for web calls (WebRTC). Files use .opus, .ogg or .webm.
Vorbis. An older open lossy codec from Xiph.org, common in games and Linux software. It usually sits in .ogg files. It is supported in Chrome and Firefox but not in Safari.
FLAC (Free Lossless Audio Codec). The open lossless standard, published as RFC 9639 in December 2024. It handles up to 8 channels and bit depths up to 24 bits in common use, and every file carries a checksum so software can confirm the audio is intact.
ALAC (Apple Lossless). Apple's lossless codec, open source under the Apache license since 2011. It plays natively in Apple's Music app and usually sits in an .m4a file, the same file type as AAC.
Speech codecs. G.711 (64 kbps, used in phone systems and required in WebRTC), G.722 (wideband voice) and AMR (narrowband mobile voice, about 7.4 kbps typical) are tuned for voices. They squeeze speech very small but sound poor on music.
Older or special-purpose codecs you may still find include WMA (Microsoft), AC-3 and DTS (surround sound in film and TV) and Monkey's Audio (lossless).
Codec vs Container: Why the File Extension Misleads
A codec is the method that compresses the audio. A container is the file format that holds the compressed audio plus tags, cover art and timing information. People mix them up because a few formats use the same name for both.
Some examples: an .m4a file is an MP4 container that may hold AAC (lossy) or ALAC (lossless). An .ogg file may hold Vorbis, Opus or FLAC. A .wav file almost always holds PCM but can hold other codecs. An .mp4 video usually holds AAC audio next to H.264 or HEVC video. MP3 is the one common case where the codec stream is, in effect, the file.
This matters when something will not play. A device that supports a container still needs the codec inside it. Android, for example, plays Vorbis in .ogg on every version but only plays Opus from Android 5.0. Our
container vs codec guide covers containers in depth.
What Is the Best Audio Codec?
There is no single best codec. There is a best codec for each job.
Music you share or play on many devices: MP3 at 192 kbps or more, or AAC at 256 kbps. MDN's guide calls AAC in MP4 the likely best single choice for web music because every major browser supports it. MP3 is still the safest file to hand to an unknown car stereo or old player.
Apple devices: AAC at 256 kbps for small files, ALAC when you want lossless inside Apple's Music app.
Voice calls, live chat and low delay: Opus. It is built for it and is the standard in WebRTC.
Podcasts and spoken word: MP3 or AAC at modest bitrates are the norm for compatibility with podcast apps; Opus holds up well at low bitrates where players support it.
Archiving music or CDs: FLAC. Exact copy, open standard, smaller than WAV, with a built-in integrity check.
Recording, editing and mixing: uncompressed PCM in WAV or AIFF, or FLAC for storage. MDN advises avoiding lossy codecs for any audio that will be remixed or compressed again.
One rule beats all the others: encode to a lossy codec once, at the end, from a lossless source.
Is AAC Better Than MP3?
Usually, yes, at the same bitrate. AAC was designed as MP3's successor and generally sounds better at an equal bitrate, with the clearest gains at lower bitrates such as 128 kbps and below. MDN suggests a minimum of 96 kbps for stereo AAC and 128 kbps for stereo MP3.
At high bitrates the gap closes. At 256 kbps AAC or 320 kbps MP3, most listeners on most equipment cannot reliably tell either from the original in a blind test. MP3 still has the widest support, especially in older hardware. So choose AAC for Apple devices and modern players, and MP3 when compatibility matters most. Our
MP3 vs AAC comparison goes into more detail.
Bluetooth Audio Codecs
Wireless headphones add a second codec. Even if your file is FLAC, your phone decodes it and then encodes it again with a Bluetooth codec before sending it to the headphones. Both devices must support the same codec, or they fall back to the basic one.
SBC is the default codec that every A2DP Bluetooth audio device must support. Its high-quality setting runs at about 328 kbps at 44.1 kHz and 345 kbps at 48 kHz.
AAC is used by Apple. Apple's support page says AirPods and Beats use the Apple AAC Bluetooth Codec, and that Bluetooth connections are not lossless.
aptX is a Qualcomm family found on many Android phones: aptX runs at 352–384 kbps, aptX HD at 576 kbps with up to 24-bit audio, and aptX Adaptive scales between 279 and 420 kbps. Qualcomm also markets an aptX Lossless mode for CD-quality audio in good radio conditions.
LDAC is Sony's codec, part of Android since Android 8.0. It switches between 330, 660 and 990 kbps depending on signal strength and is lossy.
LC3 is the newer codec of Bluetooth LE Audio, announced as SBC's successor in 2020.
The practical takeaway: over Bluetooth, a well-made 256 kbps AAC or 320 kbps MP3 usually sounds the same as a lossless file, because the link compresses both. See
does lossless audio work with Bluetooth for more.
"Audio Codec Not Supported": How to Fix It
This error means the player cannot decode the codec inside the file. The file is usually not damaged.
1. Find out which codec the file uses. In VLC, open the file and choose Tools > Codec Information. MediaInfo shows the same on Windows, macOS and Linux, and ffprobe does it on the command line.
2. Check what your player or device supports. Look for a list of codecs, not just file types. "Plays OGG" may mean Vorbis only, not Opus.
3. Convert to a codec it does support. MP3 is the safest choice for almost any device; AAC suits Apple gear.
Common cases: an .ogg holding Opus on an older player (
OGG to MP3 or
Opus to MP3); an .m4a holding ALAC on a device that only knows AAC (
M4A to MP3); a video whose sound will not play in an audio app (
MP4 to MP3,
MKV to MP3 or
WebM to MP3). Renaming the file never works: the extension changes, but the codec inside stays the same.
Converting Between Codecs Without Losing More Quality
Every conversion either keeps the audio exactly or loses a little more.
Lossless to lossless (WAV, AIFF, FLAC, ALAC) is exact, as long as the bit depth and sample rate stay the same. You can go back and forth as often as you like.
Lossless to lossy (for example FLAC to MP3) loses detail once. Pick a sensible bitrate: 256 kbps AAC or 320 kbps MP3 is a safe high-quality choice.
Lossy to lossy (for example AAC to MP3) loses detail again, because the second encoder throws away its own share on top of the first. If you can, go back to the lossless original instead. If you cannot, use a high bitrate for the new file.
Lossy to lossless (for example MP3 to WAV) does not bring anything back. It is useful only when an editor or app needs a WAV; the WAV sounds exactly like the MP3, in a bigger file.
Our converters run in your browser with FFmpeg, so files are never uploaded. MP3 output offers 128, 192, 256 or 320 kbps (320 by default), and WAV output keeps 24-bit audio from 24-bit lossless sources. Start with
WAV to MP3,
FLAC to MP3 or
FLAC to Apple Lossless.