Web Audio Formats: What to Use in 2026
Web audio has gotten simpler. Browser support has expanded. But choosing the wrong format still breaks playback for some users. This guide covers what works in every browser, what is fast, and how to handle edge cases.
Browser Support in 2026
MP3: Supported everywhere. Chrome, Firefox, Safari, Edge, all mobile browsers. Zero compatibility issues. AAC/M4A: Supported everywhere since Safari joined in 2016 and Firefox added support. Safe choice. OGG Vorbis: Chrome, Firefox, Edge. Not supported in Safari. Still requires a fallback. Opus: Chrome, Firefox, Edge. Safari added Opus support. Check caniuse.com for the latest. WAV: Supported everywhere but impractical for web delivery due to file size. FLAC: Broad support but file sizes are too large for most web uses.
Recommended Strategy
For maximum compatibility with one format: use MP3. It works in every browser without exception. For the best quality-to-size ratio: use AAC. Better than MP3 at equivalent bitrates and now universally supported. For progressive web apps: Opus if you can drop Safari support or provide a fallback. Opus gives the best compression efficiency. Use the HTML5 audio element with multiple sources as a fallback chain. List Opus first, then AAC, then MP3.
Performance and File Size
Every kilobyte matters on mobile. A 30-second background loop at 128 kbps MP3 is about 240 KB. The same in Opus at 96 kbps sounds equal or better and is 180 KB. For sound effects, short audio sprites reduce HTTP requests. Combine multiple short sounds into one file and play segments using the Web Audio API. Preload strategically — use preload="none" for audio that may not play, preload="metadata" for conditional playback, and preload="auto" only for audio that will definitely play.
Web Audio API Considerations
The Web Audio API decodes audio into PCM buffers. Format support depends on the browser's built-in decoders. Decode time varies by format and browser. MP3 decoding is fast everywhere. AAC is fast. Opus is fast. OGG is fast in browsers that support it. For games and interactive applications using Web Audio API, decode audio during loading screens. Do not decode during gameplay — it causes frame drops. AudioContext.decodeAudioData() is the standard method.
Accessibility and Best Practices
Provide controls. Never autoplay audio without user interaction — browsers block it anyway. Include transcripts for spoken audio content. Use ARIA labels on audio controls. Test with screen readers. Provide captions for video with important audio content. Compress aggressively for mobile users — cellular data is not unlimited everywhere. Serve different quality levels based on connection speed if possible.