The <track> element adds a timed text track (usually a WebVTT .vtt file) to <video> or <audio> — for example subtitles or closed captions shown with the media.
Set kind, src, srclang, and label so the player can list the track. Optional default enables that track when appropriate. You can nest several <track> elements for different languages or kinds.
Baseline · Widely available.
Not deprecated. Stable across browsers since about July 2015.
Void element.
<track> has no end tag and no children. It only points at an external .vtt file via src.
Same-origin src.
The track URL must be same-origin as the page unless the parent video/audio uses crossorigin.
Only one track on a media element should carry default.
How It Works
Add the boolean default with no value (or default="").
Use it on one track only per video/audio.
The UA may still override based on user caption preferences.
Users can always switch via the player track menu when multiple tracks exist.
Edge Cases & Pitfalls
Most track failures are missing VTT files, wrong origin, or incomplete attributes.
format
Use WebVTT (.vtt)
Point src at a valid WebVTT file. Other subtitle formats are not what <track> expects in HTML.
origin
Same origin unless CORS is set
Cross-origin track files need crossorigin on the media parent and correct CORS headers on the VTT host.
srclang
Required for subtitles
When kind="subtitles", include a valid srclang. Invalid kind values are treated as metadata.
unique
No duplicate kind + language + label
A media element must not have two tracks with the same kind, srclang, and label. Also use only one default.
Compatibility
Browser Support
The <track> element is core HTML for media text tracks. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<track>
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support WebVTT tracks on video and audio; UI for enabling captions varies by player.
95%Global support (approx.)
Google Chrome23+
Full support
Mozilla Firefox31+
Full support
Apple Safari6+
Full support
Microsoft Edge12+
Full support
Opera12.1+
Full support
Samsung InternetAll modern
Full support
Internet Explorer10+
Supported
<track>Widely supported
Bottom line: Safe for production captions and subtitles. Ship valid .vtt files, set kind/srclang/label, and test the player’s CC menu.
Remember
Key Takeaways
Role:<track> links a WebVTT file to video or audio.
Must-haves:src, useful kind, and srclang for subtitles.
Rules: void element; one default; same-origin (or CORS) for src.
One line: nest <track src="file.vtt" kind="…" srclang="…" label="…"> inside your media element.
UA style
Default CSS Settings
track is a void metadata child of media — it has no box of its own in the layout. Cue appearance is controlled by the media player and optional ::cue CSS:
default.css
track {
display: none; /* not a visible box; cues render via the media UI */
}
video::cue {
/* optional: style displayed cue text when supported */
}
Exact caption styling and menus differ by browser. Always test the CC control on real devices.
Frequently Asked Questions
The track element adds a timed text file (usually WebVTT) to a video or audio element — subtitles, captions, descriptions, chapters, or metadata.
WebVTT (.vtt). Point the src attribute at a .vtt file that contains timed cues.
Subtitles translate or transcribe dialogue when sound is available but not understood. Captions also include important non-speech audio (effects, music cues) for when sound is missing or hard to hear.
Yes when kind is subtitles. It must be a valid BCP 47 language tag such as en or es.
No. Only one track per media element may have the default attribute.
No. It is Baseline and widely available. Prefer it for accessible timed text on HTML media.