← Back to Blog

Audio and Video Formats Explained: MP3, MP4, WAV, WebM, and Beyond

Audio and video formats can be confusing. Why are there so many? What's the difference between a codec and a container? Why does the same video play in Chrome but not in Safari? This guide demystifies multimedia formats, explains the key concepts, and helps you choose the right format for any situation — whether you're creating content, building a website, or just trying to play a file.

Codecs vs Containers: The Key Distinction

The most important concept in understanding multimedia formats is the difference between codecs and containers. These two terms are often confused, but understanding them is essential.

A codec (coder-decoder) is the algorithm that compresses and decompresses audio or video data. Examples include H.264 (video), VP9 (video), AAC (audio), and MP3 (audio). The codec determines the quality, file size, and computational requirements of the media.

A container (or wrapper) is the file format that holds the compressed data along with metadata like timestamps, subtitles, chapter markers, and synchronization information. Examples include MP4, MKV, WebM, and AVI. A container can hold multiple streams — for example, an MP4 file might contain an H.264 video stream, an AAC audio stream, and subtitle data.

This is why the same .mp4 file might play in one player but not another — both players support the MP4 container, but one might not support the specific codec used inside it.

Audio Formats

MP3 (MPEG-1 Audio Layer III)

MP3 is the format that revolutionized digital audio in the 1990s. It uses lossy compression to reduce audio files to roughly 10% of their original size while maintaining acceptable quality for most listeners. MP3 achieves this by using psychoacoustic models — it identifies and removes sounds that the human ear is less likely to perceive, such as quiet sounds masked by louder ones at similar frequencies.

MP3 files are typically encoded at bitrates between 128 kbps and 320 kbps. At 128 kbps, most people can hear compression artifacts (a slight "swishing" or "underwater" quality). At 320 kbps, the difference from the original is nearly imperceptible to most listeners.

Despite being over 30 years old, MP3 remains the most universally compatible audio format. Every device, operating system, and media player supports it. However, newer formats like AAC and Opus offer better quality at the same bitrate.

AAC (Advanced Audio Coding)

AAC was designed as the successor to MP3 and delivers noticeably better audio quality at the same bitrate. It's the default audio format for Apple devices, YouTube, and most streaming services. AAC at 128 kbps sounds roughly equivalent to MP3 at 160 kbps, making it more efficient for bandwidth-constrained applications like streaming and mobile downloads.

WAV (Waveform Audio File Format)

WAV is an uncompressed audio format that stores raw PCM (Pulse Code Modulation) audio data. A CD-quality WAV file (16-bit, 44.1 kHz, stereo) uses about 10 MB per minute of audio — roughly 10× the size of an equivalent MP3 at 320 kbps. WAV files preserve every detail of the original recording with zero quality loss.

WAV is the standard format for audio editing and production because you can process, edit, and re-export without accumulating compression artifacts. Professional audio engineers work in WAV (or similar lossless formats) and only convert to compressed formats for final distribution.

FLAC (Free Lossless Audio Codec)

FLAC provides lossless compression — it reduces file sizes by 50-70% compared to WAV while preserving bit-perfect audio quality. Unlike MP3 or AAC, you can decompress a FLAC file and get back the exact original audio, bit for bit. FLAC is popular among audiophiles and for music archiving where storage space matters but quality cannot be compromised.

OGG (Ogg Vorbis)

Ogg Vorbis is an open-source, patent-free lossy audio codec that offers quality comparable to AAC. It's widely used in gaming (many game engines use Ogg for sound effects and music), open-source software, and streaming applications. Ogg's open licensing makes it attractive for projects that want to avoid patent-encumbered formats.

Opus

Opus is the state of the art in lossy audio compression. Developed by the Internet Engineering Task Force (IETF), Opus outperforms MP3, AAC, and Vorbis at virtually every bitrate. It's particularly impressive at low bitrates (below 64 kbps), making it ideal for voice communication. Discord, WhatsApp, and most WebRTC applications use Opus for voice and audio transmission.

