MP4 or WebM: which should you use?

Short answer: use MP4 unless you are putting video on your own website and want smaller files. Here is the longer answer.

What each one is

MP4 is a container most often used with H.264 video and AAC audio. WebM is a container designed for the web, used with VP8, VP9 or AV1 video and Opus or Vorbis audio. When people compare them, they’re really comparing H.264 with VP9.

Side by side

MP4 (H.264)WebM (VP9)
Plays in browsersAllAll current major browsers; older Safari versions are limited
Plays on phonesAllAndroid yes; iPhone in Safari on recent iOS, not in every app
Editing softwareUniversalPatchy, often needs conversion
Social platformsAccepted everywhereOften rejected or converted
Size at same qualityBaselineTypically noticeably smaller
Encoding speedFastSeveral times slower

Recommendations

  • Sharing with people, uploading to platforms, sending to an editor: MP4. Compatibility beats a few megabytes.
  • Background or product videos on your own website: WebM as the main source with an MP4 fallback in the same <video> element. Visitors get the smaller file when their browser supports it.
  • Replacing a GIF: a short muted loop in either format is far smaller than the GIF. MP4 is the safer pick.

Converting between them

The converter re-encodes MP4 to WebM using VP9 and Opus, and WebM to MP4 using H.264 and AAC. Stream copying isn’t possible between them, because the codecs differ, so expect a WebM conversion to take noticeably longer than an MP4 one. Both directions lose a little quality, since the picture is decoded and encoded again; converting back and forth repeatedly is a bad idea. Keep one master file and derive the other format from it once.

What about AV1?

AV1 is the newest of the three and compresses better than VP9, but it is much slower to encode and still unevenly supported in older hardware. In practice: H.264 for anything that leaves your computer, VP9 for web video where size matters, and AV1 when a platform re-encodes your upload anyway and you want the best quality per megabyte. A browser that cannot decode AV1 shows a black frame, so an MP4 fallback is still needed.

Audio, subtitles and transparency

  • Audio: MP4 usually carries AAC, WebM carries Opus or Vorbis. Opus is the better codec at the same bitrate, and AAC is the more widely supported one. Both are transparent for speech at 96–128 kbit/s.
  • Subtitles: MP4 supports timed text tracks, and WebM supports WebVTT natively. On the web, a separate .vtt file referenced in the player is more flexible than either, because it can be edited without re-encoding the video.
  • Transparency: WebM supports an alpha channel in VP9; MP4 with H.264 does not. That alone decides the format for animated logos and overlays.

A practical setup for your own website

Offer both files and let the browser choose. The markup is small and needs no JavaScript:

<video autoplay muted loop playsinline poster="poster.jpg">
  <source src="clip.webm" type="video/webm">
  <source src="clip.mp4" type="video/mp4">
</video>

The browser takes the first source it can play, so put the smaller WebM first and the universally supported MP4 second. Always supply a poster image: it shows while the video loads and stands in when autoplay is blocked, which is common on mobile data connections.

How to check what a file really contains

The extension tells you the container, not the codecs inside. A .mp4 can hold H.264, HEVC or AV1, and the difference matters when a device refuses to play it. Drop the file into the metadata viewer to see the actual video and audio codecs, the resolution and the bitrate before deciding whether to convert.

Which one for a phone recording?

For ordinary use, MP4. An iPhone records HEVC in a MOV or MP4 container, and Android phones typically produce H.264 or HEVC MP4. Sharing that file directly is the safest route; converting to WebM gains a few megabytes and costs compatibility with editors, smart TVs and some messaging apps. Convert to WebM only when the target is a web page you control, and even then keep the MP4 alongside it as a fallback.

One caveat for iPhone footage: HEVC inside an MP4 is still HEVC. If an older Windows computer shows a black screen, the container is not the problem and a WebM file will not help either; the codec has to become H.264, which the converter does when you choose to re-encode.