Skip to main content
Video & Streaming

What is Codec?

A codec (short for coder-decoder) is a software algorithm that compresses video data for storage and transmission, and decompresses it for playback. Different codecs use different mathematical techniques to reduce file size while preserving visual quality, with newer codecs generally achieving better compression efficiency than older ones.

Last updated: March 6, 2026

Codec Explained

Codec is a portmanteau of "coder-decoder" and describes the algorithm responsible for one of the most important transformations in digital media: reducing raw video data to a manageable size without making it look terrible. Uncompressed 1080p video generates roughly 1.5 gigabytes per minute. A modern codec like H.264 compresses that same footage to 30–100 megabytes per minute — a reduction of 15–50x — with imperceptible quality loss to most viewers. Without codecs, online video streaming and affordable video storage would be impossible.

How Video Compression Works

All modern video codecs exploit two types of redundancy in video data. Spatial redundancy refers to the fact that adjacent pixels in a single frame are often very similar — the sky in a landscape shot is almost the same blue across thousands of pixels. Codecs use techniques like DCT (Discrete Cosine Transform) to encode these regions compactly. Temporal redundancy refers to the fact that consecutive frames in a video are usually very similar — only moving objects change between frames while backgrounds stay static. Codecs encode keyframes (full frames stored completely) periodically and then store only the differences between subsequent frames. The result is dramatic compression with minimal perceptible quality loss.

The Major Codec Families

H.264 (AVC) has been the dominant web video codec since the mid-2000s. It strikes an excellent balance between compression efficiency, hardware support, and licensing clarity, and is natively supported by virtually every device and browser. H.265 (HEVC) offers roughly 40–50% better compression than H.264 at the same quality — meaning smaller files or better quality at the same bitrate — but requires licensing fees that made adoption slower. AV1, developed by the Alliance for Open Media (including Google, Mozilla, and Netflix), is a royalty-free codec with compression efficiency comparable to or better than H.265. YouTube, Netflix, and major browsers now support AV1, and it is increasingly used for high-quality streaming. VP9 (Google's royalty-free predecessor to AV1) is still widely used on YouTube. When you download video using Video Downloader Pro, the downloaded file will be encoded in whichever codec the platform used — typically H.264 for broad compatibility or VP9/AV1 for higher-efficiency streams.

Codecs vs. Container Formats

A common source of confusion is conflating codecs with file extensions. An .mp4 file is a container format that can hold video encoded with H.264, H.265, AV1, or other codecs. The container defines the file structure; the codec defines how the video stream inside is compressed. You can have an MP4 with H.264 video, or an MP4 with H.265 video — both are MP4 files but require different decoding capabilities. This is why "I have an MP4 file that won't play" often means the device lacks support for the specific codec used inside that container, not the container format itself.

  • H.264: Universal compatibility, excellent quality, most widely used
  • H.265 (HEVC): 40% better compression than H.264, patent-encumbered, broad hardware support
  • AV1: Royalty-free, best-in-class compression, growing platform adoption
  • VP9: Google's royalty-free codec, used heavily on YouTube, good compression

Real-World Examples

1

YouTube serves AV1-encoded video to browsers that support it, reducing bandwidth usage by up to 30% compared to VP9 while maintaining the same perceived quality.

2

An iPhone records video in H.265 (HEVC) by default for efficient storage, but automatically converts to H.264 when sharing to improve compatibility with older devices.

3

Video Downloader Pro downloads a Twitter video and saves it as an H.264 MP4 — the most compatible format for playing on any device without additional software.

4

A video editor notices that 4K footage shot in H.265 is harder to edit in real time than H.264, because H.265 requires more CPU/GPU processing power to decode.

Want a Deeper Explanation?

Ask AI to explain Codec in your own context or for your specific use case.

AI responses are generated independently and may vary

Frequently Asked Questions

Try Video Downloader Pro Free

Now that you understand codec, put this knowledge to work with our Chrome extensions.