MP4 vs WEBM
WEBM is smaller at the same quality and was built for the web; MP4 plays on more devices, including older phones and most TVs. For a website, serve WEBM with an MP4 fallback; for anything you are sending to a person, send MP4.
Last updated
Choose MP4 when
- Video sent to other people, or played on a phone or TV.
- Uploads to social platforms and editing software.
Choose WEBM when
- Background video and autoplaying clips on a website.
- Anywhere bandwidth matters more than universal support.
What MP4 actually is
MP4 is a container: it holds a video stream, usually H.264, an audio stream, usually AAC, and any subtitles or chapter data, and describes how they line up. Almost every device made in the last fifteen years plays that combination in hardware, which is why MP4 became the default.
Two MP4 files can behave completely differently depending on the codecs inside. A file that will not play is usually an unusual codec in an ordinary container, not a broken file.
What WEBM actually is
WEBM is a deliberately narrow subset of Matroska: VP8 or VP9 video with Vorbis or Opus audio, all of it free to use. It exists so browsers could ship video without patent licensing, and it is what most browser screen recorders produce.
A browser screen recording is usually a WEBM with a broken duration, so players show it as zero seconds or refuse to seek. Converting it to MP4 rewrites the header and fixes the seeking.
MP4 and WEBM side by side
| MP4 | WEBM | |
|---|---|---|
| Extension | .mp4 | .webm |
| Media type | video/mp4 | video/webm |
| Compression | Lossless | Lossless |
| Transparency | No | No |
| Animation | No | No |
| Quality setting | Not applicable | Not applicable |
| We can write it | Yes | Yes |
Questions
Is WEBM better quality than MP4?
At the same file size, usually yes — VP9 and AV1 compress harder than H.264. At the same visible quality it makes a smaller file. Encoding takes longer.
Will WEBM play on an iPhone?
In Safari on recent versions, yes. Older devices and a lot of apps still will not, which is why MP4 remains the safe thing to hand somebody.