Compression & Formats
Codec vs Container: What's the Difference?
Quick answer
Why this confuses everyone
If you've ever wondered why an MP4 video file "contains AAC audio" — or why M4A is described as an audio format but the codec inside is AAC — or why a WAV file is called uncompressed when it technically uses a codec called PCM — you've bumped into the container/codec distinction.
The confusion is understandable. MP3 is both the name of a codec (MPEG-1 Audio Layer III) and the name of the container format that holds it (.mp3 files). They share a name because MP3 was designed as a self-contained format. Most other formats separate the container from the codec — and that separation is what trips people up.
Container vs codec, side by side
The container
- • The file wrapper / packaging
- • Determines the file extension
- • Stores metadata (title, artist, cover art)
- • Can hold multiple streams (audio + video + subtitles)
- • Doesn't determine sound quality
- • Examples: MP4, MKV, M4A, WAV, OGG, WebM
The codec
- • The compression algorithm
- • Determines audio quality and file size
- • Encodes audio when saving; decodes on playback
- • Can be lossy or lossless
- • Does determine sound quality
- • Examples: AAC, MP3, PCM, FLAC, Opus, Vorbis
The box and the language
An analogy that makes the distinction stick: think of the container as a box or package. The codec is the language the contents are written in.
The same box (MP4 container) can hold documents written in English, French, or German (AAC, MP3, or PCM codec). The box format tells you how things are organised inside; the language determines what the content actually says and how it compresses.
Extending the analogy: if you move the documents to a different box (change the container) but don't translate them (don't re-encode), the content is identical. If you translate them into a new language (transcode to a different codec), the meaning is similar but the phrasing changes — and there may be small losses in translation if the new language is less expressive (lossy codec).
Common containers and the codecs inside them
| Container | Extension | Common audio codecs inside | Notes |
|---|---|---|---|
| MP4 | .mp4 | AAC (most common), MP3, PCM | Video + audio; used by cameras, phones, web |
| M4A | .m4a | AAC (almost always) | Audio-only MP4; Apple's preferred audio format |
| WAV | .wav | PCM (almost always) | Uncompressed audio; Microsoft standard |
| OGG | .ogg | Vorbis, Opus, FLAC | Open-source container; codec varies by use |
| MKV | .mkv | AAC, MP3, FLAC, Opus | Flexible video container; supports many codecs |
| FLAC | .flac | FLAC codec only | Both the codec and the container share a name |
| MP3 | .mp3 | MP3 codec only | Container and codec share a name |
| WebM | .webm | Vorbis, Opus | Web video/audio; open standard from Google |
| MOV | .mov | AAC, PCM, MP3 | Apple's video container; used by iPhones, cameras |
Remuxing vs transcoding — why it matters practically
This is where the distinction has real consequences. When you change the container without changing the codec, it's called remuxing. The audio data stays identical — it's just reorganised into a different wrapper. No quality loss, no re-encoding.
When you change the codec — even if you keep the same container — it's called transcoding. The audio is fully decoded and then re-encoded with a different algorithm. If both codecs are lossy, this causes quality loss. If you transcode from lossy to lossless, you get a lossless wrapper around lossy data (no quality gain). If you transcode from lossless to lossy, you get one-time, controlled quality reduction.
How this affects audio conversion on this site
When you convert an MP4 or MOV file to MP3 here, the audio track is extracted (decoded from whatever codec the video used, often AAC) and then re-encoded as MP3. That's a full transcode — the codec changes — so there is a quality trade-off if the source was lossy.
When you convert WAV to FLAC, you're transcoding from PCM (uncompressed) to FLAC (lossless) — both lossless codecs, so no quality loss. When you convert FLAC to WAV, same story in reverse.
The most important conversion rule: transcode from the highest-quality source available. If you have both an MP3 and a FLAC of the same audio, always convert from the FLAC. The FLAC gives the encoder the full audio data to work with; the MP3 has already been reduced.
Converters
Format guides
Last updated: March 28, 2026