HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
  • Insights
  • Verify Certificate
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials

HTML5andCSS3.org helps developers learn modern frontend skills with practical tutorials, production-ready snippets, and fast web tools built for everyday coding.

Quick Links

  • About Us
  • Contact Us
  • Privacy Policy
  • Copyright
  • Disclaimer

Top Tools

  • Try It Editor
  • JSON Formatter
  • CSS Minifier
  • HTML Minifier
  • Base64 Encoder / Decoder

Contact

  • business@html5andcss3.org
Newsletter

Learn at your own pace, practice with useful tools, and build websites you're proud of.

© 2011-2026 html5andcss3.org. All rights reserved.

How to Use

HTML Tags

HTML Tags

HTML <!DOCTYPE> TagHTML <html> TagHTML <head> TagHTML <title> TagHTML <body> TagHTML <base> TagHTML <link> TagHTML <meta> TagHTML <style> TagHTML <script> TagHTML <h1 to h6> TagHTML <hgroup> TagHTML <p> TagHTML <br> TagHTML <wbr> TagHTML <hr> TagHTML <pre> TagHTML <b> TagHTML <strong> TagHTML <i> TagHTML <em> TagHTML <mark> TagHTML <small> TagHTML <del> TagHTML <ins> TagHTML <sub> TagHTML <sup> TagHTML <u> TagHTML <blockquote> TagHTML <q> TagHTML <cite> TagHTML <abbr> TagHTML <address> TagHTML <bdo> TagHTML <bdi> TagHTML <a> TagHTML <nav> TagHTML <ul> TagsHTML <menu> TagHTML <ol> TagHTML <dl> TagHTML <img> TagHTML <figure> TagHTML <figcaption> TagHTML <audio> TagHTML <video> TagHTML <source> TagHTML <track> TagHTML <embed> TagHTML <object> TagHTML <param> Tag (Obsolete)HTML <picture> TagHTML <canvas> TagHTML <map> TagHTML <area> TagHTML <table> TagHTML <caption> TagHTML <thead> TagHTML <tbody> TagHTML <tfoot> TagHTML <tr> TagHTML <th> TagHTML <td> TagHTML <col> TagHTML <colgroup> TagHTML <form> TagHTML <input> TagHTML <textarea> TagHTML <button> TagHTML <select> TagHTML <selectedcontent> TagHTML <option> TagHTML <optgroup> TagHTML <label> TagHTML <fieldset> TagHTML <legend> TagHTML <datalist> TagHTML <output> TagHTML <meter> TagHTML <progress> TagHTML <header> TagHTML <footer> TagHTML <article> TagHTML <section> TagHTML <aside> TagHTML <main> TagHTML <search> TagHTML <details> TagHTML <summary> TagHTML <dialog> TagHTML <time> TagHTML <noscript> TagHTML <slot> TagsHTML <template> TagHTML <shadow> Tag (Obsolete)HTML <center> TagHTML <font> TagHTML <big> TagHTML <strike> TagHTML <tt> TagHTML <acronym> TagHTML <applet> TagHTML <frame> TagHTML <frameset> TagHTML <noframes> TagHTML <marquee> TagHTML <blink> TagHTML <s> TagHTML <var> TagHTML <kbd> TagHTML <samp> TagHTML <code> TagHTML <dfn> TagHTML <div> TagHTML <span> TagHTML Comment TagHTML <data> TagHTML Ruby Annotations: <ruby>, <rt> and <rp>HTML <svg> TagHTML <basefont> Tag
  1. Home
  2. /
  3. Tutorials
  4. /
  5. HTML Tutorial
  6. /
  7. HTML <track> Tag

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

html

<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

html

<!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 crossorigin="anonymous">
    <source src="https://ik.imagekit.io/html5andcss3/lesson-samples/sample_video.mp4" type="video/mp4">
    <track src="https://ik.imagekit.io/html5andcss3/lesson-samples/hindi_subtitles.vtt" kind="subtitles" srclang="hi" label="Hindi" default>
    <track src="https://ik.imagekit.io/html5andcss3/lesson-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

html

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
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesPartially

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.

PreviousHTML <source> TagNextHTML <embed> Tag