Audio MIME Types — MP3, WAV, OGG, FLAC, and More
A complete guide to audio MIME types for web applications, covering audio/mpeg, audio/wav, audio/ogg, and modern codecs like Opus.
Best Practices
Detailed Explanation
Audio MIME Types for the Web
Web applications that play, record, or stream audio need to serve files with the correct MIME type for reliable playback across browsers.
Common Audio MIME Types
| MIME Type | Extension | Codec | Lossy/Lossless |
|---|---|---|---|
audio/mpeg |
.mp3 | MPEG Layer 3 | Lossy |
audio/wav |
.wav | PCM | Lossless |
audio/ogg |
.ogg, .oga | Vorbis | Lossy |
audio/webm |
.weba | Opus/Vorbis | Lossy |
audio/aac |
.aac | AAC | Lossy |
audio/flac |
.flac | FLAC | Lossless |
audio/opus |
.opus | Opus | Lossy |
audio/mp4 |
.m4a | AAC/ALAC | Both |
HTML5 Audio with Fallbacks
<audio controls>
<source src="song.opus" type="audio/opus" />
<source src="song.ogg" type="audio/ogg; codecs=vorbis" />
<source src="song.mp3" type="audio/mpeg" />
</audio>
Opus — The Best Web Audio Codec
Opus is an open codec that outperforms MP3 and AAC at all bitrates:
- Low latency (5 ms)
- Wide bitrate range (6 kbps to 510 kbps)
- Speech and music optimized
- Browser support: Chrome, Firefox, Edge, Safari 17+
Choosing the Right Format
| Use Case | Recommended Format |
|---|---|
| Music streaming | Opus or AAC |
| Podcast distribution | MP3 (universal support) |
| Sound effects in games | WebM (Opus) |
| Archival / production | FLAC or WAV |
| Voice chat / VoIP | Opus |
Use Case
Reference this guide when building audio players, podcast platforms, or music streaming applications. Use audio/mpeg (MP3) for maximum compatibility and audio/opus for the best quality-to-size ratio in modern browsers.