WebVTT (Web Video Text Tracks, file extension .vtt) is the caption format of the web. The HTML5 track element, which attaches subtitles to a video tag, only accepts WebVTT in browsers, so a site, a custom player or a learning platform built on standard HTML5 video needs a .vtt file even when your translator delivered an .srt.
The format grew out of SRT, so the two look almost the same. A WebVTT file must start with the word WEBVTT on its first line, and its times use a dot before the milliseconds (00:01:02.345) where SRT uses a comma (00:01:02,345). The number above each SRT block becomes an optional cue identifier.
WebVTT goes further than SRT. Cue settings after the time line control placement (line, position, align, size). A STYLE block or the page's CSS can style captions through the ::cue selector, and the format adds NOTE comments, regions, speaker voices and classes. SRT has none of that officially; players simply tolerate font tags and {\an8}-style codes borrowed from other formats.
filetidy keeps italic, bold and underline tags, which WebVTT supports. Font colour and face tags are dropped because WebVTT has no font tag. Position codes {\an1} to {\an9} become real cue settings, so a line marked {\an8} still shows at the top of the frame. Other {\…} codes are removed, and & or stray angle brackets in the text are escaped as the format requires.
- Full name
- WebVTT: The Web Video Text Tracks Format
- Specification
- W3C, first drafted at WHATWG in 2010 under the name WebSRT
- Extension and MIME type
- .vtt, text/vtt
- Text encoding
- UTF-8 only (filetidy always writes UTF-8)
- Time format
- 00:01:02.345, with a dot; hours are optional
- Used by
- HTML5 video in every modern browser, most web video players and course platforms