For maximum compatibility H.264 is the safe choice; for small files on the web, AV1 with H.264 as a fallback. According to the ITU, H.265 (HEVC) needs only about half the bit rate of H.264 at the same quality, but it requires licences and plays in browsers only depending on the system and hardware. Which codec fits when, and what the difference between codec and container is.
First the terms: codec ≠ container
A common mix-up: the codec (H.264, AV1 …) compresses the actual video and audio data. The container (MP4, WebM, MKV) is just the shell that packages these data streams together with metadata.
A .webm file typically contains VP9 or AV1 video, an .mp4 mostly H.264 or H.265. So the extension says little about the actual compression; what matters is the codec inside.
The three codecs at a glance
H.264 / AVC: the compatible standard
H.264 (also AVC) was approved by the ITU in May 2003 (ITU-T H.264) and is the most compatible of the three codecs: browsers, phones, TVs and cameras generally play it, and encoding is comparatively fast.
H.264 is patent-encumbered too. According to MDN, commercial use requires a licence, but the Via LA patent pool charges no licence fees for internet video that is free for end users. When in doubt, H.264 is the safe choice, whether as the main format for a broad audience or as a fallback.
H.265 / HEVC: efficient, but licence-burdened
H.265 (HEVC) was approved in April 2013. According to the ITU, it needs only half the bit rate of its predecessor H.264. The catch is licensing: according to MDN, HEVC is a proprietary, patent-encumbered format, and according to Can I use it is hard for browsers to support HEVC universally because licensing is complex and expensive. For a long time the patents were licensed through several pools; Via LA’s HEVC/VVC programme was acquired by Access Advance as of 15 December 2025.
For the web this means: whether a browser plays H.265 depends on the operating system and hardware, according to MDN. Chrome, for example, supports HEVC on Windows, Linux and ChromeOS only on devices with hardware support, and Safari on macOS from High Sierra. If you use H.265 on the web, you always need a fallback. H.265 is most at home in the Apple world: iPhones can record video in HEVC (Apple Support).
AV1: royalty-free and made for the web
AV1 was released by the Alliance for Open Media (AOMedia) in March 2018 (AOMedia). The consortium was founded in 2015 by Amazon, Cisco, Google, Intel, Microsoft, Mozilla and Netflix. According to MDN, AV1 is fully royalty-free and designed for both the HTML <video> element and WebRTC.
According to Can I use, Chrome from version 70, Firefox from 67 and Edge from 121 play AV1, Safari from version 17 partially; in total about 96% of browsers in use (data as of September 2026). The flip side: encoding is compute-intensive, and whether a device decodes AV1 in hardware depends on its chip. Without a hardware decoder, the CPU does the work.
Direct comparison
| Property | H.264 / AVC | H.265 / HEVC | AV1 |
|---|---|---|---|
| Published by | ITU-T / ISO/IEC | ITU-T / ISO/IEC | Alliance for Open Media |
| First version | 2003 | 2013 | 2018 |
| Efficiency | reference | half the bit rate of H.264 according to the ITU | no comparable figure from the publisher |
| Licence | licence required, no fees for free internet video | patent-encumbered, licensed through pools | royalty-free |
| Browsers | very broad | depends on system and hardware | about 96% (Safari partial) |
What about H.266 / VVC?
VVC (H.266) was approved in August 2020 (ITU-T H.266). According to the ITU, its compression capability goes substantially beyond earlier standards. Like HEVC, VVC is licensed through patent pools; Via LA’s programme is now also with Access Advance. For video on the web, VVC is not a practical option at the moment.
Decision guide
- Maximum compatibility, every device → H.264 (MP4)
- Web delivery with small files → AV1 (WebM or MP4), H.264 as fallback
- Apple ecosystem → H.265, with a fallback for other platforms
- Royalty-freedom matters → AV1 or VP9
- Fast encoding without powerful hardware → H.264
The robust strategy for the web remains a fallback chain: AV1 for modern devices, H.264 as the universal fallback – with several <source> entries in the <video> element, much like the <picture> element for images.
Convert videos with wandlio
How conversion without uploading works, and why some formats run in the browser and others on the server, is explained in How does in-browser file conversion work?
The video converters Convert WebM to MP4, Convert MOV to MP4 and Convert MKV to MP4 run in your browser; H.264, HEVC and AAC are handled by its built-in codecs. The file stays on your device.