When you save or share a video, the format decides which devices can play it and which codecs it can hold. Quality and file size depend mainly on the codec inside and its settings. The four formats you meet most often are MP4, WebM, MOV and MKV. Once you have picked one, see the basics of video format conversion for the commands.
Format Cheat Sheet
| MP4 | WebM | MOV | MKV | |
|---|---|---|---|---|
| Extension | .mp4 |
.webm |
.mov |
.mkv |
| Standard | ISO/IEC | WebM Project | Apple proprietary | Matroska |
| Browser playback | Excellent | Excellent | Fair | Fair |
| Mobile compatibility | Excellent | Good | Good (Apple) | Fair |
| Streaming | Excellent | Excellent | Fair | Fair |
| Supported codecs | H.264, H.265, AV1, and more | VP8, VP9, AV1 | H.264, ProRes, HEVC | Anything |
| File size (with typical codecs) | Medium | Medium–small | Medium–large | Medium |
| Editing suitability | Good | Fair | Excellent (Mac) | Excellent |
MP4 (.mp4)
The most widely used format. It is defined in the international standard ISO/IEC 14496-14 and plays on almost every device and service.
Main uses:
- Uploading to YouTube and social media
- Transferring to and storing on smartphones
- Web delivery
Recommended codec combinations:
# Maximum compatibility: H.264 + AAC
ffmpeg -i input.mov -c:v libx264 -crf 23 -preset fast -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart output.mp4
# High efficiency: H.265 + AAC (can be smaller at similar quality)
ffmpeg -i input.mov -c:v libx265 -crf 28 -c:a aac -b:a 128k output.mp4
With -movflags +faststart, a video on the web starts playing before the download finishes.
WebM (.webm)
An open format made for the web. Google created it for HTML5 video, and the video inside is VP8, VP9 or AV1. It is royalty-free (no patent fees to pay) and most browsers play it. For the smallest files, see AV1 encoding with SVT-AV1 and libaom.
Main uses:
- Embedded videos on websites
- Discord animations (as an alternative to GIF)
- Web app UI video
FFmpeg conversion:
# VP9 WebM (high quality, high compression)
ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 0 -crf 33 -c:a libopus -b:a 96k output.webm
# AV1 WebM (best efficiency, slow to encode)
ffmpeg -i input.mp4 -c:v libaom-av1 -crf 30 -b:v 0 -c:a libopus output.webm
MOV (.mov)
Apple’s QuickTime format. It is the standard format on Mac and iPhone and can hold high-quality codecs such as ProRes. On Windows, you may need extra codecs to play it.
Main uses:
- Recording and editing on Mac and iPhone
- Interchange with Final Cut Pro and DaVinci Resolve
- Video production workflows (intermediate format)
FFmpeg conversion:
# MOV to MP4 (the most common conversion)
ffmpeg -i input.mov -c:v libx264 -crf 23 -c:a aac output.mp4
# MOV to MOV (codec conversion only)
ffmpeg -i input.mov -c:v libx264 -c:a aac output.mov
MKV (.mkv)
Matroska, the most flexible container (the file type that holds the video and audio). One MKV file can hold almost any codec, plus subtitles, chapters and several audio tracks. Some phones and tablets need an extra app to play it.
Main uses:
- Long-term storage and archiving
- Managing multi-language subtitles
- Intermediate storage for editing projects
FFmpeg conversion:
# MP4 to MKV (no codec change, fast)
ffmpeg -i input.mp4 -c copy output.mkv
# MKV to MP4 (for better compatibility)
ffmpeg -i input.mkv -c:v libx264 -pix_fmt yuv420p -c:a aac output.mp4
Recommended Format by Use Case
| Use case | Recommended | Why |
|---|---|---|
| YouTube uploads | MP4 (H.264) | YouTube’s recommended format, broad compatibility |
| Embedded web video | WebM (VP9) + MP4 fallback | Smaller file size |
| Storing iPhone footage | MOV → MP4 conversion | Works on any device |
| Long-term storage with subtitles | MKV | Multi-track support |
| Social media (Twitter / Instagram) | MP4 (H.264) | Platform requirement |
| Discord GIF alternative | WebM | Fits within file size limits |
Measured: time and size
This is the command that was measured:
ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 0 -crf 33 -c:a libopus -b:a 96k output.webm
| Metric | Measured |
|---|---|
| Wall-clock time | 729.16 s (0.16x realtime) |
| Output size | 65.97 MB |
| vs. the same source re-encoded to H.264 (86.26 MB) | -23.5% |
Rig: Intel Core i9-14900KF (32 threads), FFmpeg 8.1 (gyan.dev full build). Source: Big Buck Bunny (© Blender Foundation, CC BY 3.0), 1920x1080 / 30 fps / 120 s / 351.4 MB; the VP9 run used this video plus a 128 kb/s AAC track. Measured 2026-09-05, one command at a time. The raw numbers are in the dataset.
Why the numbers land where they do
A two-minute clip took 729.16 seconds. At 0.16x realtime, the encode runs much slower than the video plays. On the same machine and source, a plain libx264 re-encode finished in 27.97 s, a heavy boxblur filter in 59.37 s and a downscale to 720p in 18.43 s. All of those finished within a minute; VP9 took more than ten times as long as any of them. libvpx-vp9 cannot spread its work across threads nearly as well as libx264, so 32 threads speed it up far less than the core count suggests.
The WebM came out 23.5% smaller than the H.264 file. But the 86.26 MB H.264 file was encoded with -an and has no audio, while the 65.97 MB WebM includes a 96 kbps Opus track. CRF values also mean different things in different encoders, so VP9 at -crf 33 and x264 at -crf 23 are not matched for quality.
Converting a format can mean two very different jobs. Changing the codec took 729.16 s. Changing only the container, with -c copy passing the streams through unchanged, took 0.41 s to 0.49 s in the same batch (0.41 s to remap streams, 0.49 s to move the moov atom to the front). If you only need to put an MP4’s streams into an MKV file, there is almost nothing to wait for. A VP9 encode is a long batch job, so do not leave it until just before a deadline.
Because of this gap, a practical setup is MP4 (H.264 + AAC) as the main format, with WebM added for web delivery. The slow encode happens once, so it is worth it only when the file will be served many times.
Convert in Your Browser Right Now
The video format conversion tool converts between MP4, WebM, MOV and MKV in your browser, with nothing to install.
To make the converted file smaller, use the video compression tool.
Frequently Asked Questions
Which format is best for YouTube uploads?
MP4 with H.264 video and AAC audio. YouTube’s recommended upload settings also list MP4 as the container and H.264 as the video codec.
Should I use WebM or MP4 for my own website?
Both. In the <video> tag, list the WebM (VP9 or AV1) first for smaller files, and the MP4 (H.264) after it as a fallback for older Safari and email clients.
MP4 vs MOV — what is the difference?
MOV is Apple’s QuickTime container. MP4 is a standardized container that works well for delivery. Their structures are related, but they differ in the metadata they carry and in how editing codecs are handled. For the web, MP4 is usually the safer choice.
Is MKV safe for sharing?
If the other person uses Plex, Jellyfin or VLC, yes. For email, social media or the iPhone Photos app, no. In that case, remux it to MP4 (copy the streams into a new container) with ffmpeg -i in.mkv -c copy out.mp4. This drops subtitle tracks without a warning; add -c:s mov_text to keep a text subtitle such as SRT.
AVI is old — is it ever a good choice?
Only for old DV camcorder workflows. For modern codecs (H.264, HEVC, AV1), use MP4 or MKV. AVI has no proper way to keep audio and video in sync when the frame rate varies.