HTML <audio> Tag
Description
The <audio> tag is used to embed sound content into a web page, such as music, podcasts, voice recordings, or sound effects. It allows audio to be played directly in the browser without relying on third-party plugins or external media players, making it a modern and accessible solution for handling audio content on the web.
The <audio> element supports multiple audio formats, including MP3, WAV, and OGG. To improve browser compatibility, multiple <source> elements can be nested inside the <audio> tag. The browser will automatically select the first supported format, ensuring consistent playback across different devices and browsers.
Built-in controls can be displayed using the controls attribute, allowing users to play, pause, adjust volume, and seek through the audio track. Additional attributes such as autoplay, loop, muted, and preload give developers control over how and when the audio plays. For example, audio can be set to start automatically, repeat continuously, or load only when needed to improve page performance.
The <audio> element can also be styled using CSS and controlled programmatically with JavaScript, making it suitable for custom media players and interactive user experiences. It integrates well with accessibility tools and supports fallback text, which is displayed if the browser does not support the audio element.
Properties
Example
Attributes
- autoplay
- Specifies that the audio will start playing as soon as it is ready.
- controls
- Specifies that audio controls should be displayed (such as a play/pause button, etc.).
- loop
- Specifies that the audio will start over again every time it is finished.
- muted
- Specifies that the audio output should be muted.
- preload
- Specifies if and how the author thinks the audio should be loaded when the page loads.
- src
- Specifies the location of the audio file. Its value must be the URI of an audio file.
Global Attributes
The <audio> tag also supports the Global Attributes in HTML5
Event Attributes
The <audio> tag also supports the Event Attributes in HTML5
Browser Support
The following information will show you the current browser support for the HTML <audio> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.
This tag is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 26th December 2025
