Understanding Video Codecs: H.264 vs H.265 vs VP9 vs AV1
A clear, practical comparison of the four major video codecs — H.264, H.265 (HEVC), VP9, and AV1. Covers compression efficiency, browser and device support, licensing, and when to use each codec for streaming, sharing, archiving, and web delivery.
Published April 8, 2026 · Updated April 8, 2026
Video files are among the largest files most people handle regularly. A single minute of 4K video can occupy hundreds of megabytes or several gigabytes depending on how it was encoded. The codec — the compression algorithm used to shrink that raw video data into a manageable file — is the single most important factor determining how large your video files are, how they look, and where they can be played.
Four codecs dominate the landscape in 2026: H.264, H.265 (HEVC), VP9, and AV1. Each represents a different generation of compression technology, a different set of tradeoffs, and a different licensing philosophy. Understanding what separates them is essential for anyone who works with video, whether you are editing footage, sharing clips, building a website, or just trying to figure out why a video file will not play on your device.
Codecs vs Containers: The Essential Distinction
Before comparing specific codecs, it is important to understand a distinction that confuses many people: the difference between a codec and a container.
A codec (compressor-decompressor) is the algorithm that takes raw, uncompressed video frames and compresses them into a much smaller data stream. It is also the algorithm that decompresses that stream back into frames for playback. H.264, H.265, VP9, and AV1 are all codecs.
A container (also called a wrapper or mux format) is the file format that packages compressed video together with compressed audio, subtitles, chapter markers, and metadata into a single file. MP4, WebM, and MKV are all containers.
The relationship between codecs and containers is many-to-many. An MP4 file can contain H.264 video, H.265 video, or AV1 video. A WebM file can contain VP9 video or AV1 video. An MKV file can contain virtually any codec. When someone says "I have an MP4 file," they have told you the container but not the codec — and the codec is what determines the compression characteristics.
This is why two MP4 files of the same video can have wildly different file sizes. One might use H.264 at a high bitrate, another might use H.265 at an efficient setting. Same container, very different codecs, very different results.
H.264 (AVC): The Universal Standard
H.264, formally known as Advanced Video Coding (AVC), was finalized in 2003 and has been the dominant video codec for over two decades. Its reign is not because it is the most efficient — it is not, by a significant margin — but because it achieved something no codec before it managed: truly universal support.
What Makes H.264 Special
H.264 plays everywhere. Every smartphone, tablet, laptop, desktop, smart TV, game console, streaming stick, and web browser released in the last 15 years supports H.264 hardware decoding. Every camera, screen recorder, and video editing application can output H.264. Every streaming platform accepts H.264 uploads. This universality makes H.264 the safest choice when you do not know what device will play your video.
The codec introduced several techniques that were revolutionary in 2003: variable block sizes for motion compensation (from 16x16 down to 4x4), multi-frame reference prediction (using up to 16 previous frames to predict the current one), an in-loop deblocking filter, and context-adaptive binary arithmetic coding (CABAC) for efficient entropy coding.
H.264 Limitations
By modern standards, H.264's compression efficiency is mediocre. At any given visual quality level, an H.264 file will be roughly 50% larger than the same video encoded with H.265, and about 50-60% larger than AV1. For 1080p content, this rarely matters — file sizes are manageable regardless. For 4K and higher resolutions, the difference becomes significant.
H.264 also lacks native support for 10-bit HDR content. While the Main 10 profile exists, it is not widely implemented in hardware decoders, which means most H.264 content is limited to 8-bit SDR.
When to Use H.264
Choose H.264 when compatibility is the top priority. Specifically: when sharing video via email, messaging apps, or USB drives where you do not control the recipient's device; when uploading to platforms that might re-encode your video anyway; when targeting very old devices or embedded systems; and when encoding speed matters more than file size (H.264 encoders are the fastest and most optimized of the four).
H.265 (HEVC): Better Compression, Complicated Licensing
H.265, formally High Efficiency Video Coding (HEVC), was finalized in 2013 as the successor to H.264. Its primary achievement is delivering approximately the same visual quality at half the bitrate of H.264 — or equivalently, noticeably better quality at the same bitrate.
Technical Improvements Over H.264
H.265 expanded nearly every dimension of the codec design. Block sizes increased from H.264's maximum of 16x16 to a Coding Tree Unit (CTU) of up to 64x64, with flexible recursive subdivision down to 4x4. This larger range lets the encoder use very large blocks for uniform areas (sky, walls) and very small blocks for fine detail, wasting fewer bits on overhead.
Motion compensation became more precise, with quarter-pixel accuracy and 35 intra prediction modes (compared to H.264's 9). The Sample Adaptive Offset (SAO) filter was added as a post-processing step to reduce banding and ringing artifacts. And the transform stage was expanded to support sizes from 4x4 to 32x32, better adapting to the characteristics of each region.
The Licensing Problem
H.265 would have replaced H.264 as the universal standard if not for its licensing situation. The patents covering H.265 are held by three separate patent pools — MPEG LA, HEVC Advance, and Velos Media — each demanding independent royalty payments. Some patent holders are not part of any pool at all, creating additional legal uncertainty.
This fragmented licensing made H.265 expensive and legally risky to implement, especially for companies distributing software at scale. Mozilla never added H.265 support to Firefox (relying on the operating system's decoder instead). Google held off supporting H.265 in Chrome for years. Many open-source projects avoided it entirely.
The situation has improved somewhat as operating systems have absorbed the licensing burden — Windows, macOS, iOS, and Android all include H.265 decoders — but the damage to universal adoption was done. H.265 never achieved the effortless ubiquity of H.264.
Browser and Device Support
As of 2026, H.265 playback works in Safari (native), Chrome (via OS decoder since Chrome 107), Edge (via OS decoder), and Firefox (via OS decoder on Windows and macOS). Hardware decoding is available on most smartphones from 2016 onward, most Intel CPUs from 6th generation (Skylake) onward, and AMD and NVIDIA GPUs from 2015 onward.
When to Use H.265
Choose H.265 when you need better compression than H.264 and your target devices support it. The sweet spot is: personal video archives (where file size savings compound over thousands of files), 4K content (where H.264's file sizes become unwieldy), HDR content (H.265 has excellent 10-bit HDR support), and iPhone video (which defaults to H.265 recording since iOS 11).
VP9: Google's Royalty-Free Answer
VP9 was developed by Google and released in 2013 as a royalty-free alternative to H.265. It achieves compression efficiency comparable to H.265 — roughly 30-40% better than H.264 — without any patent licensing requirements.
Origins and Design
VP9 evolved from Google's VP8 codec (which was the video codec behind WebM and early WebRTC). It was designed primarily for web delivery, particularly YouTube, which is why its browser support has always been strong. Google invested heavily in making VP9 encoding efficient and high-quality, and YouTube adopted VP9 as its primary delivery codec for years.
Technically, VP9 shares many concepts with H.265 — larger block sizes (up to 64x64), recursive partitioning, improved prediction modes — but uses different specific techniques. VP9's superblock structure, for example, uses a binary recursive split rather than H.265's quad-tree, and VP9 uses a different entropy coding method (a hybrid of arithmetic coding and pre-defined probability contexts).
The YouTube Factor
VP9's real-world significance is largely tied to YouTube. When YouTube serves video to Chrome, Firefox, or Edge, it predominantly uses VP9 (and increasingly AV1). This means that VP9 is arguably the most-watched video codec in the world by viewing hours, even if most viewers have no idea they are watching VP9 content.
Browser and Device Support
VP9 is supported natively in Chrome, Firefox, Edge, and Opera. Safari added VP9 support starting with macOS Big Sur and iOS 14, though WebM container support in Safari has been inconsistent. Hardware VP9 decoding is available on Intel CPUs from 7th generation (Kaby Lake), most smartphones from 2018 onward, and most AMD and NVIDIA GPUs from 2016 onward.
When to Use VP9
Choose VP9 when you need H.265-class compression without licensing concerns. It is ideal for: web video delivery (especially in WebM containers), content targeted at Chrome and Firefox users, open-source projects that cannot use patent-encumbered codecs, and situations where AV1 encoding is too slow but H.264 files are too large.
AV1: The Open Future
AV1 was developed by the Alliance for Open Media (AOMedia) — a consortium including Google, Apple, Microsoft, Amazon, Netflix, Meta, Mozilla, Intel, AMD, NVIDIA, and many others — and was finalized in 2018. It represents the current state of the art in video compression, offering roughly 30% better compression than H.265 and 50% better than H.264 at equivalent quality.
Technical Advances
AV1 builds on the lineage of VP9, Daala (Mozilla's experimental codec), and Thor (Cisco's codec), combining the best ideas from each. Its technical innovations include:
Superblocks up to 128x128 pixels with recursive partitioning down to 4x4 using 10 different partition types (including T-shaped and cross-shaped splits). This extreme flexibility lets the encoder precisely match block structure to image content.
66 intra prediction modes — more than any previous codec — allowing extremely accurate prediction of blocks based on their neighbors. The more accurately a block can be predicted, the less residual data needs to be encoded.
Constrained Directional Enhancement Filter (CDEF) and Loop Restoration Filter as in-decoder post-processing steps that can recover quality lost during compression. These filters are particularly effective at eliminating ringing artifacts around edges and restoring fine texture detail.
Film grain synthesis, which strips natural film grain from the video, encodes it as a compact mathematical model, and regenerates it during decoding. This technique alone can save 15-25% on grainy or noisy footage.
The Encoding Speed Tradeoff
AV1's major practical limitation has been encoding speed. Software AV1 encoding using libaom (the reference encoder) or SVT-AV1 (the optimized encoder) is significantly slower than H.264 or H.265 encoding — anywhere from 5x to 50x slower depending on the speed/quality preset.
However, this is rapidly changing. Hardware AV1 encoding is now available in Intel Arc GPUs (since 2022), NVIDIA RTX 40-series GPUs (since 2022), AMD RDNA 3 GPUs (since 2022), Apple M4 chips (since late 2024), and MediaTek Dimensity chipsets for Android devices. Hardware encoding makes real-time AV1 encoding practical for screen recording, video calls, and live streaming.
Browser and Device Support in 2026
AV1 decoding support is now effectively universal in browsers: Chrome (since version 70), Firefox (since version 67), Edge (since Chromium-based versions), Safari (since Safari 17 / iOS 17), and Opera. Hardware AV1 decoding is available on recent smartphones, Intel 11th-gen and later CPUs, and all current-generation GPUs from AMD, NVIDIA, and Intel.
Streaming platforms have rapidly adopted AV1: YouTube, Netflix, Disney+, Amazon Prime Video, and Twitch all serve AV1 content at scale.
When to Use AV1
Choose AV1 when you want the smallest possible file at a given quality level and encoding speed is not critical. Specifically: archiving video (where the one-time encoding cost is amortized over the long storage benefit), web delivery to modern browsers, streaming (where encoding happens once and the content is watched millions of times), and 4K/HDR content (where the compression advantage over H.264 is most impactful).
Side-by-Side Comparison
| Feature | H.264 | H.265 | VP9 | AV1 |
|---|---|---|---|---|
| Release year | 2003 | 2013 | 2013 | 2018 |
| Compression vs H.264 | Baseline | ~50% better | ~35% better | ~50% better |
| Licensing | Royalties (one pool) | Royalties (multiple pools) | Royalty-free | Royalty-free |
| Max block size | 16x16 | 64x64 | 64x64 | 128x128 |
| HDR (10-bit) support | Limited | Excellent | Good | Excellent |
| Browser support (2026) | Universal | Via OS decoder | Universal | Universal |
| HW decode availability | Everything | Most post-2016 devices | Most post-2018 devices | Most post-2022 devices |
| Encoding speed | Fastest | Moderate | Moderate | Slowest (SW), improving (HW) |
| Primary container | MP4 | MP4 | WebM | MP4, WebM |
| Film grain synthesis | No | No | No | Yes |
Choosing the Right Codec for Your Scenario
Sharing via Email or Messaging
Use H.264 in an MP4 container. Maximum compatibility, no questions about whether the recipient can play it.
Uploading to Social Media or YouTube
Use H.264 or H.265. These platforms will re-encode your video anyway, so your upload codec mainly affects upload time (smaller files upload faster). H.265 gives you a smaller upload file. Some platforms now accept AV1 uploads as well.
Web Video on Your Own Website
Use AV1 with an H.264 fallback. Encode your video in AV1 for the best compression and serve it via the HTML <video> element with a <source> fallback to H.264 for any remaining incompatible clients. This gives the best experience to the majority while maintaining universal playback.
Long-Term Archiving
Use AV1 for the best compression-to-quality ratio, ensuring your archives take up minimal storage while preserving maximum visual fidelity. If encoding speed is a concern, H.265 is a reasonable compromise.
Converting Existing Videos
If you have videos in H.264 that are taking up too much space, converting to H.265 or AV1 can cut file sizes by 30-50% with minimal visual impact. A tool like Fileza.io can handle these conversions directly in your browser using FFmpeg WebAssembly, keeping your videos private on your device throughout the process.
The Direction Forward
The trend is clear: AV1 is becoming the default video codec for the web and streaming, just as H.264 was for the previous decade. The combination of superior compression, royalty-free licensing, and backing from essentially every major tech company makes AV1's trajectory unmistakable.
H.264 will remain important for years due to its unmatched compatibility, especially on older devices and in enterprise environments. H.265 occupies an increasingly narrow niche — better than H.264 but worse than AV1, and encumbered by licensing complexity that AV1 avoids entirely. VP9 has largely been superseded by AV1 in Google's own ecosystem, though it remains widely deployed and well-supported.
For most people making codec decisions today, the practical guidance is straightforward: use H.264 when you need it to play everywhere, use AV1 when you can, and use H.265 when AV1 is not an option but H.264's file sizes are too large.
Sources
- ITU-T Recommendation H.264 — The formal standard for Advanced Video Coding, maintained by the International Telecommunication Union.
- ITU-T Recommendation H.265 — The formal standard for High Efficiency Video Coding.
- Alliance for Open Media AV1 Specification — The official AV1 bitstream and decoding specification from AOMedia.
- Google VP9 Codec Specification — Google's documentation and specification for the VP9 codec.
- Netflix Technology Blog: AV1 Streaming — Netflix's technical publications on deploying AV1 at scale for streaming delivery.