Audio and Video Codecs Supported by the Safari Browser

This article provides a complete breakdown of the audio and video codecs supported by Apple’s Safari web browser. It details how specific compression formats—including HEVC, VP8, VP9, and Opus—are supported inside media containers like MP4, WebM, and QuickTime across macOS, iOS, and iPadOS.

Video Codecs

Safari relies heavily on hardware acceleration for video playback. Support for specific video codecs depends on both the Safari version and the underlying Apple hardware.

  • H.264 (AVC): The most universally supported video codec in Safari. It is supported inside MP4 (.mp4), QuickTime (.mov), and fragmented MP4 (fMP4) containers across all versions of Safari.
  • HEVC (H.265): Supported in Safari 11 and later. HEVC video must be packaged inside MP4, QuickTime, or fMP4 containers. Playback requires a device with hardware decoding capabilities (macOS High Sierra or later, and iOS 11 or later).
  • VP8: Initially supported only for WebRTC streams, VP8 is now supported for standard media playback inside the WebM (.webm) container starting with Safari 14 on macOS Big Sur and iOS 14.
  • VP9: Supported in Safari 14 and later. Like VP8, VP9 must be placed inside a WebM container. It enables 4K and HDR video playback on platforms like YouTube.
  • AV1: Supported starting in Safari 17, but strictly limited to Apple devices with hardware-level AV1 decoding (such as the iPhone 15 Pro, M3 Macs, and newer). AV1 is supported inside both MP4 and WebM containers.

Audio Codecs

Safari supports a wide range of lossy and lossless audio codecs, though container requirements are strict for newer formats like Opus.

  • AAC (Advanced Audio Coding): Safari’s primary audio codec. It is supported in MP4, M4A (.m4a), QuickTime, and Audio Data Transport Stream (ADTS) containers.
  • Opus: Supported in Safari 11 and later, Initially, Safari only allowed Opus inside Apple's Core Audio Format (.caf) container or via WebRTC. Starting with Safari 14, Opus is fully supported inside the WebM container. Safari does not reliably support Opus inside standard Ogg (.ogg) containers without custom JavaScript decoders.
  • MP3: Universally supported in Safari as a standalone audio format (.mp3) or encapsulated within MP4, QuickTime, and WAV containers.
  • FLAC: Lossless audio codec supported in Safari 11 and later. It can be played as a standalone .flac file or inside MP4, QuickTime, and CAF containers.
  • ALAC (Apple Lossless): Natively supported across all modern Safari versions inside MP4, M4A, QuickTime, and CAF containers.
  • Vorbis: Supported in Safari 14 and later, exclusively when packaged inside a WebM container.
  • Linear PCM: Uncompressed audio supported inside WAV (.wav), AIFF (.aiff), QuickTime, and CAF containers.

Media Container Compatibility Summary

To ensure media plays correctly using the HTML5 <video> and <audio> elements in Safari, you must pair the right codecs within the correct containers.

MPEG-4 (.mp4, .m4v, .m4a) and QuickTime (.mov)

  • Supported Video: H.264, HEVC, AV1 (Hardware dependent)
  • Supported Audio: AAC, MP3, ALAC, FLAC, Linear PCM

WebM (.webm)

  • Supported Video: VP8, VP9, AV1 (Hardware dependent)
  • Supported Audio: Opus, Vorbis

Core Audio Format (.caf)

  • Supported Video: None (Audio-only container)
  • Supported Audio: Opus, AAC, ALAC, FLAC, MP3, Linear PCM

Standalone Audio Formats

  • MP3 (.mp3): MPEG-1/2 Audio Layer III
  • FLAC (.flac): Free Lossless Audio Codec
  • WAV (.wav) / AIFF (.aiff): Linear PCM