HTML Audio Generator
Configure an HTML5 <audio> element — sources, playback controls, and preload — and copy the ready-to-use HTML.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML Audio Generator?
The HTML `<audio>` element embeds an audio player in a web page. Multiple `<source>` child elements let you specify the same audio file in different formats; the browser plays the first one it supports. Common format order is MP3 (widest support), then OGG Vorbis, then WAV.
Key attributes: `controls` shows the browser's native playback bar; `autoplay` starts playback immediately (browsers may block this without user interaction); `loop` repeats the track; `muted` starts silenced; `preload` hints how much audio data to fetch before the user presses play.
How to Use HTML Audio Generator
Enter the audio source URL and choose its MIME type (MP3, OGG, WAV)
Add additional sources for cross-browser compatibility
Set the preload strategy
Toggle controls, autoplay, loop, and muted
Copy the generated HTML
Common Use Cases
- Embedding background music or sound effects in a web page.
- Adding podcast audio without a third-party player.
- Generating cross-browser audio markup with multiple source formats.
Example Input and Output
An audio player with MP3 and OGG sources and controls.
Sources: audio.mp3 (audio/mpeg), audio.ogg (audio/ogg)
Controls: true, Preload: metadata<audio preload="metadata" controls>
<source src="audio.mp3" type="audio/mpeg">
<source src="audio.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>Privacy
All HTML generation runs in your browser. No data is sent to any server.

