Guide
Best Video Format for Websites: MP4 vs WebM vs HEVC vs AV1
Updated 5 min read

For most websites the best video format is MP4 with H.264 video and AAC audio, because every current browser, phone and TV can play it. If bandwidth matters, add a WebM version (VP9 video, Opus audio) as an alternative source and let the browser pick. You can make both with the video converter, without uploading the file anywhere.
Container vs codec: a quick distinction
People say "format" for two different things. The container (MP4, WebM, MKV) is the box with the file extension. The codec (H.264, VP9, HEVC, AV1) is how the picture inside is compressed. Browser support depends mostly on the codec. "MP4" on its own tells you very little, because an MP4 can hold H.264, HEVC or AV1.
The four options in practice
| Option | Browser support | File size | Verdict |
|---|---|---|---|
| MP4 (H.264 + AAC) | Everywhere: all current desktop and mobile browsers, TVs, older devices | Baseline | The safe default |
| WebM (VP9 + Opus) | Chrome, Edge and Firefox; recent Safari versions, but not older ones | Usually smaller than H.264 at similar quality | Good second source |
| HEVC (H.265) | Strong in Safari; elsewhere it depends on hardware and operating system | Smaller than H.264 | Do not use alone |
| AV1 | Newer browsers; smooth playback needs recent hardware | Often the smallest | Optional extra for large sites |
Support details change with browser and device updates, so check a current compatibility table before depending on anything newer than H.264.
MP4 with H.264 and AAC
This is the combination nobody has trouble with. Almost every device has hardware that decodes H.264, so playback is smooth and gentle on batteries. The cost is file size: at the same visual quality it is larger than the newer codecs. For most sites that is an acceptable trade for never having to explain why a video does not play.
WebM with VP9 and Opus
WebM is the web-native choice and tends to give smaller files at similar quality. It is worth adding when you serve many views or large videos. As a fallback-only format it is a poor idea, since older Safari versions cannot play it. Offer it next to an MP4, not instead of one.
HEVC (H.265)
HEVC compresses well and is what many phones record in, which is exactly why you meet it so often. For web delivery, though, support is patchy, so a page that relies on HEVC will show a blank player for some visitors. Convert HEVC footage to H.264 before publishing. (If an iPhone clip will not play on a PC, our guide on iPhone videos that will not play on Windows explains why.)
AV1
AV1 is royalty-free and can be impressively small, and recent browsers can decode it. Encoding is slow and older devices may stutter without hardware decoding. It makes sense only as an extra source on top of MP4, if you already have an encoder that produces it. The xFormat converter outputs MP4 and WebM rather than AV1 or HEVC.
Our recommendation for most sites
- Publish one MP4 (H.264 and AAC). That alone covers essentially every visitor.
- If bandwidth or page weight is a concern, make a WebM (VP9 and Opus) as well and list both in the video element. The browser plays the first source it supports, so put your preferred one first.
- Skip HEVC for the web, and treat AV1 as an optional bonus.
To produce the files, convert with the video converter or use the dedicated MP4 to WebM page. When the source already contains H.264 and AAC, a conversion to MP4 only repackages it, which is fast and lossless. When it contains something else, it is re-encoded to H.264 and AAC.
Resolution and bitrate matter more than the format
A 4K video in a 720-pixel-wide article column wastes bandwidth no matter which codec you choose. Scale down to the size you actually display. A 720p version at roughly 2.5 Mbps is a sound ceiling for in-page video, and full-width hero loops can often be smaller still. The compression guide shows how bitrate and resolution map to file size, and the compressor lets you pick a target size.
Autoplay, poster and other quick notes
- Autoplay only works muted. Browsers block autoplay with sound. Use the
mutedandplaysinlineattributes, otherwise iPhones may open the video full screen. - Add a poster image. The
posterattribute shows a still frame while the video loads, so the layout does not jump. - Keep loops short. A background loop of a few seconds is far lighter than a long clip.
- Very large or long videos are usually better served by a dedicated video hosting service than by a file on your own server.
A quick test before you publish
Do not trust one browser. Before the video goes live, open the page on a phone, on a desktop in at least two browsers, and, if you can, on an older device. Check three things: that it starts without a long wait, that it plays with the sound you expect, and that a muted autoplay loop really does start by itself. Ten minutes of testing catches nearly every format problem. Keep the original file, too, so you can export again later if standards or your needs change.
FAQ
Is MP4 or WebM better for a website?
MP4 with H.264 is the safer single choice because it plays everywhere. WebM is a good addition for smaller files, but should not be the only version.
Can I use HEVC on my website?
Not on its own. Browser support depends on the device and system, so some visitors would see nothing. Convert to H.264 first.
Does converting to MP4 lose quality?
Not when the video is already H.264 with AAC audio, because it is just repackaged. If the converter has to re-encode, a small quality loss is possible.
Are my files uploaded when I convert?
No. Conversion runs on your own device in the browser. Stay under about 500 MB on a desktop and about 200 MB on a phone.



