MP4, MKV, MOV, WebM: containers vs codecs

4 min read · Updated 2026-09-12

People talk about MP4 as though it were a video format. It is not — it is a box. What is inside the box is the video format, and the same box can hold several different ones. Once that distinction is clear, a lot of confusing video behaviour stops being confusing.

Two different things with one file extension

A video file is made of streams: usually one video stream, one or more audio streams, and sometimes subtitles and chapter markers. Each stream is compressed with a codec — H.264, VP9, AAC, Opus. The codec is the algorithm that turns pictures and sound into a much smaller amount of data and back again.

The container is the file format that holds those streams together, keeps them in sync, and stores the metadata about them. MP4, MKV, MOV, WebM, and AVI are all containers.

So "MP4" does not tell you how the video is compressed. It tells you the streams are packaged in an MP4 container. The video inside is usually H.264, but it could be H.265 or AV1, and the file would still be an MP4.

Common pairings
ContainerTypically holds
MP4H.264 or H.265 video, AAC audio
MKV (Matroska)Anything — it is deliberately codec-agnostic
MOVH.264 or ProRes video, AAC or PCM audio
WebMVP8/VP9 or AV1 video, Vorbis or Opus audio
AVIOlder codecs — MPEG-4 Part 2, DivX, MJPEG

Why this matters for conversion

In principle, changing only the container is nearly free. If your MP4 holds H.264 video and AAC audio, and you want an MKV, the streams can be copied across byte for byte into a new box. This is called remuxing, it takes seconds regardless of the video length, and it loses absolutely nothing.

Re-encoding is the other case: the video is decoded back to pictures and compressed again with a different codec. That takes real time — often longer than the clip itself — and it always loses quality, because you are compressing an already-compressed picture.

Our converter re-encodes. Every video target has a fixed encoder profile so the output is predictable and plays everywhere, which means an MP4 to MKV conversion here is not a free remux: the video is re-compressed with libx264 at CRF 23 and the audio with AAC at 192 kbps. That is a deliberate trade — a predictable, universally playable file rather than a fast copy that might carry a codec the destination cannot decode.

What each container is actually for

  • MP4 is the default for a reason: it plays on every phone, browser, TV, and editor made in the last fifteen years. We also move its index to the front of the file so it can start playing before the download finishes, and write pixels as yuv420p, which is what the widest range of hardware decoders expect.
  • MKV is the flexible one. It can hold multiple audio tracks, multiple subtitle tracks, and chapters, in almost any codec. That is why it dominates in archiving and media servers, and why it is rarer on the open web — browsers do not play it natively.
  • MOV is Apple's container and is what you get out of an iPhone and out of Final Cut. Functionally it is very close to MP4 — they share an ancestor — and we write it with the same H.264/AAC profile plus forced yuv420p pixels, which is what QuickTime expects from an imported file.
  • WebM exists to be the open, royalty-free web container. We encode it with VP9 in constant-quality mode and Opus audio, which typically yields a noticeably smaller file than H.264 at similar quality — at the cost of a slower encode.
  • AVI is a legacy format. We write it with MPEG-4 Part 2 rather than H.264, because that is what old AVI players and editors actually decode. It is a weaker codec: at matching quality the file is usually larger than the H.264 you started with. Convert to AVI when something specifically needs AVI, not for quality.

The practical consequences

  • Converting between containers here costs you a generation of quality. Do it once from the best source you have, not repeatedly.
  • Only one video stream and one audio stream survive. Multi-language audio and embedded subtitle tracks are not carried across — if you need the subtitles, extract them separately as SRT or VTT.
  • Chapters do not survive either. If you are archiving something with chapter markers, keep the original.
  • A file that will not play is almost always a codec problem, not a container problem. Renaming the extension changes nothing; the decoder is what is missing.

Choosing, in one line each

Sharing with a person or uploading somewhere: MP4. Publishing on your own website where you control the markup: WebM with an MP4 fallback. Archiving a film with several audio and subtitle tracks: MKV, from the original source. Feeding an old Windows editor that refuses everything else: AVI, and accept the quality cost.

Try it

Read next

MP4, MKV, MOV, WebM: containers vs codecs · Convert Everything