MP4 vs WebM: which should you use?

A direct answer, a property comparison, measured file sizes and when to pick each format.

Short answer: MP4 or WebM?

Use MP4 when the video has to play on phones, TVs, editing programs and social networks; it is the safe default. Use WebM for video you embed on your own website and want to deliver in open, royalty-free codecs, where it plays in current versions of the major browsers. Both are containers, so what matters most is the codec inside: MP4 usually holds H.264, and WebM usually holds VP9.

MP4 and WebM compared

PropertyMP4WebM
File extensions.mp4, .m4v.webm
MIME typesvideo/mp4video/webm
Developed byMPEG (ISO/IEC)Google
First released20032010
What opens itMP4 files play in the built-in video players of Windows, macOS, iOS and Android, in every current web browser and in VLC.WebM plays in Chrome, Firefox, Edge, Opera and current versions of Safari, on Android, and in VLC and mpv.

Measured file sizes

These are file sizes we measured with NexMedia's own conversion engines, not estimates. In our test of 3 video clips, every file was converted at NexMedia's default settings, and each cell is the size of the file the converter produced.

The same video and audio streams in each container
SampleWebM, VP9 + Opus (default settings)MP4, VP9 + Opus (default settings)
Live-action clip A (hay harvest)4.92 MB4.93 MB
Live-action clip B (tidal flat)1.73 MB1.73 MB
Cartoon animation clip293 kB294 kB
All samples together6.94 MB6.95 MB

Across all 3 video clips together, MP4 (default settings) came to 100% of the size of WebM (default settings).

MP4 (default settings) was smaller than WebM (default settings) for 1 of the 3 video clips.

The samples

How this was measured

Engines: libvips 8.14.1 for images and ffmpeg 5.1.9-0+deb12u1 for audio and video, the builds inside NexMedia's conversion worker image. Measured on November 12, 2026.

Video conversions used NexMedia's default settings: VP9 video at constant quality (CRF 32) and Opus audio at 128 kbit/s. Where a column says streams copied, the codec options were set to copy instead, which changes only the container.

The input of every video measurement is an H.264 and AAC MP4 made with ffmpeg from the first 10 seconds of a CC0 clip, because MP4 is what most people convert. The MP4 column in the first table is NexMedia's own WebM output converted to MP4, so all the containers in that table hold the same streams.

Quality is not measured here. A smaller file is not a better file: encoders trade size against detail differently, and the same quality number means different things in different codecs. Only lossless and uncompressed outputs keep every detail of the data they were given.

Results depend on the content of each file, so other files can give different sizes. Treat these numbers as one reproducible test, not as a rule.

When to choose which

  • Videos for any audience

    Choose MP4. It plays in the default player of almost every phone, computer and TV, and almost every editing program and social network accepts it.

  • Embedding on your own site

    WebM with VP9 or AV1 can give a small file in open codecs and plays in current browsers. Many sites offer WebM first and MP4 as a fallback.

  • Short loops with transparency

    WebM can carry a transparent background in some browsers, which MP4 cannot. Check the browser support you need before relying on it.

  • Editing and archiving

    Editing programs and cameras work with MP4 far more often than with WebM. Edit in MP4 or the format your editor prefers, and export WebM only for the web.

The formats

Convert between them

Converter and compression tools

More comparison guides

Frequently asked questions

Is WebM better than MP4?

Neither is better in every respect. WebM uses open, royalty-free codecs and is designed for the web; MP4 plays almost everywhere. Because both are containers, the codec inside has more influence on quality and size than the container itself.

Do MP4 and WebM files differ in size?

When they hold the same video and audio streams the difference is small; the measured section above compares the same streams in both containers. Larger differences come from the codec and the quality setting.

Can all devices play WebM?

Current browsers do, and many media players do. Some TVs, phone gallery apps and editing programs only expect MP4.

Can I convert between MP4 and WebM with NexMedia?

Yes, in both directions. Converting to a different codec re-encodes the video, which takes time and can reduce quality slightly.