A codec compresses audio or video so it can be stored, streamed, or shared, then decodes it again when you play it.
A codec is the technology that turns big raw media into smaller playable files.
MP3, AAC, FLAC, Opus, H.264, H.265, and AV1 are all codec-related names.
A codec is a tool used to compress and decompress audio or video data.
The word codec comes from coder-decoder. The coder part turns raw media into a smaller, more practical stream. The decoder part turns that stream back into sound or pictures when you press play.
Without codecs, music, movies, online video, podcasts, and voice calls would require much more storage and bandwidth.
Raw audio and video are like a pile of clothes spread across the floor. They contain everything, but they take up a lot of space.
A codec packs that information more efficiently. Some codecs pack carefully and keep everything. Others throw away less important details to make the file much smaller.
Digital media can be huge. Uncompressed audio takes far more space than an MP3 or AAC file, and raw video can be enormous compared with a streamed video file.
Codecs make modern media practical by helping with:
The codec analyzes the original audio or video and turns it into a compressed stream.
The compressed data is saved in a file or sent over the internet using less space and bandwidth.
Your phone, browser, app, player, TV, or DAC decodes the stream so you can hear or see it.
For everyday users, the important part is not the math. It is the trade-off: codecs decide how much quality you keep, how small the file becomes, and how widely it will play.
This is where the terminology gets confusing. People often use these words loosely, but they are not always the same thing.
| Term | Plain-English meaning | Example |
|---|---|---|
| Codec | The method used to encode and decode audio or video | AAC, Opus, H.264, AV1 |
| Container | The wrapper file that holds media streams and metadata | MP4, MKV, MOV, WebM |
| Format | A broad word people use for codec, container, or file type depending on context | MP3, WAV, FLAC, MP4 |
For a deeper breakdown, read codec vs format vs standard and what is a container format?
The classic lossy audio format. Still popular because it works almost everywhere.
A more modern lossy audio codec used widely in streaming and Apple devices.
Lossless audio formats that preserve the original audio data while reducing file size.
The safe compatibility choice for video. It plays on a huge range of devices.
More efficient than H.264, but compatibility can be more complicated.
A newer open codec designed for efficient streaming, especially at lower bitrates.
| Goal | Good starting point | Why |
|---|---|---|
| Maximum audio compatibility | MP3 | Works almost everywhere. |
| Modern music streaming | AAC | Efficient and broadly supported. |
| Archiving music | FLAC or ALAC | Keeps the original audio data. |
| General video compatibility | H.264 | The most widely supported video codec. |
| Efficient modern video | H.265 or AV1 | Smaller files at similar quality, depending on device support. |
No. A file extension such as .mp4, .mkv, or .mov often describes the container. The codec is the method used for the audio or video inside.
Yes. For example, two MP4 files may look similar, but one could contain H.264 video while another contains H.265 video.
Your device may support the container but not the codec inside it. This is why codec support matters more than the file extension alone.
For the bigger picture, see Audio quality explained: what actually matters?