Audio & Video Format Guide: Containers, Codecs, and How to Choose
Choosing the right audio or video format is confusing because most people mix up two different things: the container (the file type) and the codec (the compression method). This guide explains both, compares the formats tools.beer supports, and tells you which one to pick.
All of our media tools run 100% in your browser with WebAssembly, so your files never leave your device. See the Media Tools hub for the full list.
1. The key concept: container vs codec
A media file is like a shipping box:
- Container (the box): MP4, MKV, MOV, AVI, WebM, FLV. It defines how video, audio, subtitles, and metadata are packaged and interleaved together.
- Codec (the compression): H.264, H.265, VP9, AV1 for video; MP3, AAC, OGG, Opus, FLAC, WAV for audio. It defines how each stream is compressed and decompressed.
The same MP4 container can hold H.264 or H.265 video. That is why "my MP4 won't play on my TV" usually means the codec inside is unsupported, not the MP4 box itself. When you convert, you can keep the container and only change the codec (for example, re-encode H.265 to H.264 while staying in MP4).
2. Audio formats
Audio formats fall into three groups:
- Uncompressed (WAV): perfect quality, huge files. Used for recording and editing.
- Lossless compressed (FLAC): perfect quality, about half the size of WAV. Used for archival and audiophiles.
- Lossy compressed (MP3, AAC, OGG, Opus): discards inaudible data for small files. Used for distribution and streaming.
Audio format comparison
| Format | Type | Quality | Size per min | Browser support | Best for |
|---|---|---|---|---|---|
| MP3 | Lossy | Good | ~1 MB @ 128 kbps | 100% (all browsers) | Universal sharing, podcasts |
| AAC | Lossy | Better than MP3 at same bitrate | ~1 MB @ 128 kbps | 100% (incl. Safari) | Apple, YouTube, modern distribution |
| OGG (Vorbis) | Lossy, open-source | Good | ~1 MB @ 128 kbps | Chrome, Firefox, Edge; limited on Safari/iOS | Open-source projects, games |
| Opus | Lossy | Best quality per bit | Smallest | Chrome, Firefox, Edge; Safari 15+ limited | Voice, WebRTC, streaming |
| FLAC | Lossless | Perfect (identical to source) | ~5 MB | Chrome, Firefox, Edge, Safari 11+ | Archival, audiophiles |
| WAV | Uncompressed | Perfect | ~10 MB | 100% (all browsers) | Recording, editing master |
Format notes
- MP3 — The legacy standard. Universal compatibility, but less efficient than newer codecs. Great when you need a file that opens everywhere.
- AAC — The modern lossy standard. At the same bitrate it sounds better than MP3, and it is supported by 100% of browsers including Safari. Default for Apple Music and YouTube.
- OGG Vorbis — Open-source and royalty-free with quality close to AAC. Well supported in Chrome, Firefox, and Edge, but only partially on Safari/iOS.
- Opus — The most efficient lossy codec available. Excellent at low bitrates, which is why it powers Discord, WebRTC, and voice chat. Broad support in Chrome/Firefox/Edge.
- FLAC — Lossless compression: the file is smaller than WAV but bit-for-bit identical to the original. Ideal for music you want to keep forever.
- WAV — Raw, uncompressed PCM audio. No decoding overhead, so it is the natural choice inside editors and for recording, at the cost of very large files.
3. Video containers
Video containers package one or more video streams, audio streams, subtitles, and metadata.
Video container comparison
| Container | Type | Common codecs inside | Browser support | Best for |
|---|---|---|---|---|
| MP4 | Standard | H.264, H.265, AV1, AAC, MP3 | Universal | Web, mobile, social, streaming |
| MKV | Open, flexible | Almost any codec | Moderate (players/TVs good, some mobile weak) | Archival, multi-language films |
| MOV | Apple | H.264, H.265, ProRes, AAC | Apple devices; limited elsewhere | Editing on macOS/iOS |
| AVI | Legacy | DivX, Xvid, H.264, MP3 | Older devices | Mostly obsolete |
| WebM | Open, web | VP8, VP9, AV1, Vorbis, Opus | Chrome, Firefox, Edge | Royalty-free web video |
| FLV | Obsolete | H.264, VP6, MP3 | None (Flash discontinued) | Legacy only — convert away |
| GIF | Animation | 256 colors, no audio | Universal | Short looping clips, memes |
Container notes
-
MP4 (MPEG-4 Part 14) — The gold standard. Every device, browser, and platform supports it. MP4 with H.264 video and AAC audio is the default output of nearly every camera and the accepted format of every social platform.
-
MKV (Matroska) — The "Swiss Army knife" of containers. Open-source, supports virtually unlimited tracks and advanced subtitles, and can hold almost any codec. Perfect for high-quality archives and movies with multiple audio/subtitle languages, but weaker on some mobile devices.
What does "virtually unlimited tracks" mean? A video file is really a bundle of independent tracks (streams) packed together — not just "picture + one audio." Take a movie: a single MKV can hold 1 video track + an English 5.1 audio track + a Chinese dub + a Japanese track + a director's commentary track + several subtitle tracks. When you play it (e.g. in VLC) you switch languages or subtitles from a menu, just like a DVD or Blu-ray. MKV is built on EBML (an extensible binary structure), so it can natively hold a large number of tracks — hence "virtually unlimited." By contrast, AVI barely supports multiple audio tracks, and MP4, while it can hold several, is more restrictive and weaker on subtitles. That is why MKV is the de-facto choice for archiving Blu-ray remuxes and multi-language films.
-
MOV (QuickTime) — Apple's format, optimized for macOS and iOS. Supports ProRes for professional editing. Best when you are working inside Final Cut or iMovie.
-
AVI — Microsoft's old format. Simple and widely compatible with legacy systems, but inefficient (large files) and missing modern features like embedded subtitles.
-
WebM — Google's open, royalty-free format built for the web. Uses VP8/VP9/AV1 video and Vorbis/Opus audio. Great browser support (Chrome/Firefox/Edge) and ideal for HTML5 video.
-
FLV — Adobe Flash Video. Flash was retired at the end of 2020, so no modern browser plays FLV. If you have old FLV files, convert them to MP4.
-
GIF — Technically an image format, not video. Limited to 256 colors and no audio, but universally supported for short looping animations. Use MP4 to GIF to make one.
4. Video codecs quick reference
The codec decides compression efficiency and compatibility more than the container does.
| Codec | What it is | Notes |
|---|---|---|
| H.264 (AVC) | The universal video standard | Plays everywhere; the safe default |
| H.265 (HEVC) | ~50% smaller than H.264 at equal quality | Limited browser support; complex licensing |
| VP9 | Google's open codec | Good compression, royalty-free; used by YouTube |
| AV1 | Newest open codec | Best compression, royalty-free, slow to encode, growing hardware support |
| ProRes | Apple's pro codec | High quality for editing; large files |
5. Which format should I use?
Audio
- Share online / maximum compatibility → MP3 (128–320 kbps)
- Better quality, Apple or YouTube → AAC (128–256 kbps)
- Open-source project → OGG Vorbis
- Voice, calls, streaming → Opus
- Keep forever / audiophile → FLAC
- Record or edit → WAV
Extract audio from a video with the MP4 to MP3 Converter, which can also output AAC and OGG.
Video
- Maximum compatibility / web / social → MP4 (H.264 + AAC)
- Archive with many audio/subtitle tracks → MKV
- Edit on Apple software → MOV
- Royalty-free web video → WebM
- Legacy AVI or FLV → convert to MP4
Our converters handle all of these: MOV to MP4, MKV to MP4, WebM to MP4, AVI to MP4, FLV to MP4, and the reverse directions MP4 to MOV, MP4 to AVI, MP4 to WebM, MP4 to MKV.
6. Why browser-based conversion matters
Most online converters upload your file to a server. tools.beer processes everything locally in your browser using WebAssembly (FFmpeg.wasm), so:
- Your files never leave your device (privacy-first).
- There is no server queue or upload wait for large videos.
- Conversion works offline after the page loads.
This is the same FFmpeg engine used in desktop tools, compiled to run in the browser.
Summary
- A container is the package; a codec is the compression. "MP4 won't play" is usually a codec issue.
- For audio: MP3 for compatibility, AAC for quality, Opus for voice, FLAC for archiving, WAV for editing.
- For video: MP4 (H.264) for everything, MKV for archives, MOV for Apple editing, WebM for open web video.
- Avoid AVI and FLV for new work; convert them to MP4.
Browse all converters on the Media Tools hub.