Best Audio Format for Websites
Choose the right audio format for your website. Covers browser support, file size, and loading performance.
# Best Audio Format for Websites
Audio on the web needs to be small, fast, and playable on every browser. Get the format wrong and your users hear nothing. Get it right and audio enhances the experience.
Browser Support in 2026
Here's what works:
- MP3 -- All browsers. Universal.
- AAC -- All browsers. Universal.
- OGG Vorbis -- Chrome, Firefox, Edge. Not Safari.
- Opus -- Chrome, Firefox, Edge. Not Safari.
- WAV -- All browsers. But files are huge.
- FLAC -- Chrome, Firefox, Edge. Not Safari.
MP3 and AAC are the safe bets. They play everywhere without fallbacks.
The Best Strategy
Serve MP3. It works in every browser, plays on every device, and offers good compression. For most websites, MP3 is the right answer.
Convert WAV to MP3 and encode at 128-192 kbps for background music. For sound effects, 128 kbps is fine.
Want better compression? Use the HTML5 audio element with multiple sources:
```html ```
The browser picks the first format it supports. Chrome and Firefox get the OGG file (smaller and better quality). Safari gets the MP3 fallback.
Preparing Audio for Web
Step 1: Start with the Best Source
Use your original WAV or FLAC files. Never encode from an already-compressed source if you can avoid it.Step 2: Create Your Formats
Convert WAV to MP3 for the primary format. Convert WAV to OGG for the optional high-efficiency version. If you only have MP3 sources, convert MP3 to OGG -- though starting from lossless is always better.- Background ambient: 96 kbps
- Music: 128-192 kbps
- Sound effects: 96-128 kbps
- Voice narration: 64-96 kbps mono
Step 3: Optimize Bitrate
Match bitrate to content:Step 4: Consider Mono
Most web audio doesn't need stereo. Notification sounds, UI effects, and voice clips work perfectly in mono at half the file size.File Size Guidelines
Page load speed matters. Every kilobyte counts. Here are sensible targets:
- UI sound effect: Under 50 KB
- Short clip (5 seconds): Under 100 KB
- Voice snippet (30 seconds): Under 300 KB
- Background music loop: Under 500 KB for the loop segment
If your audio exceeds these, reduce bitrate or clip length.
Preloading and Lazy Loading
Don't load audio files until they're needed. Use `preload="none"` for audio that plays on user interaction. Use `preload="auto"` only for audio that plays immediately.
For background music, consider streaming. Load a small buffer and play while the rest downloads. This prevents a long initial wait.
Audio Sprites
If your page has many short sound effects, combine them into a single file. Play different sections using the Web Audio API. One HTTP request instead of twenty. The page loads faster.
Compression Tips
- Trim silence from the beginning and end of clips
- Use mono for non-musical audio
- Match bitrate to content type
- Consider lower sample rates for speech (22.05 kHz)
- Loop short segments instead of long tracks
The Bottom Line
For most websites: MP3 at 128 kbps. It's compatible, efficient, and sounds good. Add OGG as a progressive enhancement if you want smaller files for supporting browsers. Keep your source files in WAV or FLAC so you can re-encode later if standards change.