VTT (file format)
By WHATWG
VTT, formally WebVTT or Web Video Text Tracks, is a plain-text file format for displaying timed text such as subtitles, captions, and chapter markers alongside audio and video on the web. It defines cue blocks with start and end timestamps…
Definition
VTT, formally WebVTT or Web Video Text Tracks, is a plain-text file format for displaying timed text such as subtitles, captions, and chapter markers alongside audio and video on the web. It defines cue blocks with start and end timestamps and associated text, which browsers and media players use to show synchronized captions as a video plays, and it is the caption format natively supported by the HTML5 track element across modern browsers.
Overview
As HTML5 introduced native audio and video elements, browsers needed a standard way to attach captions and subtitles without relying on proprietary plugins like Flash, which had previously handled such overlays inconsistently across sites. WebVTT was developed as part of the HTML5 specification effort to give the track element a simple, human-readable format for timed text that any browser could parse the same way. Mechanically, a WebVTT file begins with the literal header WEBVTT followed by a series of cues, each specifying a start and end time in hours, minutes, seconds, and milliseconds separated by an arrow, with the caption text on the following line or lines. Cues can include optional identifiers, positioning and alignment settings, and a limited set of styling markup, and files can also define non-visual metadata regions or style blocks that apply CSS-like formatting to captions. Browsers render these cues over the video at the appropriate timestamps as the associated track element's source attribute points to the VTT file. WebVTT descends conceptually from the older SubRip subtitle format but adds a formal specification, styling and positioning hooks, and native browser and HTML integration that SubRip lacks. Compared to embedding captions directly into a video's pixels, so-called burned-in subtitles, WebVTT keeps text as data, allowing it to be searched, translated, resized, toggled on and off, and repositioned by the browser or player rather than fixed at encoding time. In practice, WebVTT is the caption format used by the HTML5 track element across major browsers and is also accepted by many video hosting and streaming platforms for subtitles and closed captions, as well as for chapter navigation markers within a video. Accessibility and localization workflows commonly produce multiple WebVTT files per video, one for each supported language. Limitations include relatively basic styling capabilities compared to more elaborate subtitle formats used in broadcast or disc production, and the format's reliance on plain-text timestamps means encoding errors or mismatched timing can silently produce captions that drift out of sync with the underlying media. It also depends on the host page or player correctly wiring up the track element, so a technically valid WebVTT file will not display captions if the surrounding markup is misconfigured. Content teams producing captions at scale typically rely on dedicated authoring or transcription tools to generate WebVTT files automatically, since hand-writing precise timestamps for long-form video is time-consuming and error-prone when done manually by a human editor.
Specification
- Plain-text cue blocks with start and end timestamps
- Native integration with the HTML5 track element
- Optional cue identifiers, positioning, and alignment settings
- Support for style blocks applying CSS-like caption formatting
- Use for both subtitle captions and video chapter markers
- Human-readable format that is easy to author and edit manually
- Wide adoption across browsers and video hosting platforms
Use Cases
Alternatives
Frequently Asked Questions
From the Blog
Python File I/O: Reading and Writing Files
Almost every real Python program reads or writes files — logs, configs, CSVs, JSON, reports. This guide covers text files, CSV, JSON, binary files, and the modern pathlib approach, with best practices for safe file handling.
Read More ProgrammingPython File Handling: Read and Write Files
Learn to read and write files in Python using open() and the with statement. Covers text and binary modes, reading line by line, appending, and safe file handling.
Read More ProgrammingUnderstanding Python String Formatting (f-strings)
F-strings are the fastest, most readable way to format strings in Python. Learn how to embed variables, format numbers, align text, and debug with f-string syntax.
Read More ProgrammingUnderstanding Python Modules and Packages
A Python module is a single .py file and a package is a folder of modules. Learn how imports, __init__.py, and namespaces organize larger Python projects.
Read More