↑↓ to move ↵ to open Esc to close Browse all tools

Audio and video guide

MP4 vs WebM vs MOV: Containers, Codecs and What to Export

MP4, WebM and MOV are not three ways of compressing video. They are three boxes, and what matters for size, quality and playback is the codec inside the box. Once that is clear, most format questions answer themselves: why a MOV will not play in a browser, why a WebM is smaller, and which file to export for a website, a client or a social upload.

The box and what is in it

MDN's definition: a media container is a file format that encapsulates one or more media streams, audio or video, along with metadata, so they can be stored and played together. A video file therefore has at least three parts that can each be chosen separately: the container (the extension you see), the video codec and the audio codec. MDN also warns that support for a container implies nothing about the codecs inside it; a browser that opens MP4 files still cannot play an MP4 whose video is in a codec it lacks.

The containers

ContainerExtensionVideo codecsAudio codecsWhere it fits
MP4.mp4, .m4vH.264 (AVC), H.265 (HEVC), AV1, VP9AAC, MP3, Opus, FLACThe industry standard; plays everywhere
WebM.webmVP8, VP9, AV1Opus, VorbisOpen and royalty-free, built for the web; native in most browsers
QuickTime.movH.264 and many older codecsAAC, ALAC, MP3Apple's format; cameras and editing apps; limited browser support
3GP.3gpH.264, H.263, MPEG-4 Part 2AAC, AMROlder phones and slow networks
Ogg.ogv, .oggTheora, VP8, VP9Vorbis, Opus, FLACNever widely enough supported to be a first choice

Two of these do the work. MDN describes MP4 as the industry standard for video content, widely supported across devices and browsers, and WebM as an open, royalty-free container designed for modern web use with native support in most browsers. QuickTime, the MOV format, is what cameras and Apple's editing tools write; MDN says browser support for it is limited to older Safari versions and browsers that had the QuickTime plugin, which is why a MOV straight from the camera needs converting before it goes on a page.

The codecs

CodecLicensingBrowser supportNote
H.264 (AVC)Patented, licensedEvery major browserThe safe fallback; free to stream when the video is free to viewers
H.265 (HEVC)Patented, licensedDepends on operating system, hardware and browserSmaller files than H.264, but support is conditional
VP9Open, royalty-freeEvery major browserThe WebM workhorse; no alpha in Safari
AV1Open, royalty-freeAll browsers; Safari only on devices with a hardware decoderBest compression of the five; MDN's first recommendation
VP8Open, royalty-freeEvery major browserOlder; allows an alpha channel where supported

Licensing explains the split. MDN describes H.264 as proprietary with patents held by several parties, though the patent pool charges no fee for streaming internet video that is free to viewers, and HEVC as proprietary with fees charged to developers. VP8, VP9 and AV1 are open and royalty-free. On support, H.264, VP8 and VP9 play in every major browser; AV1 plays everywhere but in Safari only on devices with a hardware decoder, which MDN lists as M3 Macs and later, the iPhone 15 Pro and the iPhone 16 onward.

What to export for a website

MDN's recommendation for general web video has two parts, an open option first and the proprietary one as the fallback: WebM with AV1 video and Opus audio, then MP4 with H.264 video and AAC audio, which it calls a broadly supported combination, by every major browser. The video element lists both and the browser takes the first it can play:

<video controls width="1280" height="720" poster="clip.jpg">
  <source src="clip.webm" type="video/webm; codecs=av01,opus">
  <source src="clip.mp4" type="video/mp4">
</video>

If only one file is practical, MDN's advice is the format with the broadest reach, MP4. The video compressor writes MP4 with H.264 and AAC, or WebM with VP9 and Opus where the browser cannot encode H.264, and the video resizer brings a 4K camera file down to the size the page actually shows. Audio-only uses of a clip go through the audio extractor.

Which file for which job

JobExportWhy
Social media uploadMP4, H.264 + AACAccepted everywhere
Video on your own websiteWebM (AV1 or VP9) plus MP4 fallbackSmaller files for most visitors, playback for all
Sending to a client or colleagueMP4, H.264 + AACOpens in every player without a plugin
Short silent loop on a pageMP4 or WebM, muted and autoplayingA fraction of the size of a GIF; the video to GIF converter is for the places that only take GIFs
Archive of the originalWhatever the camera wrote, often MOVKeep it; every conversion starts from here

Converting without losing more than you must

  • Change the container, keep the codec when you can. A MOV with H.264 inside becomes an MP4 by remuxing, with no re-encoding and no loss.
  • Trim before you re-encode. The video trimmer cuts the clip first, so the expensive step runs on fewer seconds.
  • Re-encode once, from the original. Each generation of lossy encoding discards detail; compress the master, not the last export.
  • Match the target. A 1080p page slot does not need a 4K file; resolution and bitrate, not the container, set the size.

Frequently asked questions

What is the difference between a container and a codec?

MDN defines a media container as a file format that wraps one or more media streams, video and audio, together with metadata, so they can be stored and played back together. The codec is the compression method used for each stream inside. MP4, WebM and MOV are containers; H.264, VP9 and AV1 are video codecs. The file extension tells you the container, not the codec.

Is MP4 or WebM better?

For reach, MP4 with H.264 video and AAC audio: MDN calls it a broadly supported combination, by every major browser. For efficiency and licensing, WebM with AV1 video and Opus audio, which MDN lists first because every part is open and royalty-free and well supported, except Safari on older Apple devices. The usual answer is both, WebM first and MP4 as the fallback.

Why does my MOV file not play in the browser?

MDN says browser support for QuickTime is limited to older versions of Safari and browsers that had Apple's QuickTime plugin, which no longer exists. A MOV usually holds H.264 video that browsers can decode, so remuxing or converting it to MP4 fixes playback without a visible quality change.

Does converting between formats lose quality?

Changing the container alone does not; the streams are copied. Changing the codec re-encodes the picture, which always costs some detail, so convert from the original rather than from an earlier conversion, and keep the original.

Which format should I upload to social platforms?

MP4 with H.264 and AAC, the combination MDN says every major browser supports and the one every upload form and player accepts. Export it at the resolution the platform asks for and keep the original.

Sources