Video codecs explained: MP4, WebM, MOV, and when to use each
8 min read
Almost everyone who works with video files eventually hits the same confusion:
a file ends in .mp4, so surely it is "an MP4"? And yet two files
with that extension can behave completely differently — one plays everywhere,
the other refuses to open on a phone. The reason is that the extension tells
you far less than people assume.
Containers and codecs are two different things
A video file has at least two layers. The container is the outer wrapper: it holds the video track, the audio track, subtitles, chapter markers and metadata, and it defines how a player finds each of them. MP4, WebM, MOV and MKV are all containers.
The codec is the compression method used on the tracks inside. H.264, H.265, VP9 and AV1 are video codecs; AAC, Opus and MP3 are audio codecs. The codec determines how the picture was encoded, how efficiently it was compressed, and what a device needs to be able to decode in order to play it.
The useful analogy is a shipping box. The container is the box; the codec is the language the contents are written in. Knowing something arrived in a box tells you nothing about whether you can read what's inside. This is why "MP4" is not really an answer to "what format is it?" — an MP4 can hold H.264, H.265 or AV1 video, and a player that handles one may not handle the others.
The containers you'll actually meet
MP4 is the default for good reason: it is the most widely supported container in existence. Every browser, phone, smart TV and editing program will open one. It normally carries H.264 video with AAC audio, and that particular combination is about as close to universal as video gets. If you want a file that will simply work on somebody else's device without a conversation about it, this is the pick.
WebM was designed for the web and is royalty-free, which is why it became common for browser-delivered video. It carries VP9 or AV1 video with Opus or Vorbis audio. Compression is genuinely better than H.264 at the same quality — meaningfully smaller files — but support outside browsers is patchier. Older TVs and some editing software will not touch it.
MOV is Apple's container, and it is what most cameras and iPhones produce. Technically it is very close to MP4 (MP4 was derived from it), and it is excellent inside an Apple-centric editing workflow. It often holds higher-bitrate or less-compressed material intended for editing rather than distribution, which is why MOV files off a camera can be enormous.
MKV is the flexible one. It will hold essentially any combination of codecs, multiple audio tracks, and multiple subtitle tracks in a single file, which makes it the archivist's favourite. The trade-off is that browsers do not play it natively and some devices ignore it entirely.
The codecs, and what they cost you
H.264 (also called AVC) has been the workhorse since roughly 2005. Its compression is no longer state of the art, but its compatibility is unmatched — hardware decoding for it is built into practically every chip made in the last fifteen years. That hardware support matters more than people expect: it is the difference between a laptop playing a file coolly on battery and its fans spinning up.
H.265 (HEVC) achieves roughly the same quality in about half the space. The complication is licensing: patent pools mean support is inconsistent, and some browsers refuse it outright. It is common for 4K material where the file-size saving is worth the compatibility risk.
VP9 is Google's royalty-free answer to H.265, with broadly comparable efficiency. Browser support is good, hardware support less so.
AV1 is the current generation — noticeably more efficient than both H.265 and VP9, and royalty-free. The catch is that encoding it is slow, and hardware decoding only started appearing in consumer devices recently. On a device without it, AV1 playback falls back to software and drains the battery.
Choosing, in practice
For sharing with other people, use MP4 with H.264 and AAC. It is not the most efficient option and it does not need to be. The purpose of a file you send to someone else is that it opens without them having to think about it, and this combination does that more reliably than anything else.
For editing, prefer whatever your camera produced, in the highest quality you have. Every re-encode discards information permanently, so the fewer conversions between the camera and the final export, the better. Editing directly from a heavily compressed distribution file is possible, but you are working from a copy that has already lost detail.
For long-term archiving, the priority is different again: you want the highest-quality version you can store, in a container that will still be readable in a decade. MKV or MP4 with H.264 are both reasonable bets, precisely because they are boring and ubiquitous. Formats survive on the strength of how much material exists in them, not on technical elegance.
For saving space, H.265 or AV1 will do it — but check the devices you actually use before committing an entire library to either. A collection that plays on nothing is not a saving.
A note on re-encoding
Converting between containers is often free. Moving an H.264 track from MOV to MP4 can usually be done by copying the stream, without touching the video data at all — fast, and lossless. Converting between codecs is not: it means decoding and re-encoding, which always loses something, even at high quality settings. If a tool offers to "remux" rather than "convert", that is the lossless one, and it is worth preferring wherever the option exists.