TechByBuild Logo

Which Formats Work? A Guide to Modern Browser Compatibility (Video & Image)

You've compressed your media, but will it actually play? Getting video and images to work everywhere is a critical part of web development. Here's a breakdown of which formats you can rely on and how to ensure everyone has a great experience.

🖼️ The Image Format Guide: From Legacy to Next-Gen

For decades, the web ran on three image formats: JPEG, PNG, and GIF. Today, we have new formats that offer vastly superior compression (smaller files!) at the same or better quality.

The "Safe" Legacy Formats (Universal Support)

JPEG (or JPG): The king of photos. This is your go-to for any "lossy" image (where perfect, pixel-for-pixel accuracy isn't needed). It's universally supported.

PNG: The standard for "lossless" images. Use this when you need to preserve sharp details, text, or—most importantly—transparency (like a logo with a clear background).

GIF: Mostly a legacy format for simple, small, or "pixel-art" style animations. For high-quality animations, video is now a better choice.

SVG (Scalable Vector Graphics): A vector format, not a pixel-based (raster) format. It's perfect for logos, icons, and illustrations that need to scale perfectly to any size without losing quality. Support is universal.

The "Next-Gen" Formats (The New Standard)

WebP: Developed by Google, WebP is now fully supported by all major browsers. It can handle both lossy (like JPEG) and lossless (like PNG) compression, as well as transparency and animation. It consistently creates smaller files than its older counterparts.

AVIF (AV1 Image Format): The newest contender. It offers even better compression than WebP, resulting in the smallest file sizes for high-quality images. As of 2024, it is supported by all major modern browsers (Chrome, Firefox, Safari, and Edge).

🎬 The Video Format Guide: The One Fallback and the New Champs

Video is more complex because it involves a container (like .mp4) and a codec (like H.264). But the compatibility story has become much simpler.

The Indisputable King: MP4 (H.264 + AAC)

  • Container: .mp4
  • Video Codec: H.264 (also called AVC)
  • Audio Codec: AAC
  • Support: This is the one format that works everywhere. Every browser, every smartphone, every smart TV. If you can only provide one video file, this is it. It offers a great balance of quality, size, and universal compatibility.

The Modern, Open-Source Choice: WebM (VP9 + Opus)

  • Container: .webm
  • Video Codec: VP9
  • Audio Codec: Opus
  • Support: Excellent support in Chrome, Firefox, and Edge. Safari has added support, making it very widely available. It's the primary format used by YouTube. It generally offers better compression (smaller files) than H.264.

The Future of Video: AV1

  • Container: .mp4 or .webm
  • Video Codec: AV1
  • Support: This is the new, royalty-free standard backed by all the tech giants (Google, Apple, Netflix, etc.). It offers the best compression by a significant margin. It is supported in all modern versions of Chrome, Firefox, and Edge. Safari support is available on newer devices with hardware decoding.

The "One to Avoid" for Web: HEVC (H.265)

While H.265 is a fantastic codec (it's what 4K Blu-rays use), its complex and expensive licensing has prevented its adoption in browsers. Only Safari supports it natively. For web delivery, stick to H.264, VP9, and AV1.

How to Ensure Compatibility: The HTML "Fallback" Solution

You don't have to choose just one format! HTML has built-in elements that let the browser pick the best one it supports.

For Images: Use the <picture> Element

This element lets you provide multiple formats. The browser will check the first <source>, and if it understands it (e.g., "AVIF"), it will use it. If not, it moves to the next one (e.g., "WebP"), and so on, until it hits the standard <img> tag as a final fallback.

Order matters: List the newest/best formats first.

<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img src="image.jpg" alt="A description of the image">
</picture>

For Video: Use the <video> Element with Multiple Sources

The <video> tag works the same way. The browser will try each <source> tag in order until it finds a combination of container and codec it can play.

Order matters: Put your best/most efficient format first.

<video controls>
  <source src="video.mp4" type="video/mp4; codecs=av01.0.05M.08">
  <source src="video.webm" type="video/webm; codecs=vp9, opus">
  <source src="video.mp4" type="video/mp4; codecs=avc1.42E01E, mp4a.40.2">
  Your browser does not support the video tag.
</video>

(Note: The codecs parameter is technically optional but highly recommended, as it lets the browser check for support without having to download part of the file first.)

Summary: Your Go-To Strategy

  • Images: Use the <picture> element. Provide AVIF, then WebP, then a JPEG or PNG fallback.
  • Video: Use the <video> element. Provide AV1, then WebM (VP9), then an MP4 (H.264) fallback.

Choose Your Plan

Start for free without an account, or upgrade to Pro for unlimited processing power.

Free

$0/month

Perfect for occasional use

No account required

Video files up to 100MB
Image files up to 10MB
One file at a time
Local processing (private)
Unlimited file sizes
Batch processing
All access

Pro

$19.99/month

For power users and professionals

Cancel anytime • Account required

Unlimited file sizes
Process multiple files in parallel
Local processing (private) - server fallback if required
Advanced codec support (like AV1)
Multi-threaded processing
Pro access to all converters and compressors
Priority support for new converter requests
Create Account & Upgrade
Resources.BrowserSupport.Meta.Title