Skip to content
ClipTools
Video glossary

What is Codec?

Definition

A codec (coder-decoder) is software or hardware that compresses video or audio for storage (encoding) and decompresses it for playback (decoding). Common examples are H.264, H.265, VP9, and AV1 for video, and AAC, MP3, and Opus for audio.

Share this tool

The word codec is short for coder-decoder. Encoding compresses raw video or audio so it takes far less space, and decoding reverses the process so a player can show or play it. The codec defines the rules for that compression, which directly affect file size, visual or audio quality, and how much processing power playback needs.

A codec is not the same thing as a container. A container format like MP4, MKV, or WebM is a wrapper that holds one or more codec-encoded streams plus metadata such as subtitles and chapters. The same MP4 file could contain H.264 or H.265 video. The codec decides how the data is compressed; the container decides what is packaged together.

Newer codecs like H.265 (HEVC) and AV1 compress more efficiently than older ones like H.264, delivering similar quality at a lower bitrate, but they need more computing power to encode and decode and can carry patent or licensing differences. Choosing a codec is a trade-off between file size, quality, encoding speed, and how widely devices and browsers can play it.

Quick facts

  • Codec stands for coder-decoder (also described as compressor-decompressor).
  • Encoding compresses the data; decoding decompresses it for playback.
  • Common video codecs include H.264, H.265 (HEVC), VP9, and AV1.
  • Common audio codecs include AAC, MP3, and Opus.
  • A codec is different from a container (MP4, MKV, WebM), which only wraps the streams.

Frequently asked questions

What is the difference between a codec and a container?
A codec compresses and decompresses the actual video or audio data, while a container (like MP4 or MKV) is a wrapper that stores those encoded streams together with metadata such as audio tracks and subtitles. One container can hold streams from different codecs.
Is MP4 a codec?
No. MP4 is a container format, not a codec. An MP4 file usually holds video encoded with a codec such as H.264 or H.265 and audio encoded with AAC.
Which video codec has the best quality and smallest size?
Newer codecs like AV1 and H.265 (HEVC) deliver similar quality at a lower bitrate than older H.264, so they produce smaller files. The trade-off is that they require more processing power to encode and decode and have less universal device support.
Why won't my video play on some devices?
A device or browser can only play a video if it supports that file's codec. If the codec (for example AV1 or H.265) is not supported, playback fails even when the file opens, so you may need to re-encode the video to a more widely supported codec like H.264.

Related tools

Related terms