HTML Tags

HTML <track> Tag

The <track> tag is used to add text tracks (like subtitles, captions, descriptions, or chapters) to <video> and <audio> elements.
It improves accessibility by providing text alternatives for users who are deaf, hard of hearing, or non-native speakers.

Syntax

<track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English">

Attributes

AttributeDescriptionExample
srcSpecifies the URL of the track file (usually a .vtt file).src="captions.vtt"
kindDefines the type of text track: subtitles, captions, descriptions, chapters, metadata.kind="subtitles"
srclangSpecifies the language of the track text (ISO language code).srclang="en"
labelProvides a title for the track (shown to users).label="English Subtitles"
defaultMarks the track as the default one when multiple tracks are available.default

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Track Tag Example</title>
</head>
<body>
  <h2>Example: Adding Subtitles to a Video</h2>

  <video width="640" height="360" controls>
    <source src="/samples/sample_video.mp4" type="video/mp4">
    <track src="/samples/hindi_subtitles.vtt" kind="subtitles" srclang="hi" label="Hindi" default>
    <track src="/samples/spanish_subtitles.vtt" kind="subtitles" srclang="es" label="Español">
    Your browser does not support the video tag.
  </video>

</body>
</html>

Output

Browser Output

Displays a video with a subtitles or captions option that can be toggled using the video player’s menu.
Use our Try It Editor to see how subtitle files appear while the video plays.

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

The <track> element is supported in all modern browsers (from IE10+ for full functionality).
Older browsers may ignore subtitle tracks or not display them in the video controls.
To switch between the subtitles click on three vertical dots at bottom right of the video and then click on CC (captions) and choose the desired subtitle.

Notes

  • The text file used in src must be in WebVTT (.vtt) format.
  • The kind attribute determines the purpose of the track (e.g., subtitles for translation, captions for hearing-impaired users).
  • You can include multiple <track> tags for different languages or purposes.
  • The <track> element is empty, meaning it doesn’t have a closing tag.

Conclusion

The <track> tag enhances accessibility and internationalization in multimedia content.
By including properly formatted caption or subtitle files, you make your videos more inclusive and user-friendly for a global audience.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend