5 File Formats and Codecs

Learn how containers, codecs, compression, and metadata work together, and how to choose and verify media formats for sharing, playback, and editing.

Containers and codecs

A is the file structure that holds media streams and related information. It may package video, audio, subtitles, and together. A filename such as .mp4 or .mov usually indicates a , but does not by itself identify how the audio or video inside was encoded.

A (coder–decoder) is the method used to encode and decode a media stream. It may compress data to reduce file size. For example, an MP4 file might contain H.264 video and AAC audio: MP4 organizes the streams, while H.264 and AAC encode them. Another MP4 could contain different streams, so files with the same may not play on the same devices.

Common media formats

Common still-image formats include JPEG/JPG, PNG, GIF, WebP, AVIF, and TIFF. JPEG is commonly used for compressed photographs; PNG supports lossless images and transparency; GIF supports simple animation; WebP and AVIF can store still or animated images; and TIFF is common in high-quality imaging and workflows.

Common audio formats include MP3, AAC, WAV, FLAC, and Opus. MP3 and AAC commonly use . WAV often contains uncompressed PCM audio, FLAC compresses audio without losing the original audio data, and Opus is used in web and streaming contexts.

Common video formats include MP4, WebM, MOV, and AVI. These are containers, not single codecs. MP4 commonly carries H.264 video with AAC audio; WebM commonly carries VP8 or VP9 video with Vorbis or Opus audio. MOV and AVI can also contain different stream types.

Compression and format trade-offs

can greatly reduce file size, but it discards some information. Repeatedly editing and re-encoding a lossy file can reduce quality further. preserves the encoded source data and usually results in a larger file than .

Formats make different trade-offs among file size, quality, features, editing needs, and support. Choose a format according to what the file needs to preserve and how it will be used.

and privacy

is information about a media file or its contents. Technical can include image dimensions, audio sample rate, video frame rate, or ; descriptive can include title, creator, date, location, captions, or copyright information.

may be stored inside a file or in a separate catalog or sidecar file. MP3 files can contain ID3 tags, and image files may contain EXIF information. can help organize, search, play, and preserve media, but some applications remove or change it during export or conversion. Check when it matters, especially before sharing files that may include private information such as location.

What affects

File depends on more than the filename . The software or device must support the , the codecs used for each stream, and often the 's , level, or particular features. It also needs sufficient processing capability. A file can therefore have a familiar yet fail to play because one of its streams is unsupported.

Choosing and testing a format

Use this process to select and check a format:

  1. Identify the destination. Check the requirements of the website, app, device, or editing tool that will receive the file.

  2. Choose for the task. Use a widely supported compressed format for routine sharing. Choose a suitable lossless or high-quality format when preserving detail or continuing an edit is important.

  3. Verify the complete combination. For video, check the , video , and audio —not just “MP4” or “WebM.”

  4. Test the exported file. Play or open it in the intended software, and confirm that sound, image, subtitles, and important are present.

  5. Keep an original when needed. Retain a high-quality source before making compressed sharing copies.

For web video, MP4 with H.264 and AAC is a broadly compatible combination. WebM with VP9 or AV1 and Opus is another common option, but support varies across browsers and devices. Providing alternate versions can improve reach when a single combination is not supported everywhere.