Video Formats

MP4 (MPEG-4 Part 14)

MP4 is the most widely used video container format. It can hold H.264 or H.265 video with AAC audio, along with subtitles, chapter markers, and metadata. MP4 is supported by virtually every device, operating system, browser, and media player, making it the safest choice for general video distribution.

Most online video platforms (YouTube, Vimeo, social media) accept MP4 uploads and recommend it as the preferred format. For web video, MP4 with H.264 video and AAC audio provides the best compatibility across all browsers and devices.

WebM

WebM is Google's open-source video format designed specifically for the web. It uses VP8 or VP9 video codecs with Vorbis or Opus audio. WebM files are typically smaller than equivalent MP4 files, and the format is royalty-free, making it attractive for open-source projects and web applications.

WebM is well-supported in Chrome, Firefox, and Edge, but Safari support has been limited. For maximum browser compatibility, many websites serve both MP4 and WebM versions of their videos and let the browser choose the best format.

MKV (Matroska)

MKV is an extremely flexible container format that can hold virtually any combination of video, audio, subtitle, and metadata streams. It supports multiple audio tracks (different languages), multiple subtitle tracks, chapter markers, and attachments. MKV is the preferred format for high-quality video collections because of its flexibility.

While MKV isn't directly supported by most browsers for web playback, it's widely supported by desktop media players like VLC, media center software like Plex, and video editing applications.

AVI (Audio Video Interleave)

AVI is a legacy container format created by Microsoft in 1992. While still functional, it lacks modern features like variable frame rate support, streaming capabilities, and efficient metadata handling. AVI files tend to be larger than equivalent MP4 files. For most purposes, MP4 has completely replaced AVI.

MOV (QuickTime)

MOV is Apple's container format, closely related to MP4 (they share the same underlying ISO base media file format). MOV files are commonly produced by Apple devices and professional video editing software like Final Cut Pro. They support high-quality video with features like ProRes codecs and alpha channel (transparency) in video.

Video Codecs Explained

H.264 (AVC)

H.264 is the most widely deployed video codec in history. It powers most streaming services, Blu-ray discs, video conferencing, and security cameras. H.264 offers excellent quality at reasonable bitrates and has hardware decoding support on virtually every modern device — from smartphones to smart TVs.

H.265 (HEVC)

H.265 achieves 25-50% better compression than H.264 at the same quality level, meaning smaller files or better quality at the same file size. It's particularly important for 4K and 8K video where H.264 files would be impractically large. However, H.265 has complex patent licensing that has slowed its adoption on the web.

VP9

VP9 is Google's open-source alternative to H.265, offering similar compression efficiency without licensing costs. YouTube uses VP9 for most of its video delivery. VP9 is supported in Chrome, Firefox, and Edge, but not in Safari (which prefers H.265).

AV1

AV1 is the newest and most efficient video codec, developed by the Alliance for Open Media (including Google, Apple, Microsoft, Netflix, and others). It offers approximately 30% better compression than VP9 and H.265 while being royalty-free. AV1 is being adopted rapidly — Netflix, YouTube, and other streaming services are rolling it out for improved streaming efficiency.

Choosing the Right Format

For Audio

  • General sharing: MP3 (maximum compatibility) or AAC (better quality)
  • Music production: WAV or FLAC (lossless quality)
  • Voice recording: Opus (best quality at low bitrates)
  • Archiving: FLAC (lossless, smaller than WAV)

For Video

  • Web publishing: MP4 with H.264 (universal compatibility)
  • Quality-focused web: WebM with VP9 (smaller files, good browser support)
  • Personal collection: MKV (maximum flexibility)
  • Social media upload: MP4 with H.264 (recommended by all platforms)
  • Professional editing: MOV with ProRes (preserves editing flexibility)

Related Tools