Media
Audio Formats Reference
Audio formats comparison - codecs, quality, compression, browser support, and use cases for MP3, AAC, FLAC, OGG, and more.
Overview
Audio formats fall into three categories: uncompressed (WAV, AIFF), lossless compressed (FLAC, ALAC), and lossy compressed (MP3, AAC, Opus). The choice depends on the balance between file size, audio quality, and compatibility requirements.
Format Comparison
| Format | Type | Quality | File Size | Browser Support | Best For |
|---|---|---|---|---|---|
| MP3 | Lossy | Good | Small | Universal | Music distribution |
| AAC | Lossy | Very good | Small | Universal | Streaming, mobile |
| Opus | Lossy | Excellent | Smallest | Chrome, Firefox, Edge, Safari 16+ | Voice, music, streaming |
| OGG Vorbis | Lossy | Very good | Small | Chrome, Firefox, Edge | Open-source projects |
| FLAC | Lossless | Perfect | Medium | Chrome, Firefox, Edge, Safari 14.1+ | Archival, audiophile |
| WAV | Uncompressed | Perfect | Very large | Universal | Editing, production |
| AIFF | Uncompressed | Perfect | Very large | Safari | Apple production |
| ALAC | Lossless | Perfect | Medium | Safari, iTunes | Apple ecosystem |
| WMA | Lossy/Lossless | Good | Small | Edge | Windows (legacy) |
| WebM Audio | Lossy | Excellent | Small | Chrome, Firefox, Edge | Web streaming |
Detailed Format Breakdown
MP3 (.mp3)
- MIME type:
audio/mpeg - Bitrates: 128-320 kbps (CBR) or VBR
- Sample rates: Up to 48 kHz
- Channels: Stereo, joint stereo, mono
- Most widely supported audio format
- 192 kbps+ recommended for music
- 128 kbps acceptable for speech/podcasts
- Patent-free since 2017
AAC (.aac, .m4a)
- MIME type:
audio/aacoraudio/mp4 - Bitrates: 64-512 kbps
- Sample rates: Up to 96 kHz
- Better quality than MP3 at same bitrate
- Default format for Apple Music, YouTube
- HE-AAC variant for low-bitrate streaming
- Widely supported on mobile devices
Opus (.opus)
- MIME type:
audio/opus - Bitrates: 6-510 kbps
- Sample rates: Up to 48 kHz
- Best quality-to-size ratio of any lossy codec
- Excellent for both speech and music
- Low latency, ideal for real-time communication
- Used by Discord, WhatsApp, and WebRTC
- Royalty-free
OGG Vorbis (.ogg)
- MIME type:
audio/ogg - Bitrates: 45-500 kbps
- Sample rates: Up to 192 kHz
- Open-source alternative to MP3/AAC
- Better quality than MP3 at similar bitrates
- Being superseded by Opus
- Used in gaming (Unity, Unreal)
FLAC (.flac)
- MIME type:
audio/flac - Compression: ~50-60% of original size
- Sample rates: Up to 655 kHz
- Bit depth: Up to 32-bit
- Lossless compression (no quality loss)
- Standard for high-fidelity music distribution
- Open-source format
- Supports embedded metadata and album art
WAV (.wav)
- MIME type:
audio/wav - Encoding: PCM (uncompressed)
- Sample rates: Up to 192 kHz
- Bit depth: 16, 24, or 32-bit
- Industry standard for audio production
- No compression overhead
- Very large file sizes
- CD quality: 16-bit, 44.1 kHz (10 MB/minute)
Bitrate Guide
| Use Case | Recommended Format | Bitrate |
|---|---|---|
| Voice/Podcast | Opus or AAC | 48-96 kbps |
| Music streaming (standard) | AAC or Opus | 128-192 kbps |
| Music streaming (high quality) | AAC or Opus | 256-320 kbps |
| Lossless streaming | FLAC | 800-1400 kbps |
| Audio editing | WAV | 1411+ kbps (uncompressed) |
| Web sound effects | MP3 or Opus | 128 kbps |
| Phone calls / VoIP | Opus | 16-32 kbps |
| Background music (web) | AAC or Opus | 96-128 kbps |
Web Audio Best Practices
<audio controls>
<source src="audio.opus" type="audio/opus" />
<source src="audio.aac" type="audio/aac" />
<source src="audio.mp3" type="audio/mpeg" />
</audio>
- Primary: Serve Opus for best quality at smallest size
- Fallback: AAC for Safari/iOS compatibility
- Legacy fallback: MP3 for universal support
- Preload: Use
preload="none"orpreload="metadata"for performance
Tools
| Tool | Type | Use Case |
|---|---|---|
| FFmpeg | CLI | Universal audio conversion |
| Audacity | GUI | Audio editing and export |
| SoX | CLI | Audio processing and conversion |
| LAME | CLI | MP3 encoding |
| opusenc | CLI | Opus encoding |
| MediaInfo | CLI/GUI | Format inspection and metadata |