MP4 with H.264 is the format that plays everywhere. WebM is the open alternative that browsers prefer and that avoids licensing fees.
For delivery, the modern answer is usually both: MP4 as the broad fallback, WebM as the smaller option for browsers that support it.
Compatibility
H.264 in MP4 plays on phones, tablets, TVs, browsers, social platforms and video editors. WebM plays in Chrome, Firefox and Edge, is partial on Safari and is rejected by many editors and social uploaders.
Size and quality
At the same visual quality, VP9 usually beats H.264 on size and VP8 is roughly comparable. The gap is smaller than marketing suggests for short clips, and larger for long, high-resolution video.
Encoding cost
Browser encoding here is software-only. VP8 in FFmpeg.wasm is slower than a hardware H.264 encoder, so converting a long clip takes real time. Plan for that instead of assuming a stall.
What to ship
Publish MP4 as the baseline and add WebM for browsers that accept it, using <source> elements so the browser picks. Keep the original master file untouched.
Frequently asked questions
It re-encodes, so yes, slightly. Use a high quality preset and convert from the best source you have.
Often, at equivalent quality — especially with VP9. The gap depends on content and encoder settings.
Browser encoding runs on your CPU without hardware acceleration. A ten-minute 1080p clip can take several minutes.
Recent Safari versions support VP8/VP9 in WebM, older ones do not. Keep the MP4 for those devices.