WebVTT is the subtitle format of the web: the HTML5 <track> element reads it directly. A file starts with the line WEBVTT, timings put a full stop before the milliseconds (00:00:01.500), and each timing line can carry cue settings for position and alignment. A file may also contain STYLE blocks, REGION blocks and NOTE comments, and cue text can mark the speaker with <v> or apply a style class with <c>.
What is converted
- The text of every cue. Phrases split by
<b>,<c>or karaoke timestamps are still converted as phrases. - The content of NOTE comments.
- Speaker names:
<v 张三>becomes<v 張三>(optional, on by default).
What stays the same
- The
WEBVTTheader and the STYLE and REGION blocks. - Timings and cue settings, the tags themselves, and karaoke timestamps such as
<00:00:01.500>. In the examples below, the class name in<c.yellow>and the timestamps between words are unchanged, while 出发 between them still becomes 出發.
Garbled subtitles and player support
The WebVTT standard says files must be UTF-8, so a .vtt saved as GBK or Big5 shows up as mojibake in the browser. The converter detects the original encoding and always writes UTF-8, which browsers, VLC, mpv and IINA display correctly. Line endings stay as they were, and the BOM follows the original file unless you change it.
Conversion examples
| Original | Result |
|---|---|
| 我们的软件更新了。 | 我們的軟件更新了。 |
| <v 张三>他把头发剪短了。</v> | <v 張三>他把頭髮剪短了。</v> |
| <c.yellow>台风过后</c>,天气转晴。 | <c.yellow>颱風過後</c>,天氣轉晴。 |
| 我们<00:00:01.500><c>一起</c><00:00:02.000><c>出发</c> | 我們<00:00:01.500><c>一起</c><00:00:02.000><c>出發</c> |
| <b>注意</b>:后台正在更新。 | <b>注意</b>:後臺正在更新。 |
Real output from OpenCC (s2t).
How to use
- Drop .vtt files onto the page, or click Choose files. You can add several at once.
- Choose the direction and standard. Leave Auto on if you are not sure whether the subtitles are Simplified or Traditional.
- If needed, open Advanced options by format and decide whether speaker names should be converted.
- Check the preview on the card, then download the file and use it in place of the original.
Things to check
- Speaker names are converted by default. If the STYLE block styles a voice by name, as in ::cue(v[voice="张三"]), the converted name no longer matches and the style stops working. In that case turn off “VTT: convert speaker names (<v 张三>)”.
- Short cues give OpenCC little context. In a cooking class, 把面下到锅里 (put the noodles in the pot) keeps 面, where 麪 is right. In the Text tab that 面 is marked Needs review, so paste important lines there to check them.
- With Taiwan or Hong Kong selected and Convert regional terms on, words are replaced with local ones. Programming courses change the most: under the Taiwan standard 代码 (code) becomes 程式碼, 函数 (function) becomes 函式 and 变量 (variable) becomes 變數. Check the terminology after converting.
FAQ
Why were Chinese class names in STYLE not converted?
Selectors in the STYLE block have to match the class names in the cue tags. Both the tags and the STYLE block are kept as they are, so the styles keep working.
Do timings or positions change?
No. Timings, cue settings such as align and position, and karaoke timestamps are all kept byte for byte.
The browser shows my VTT subtitles as garbled text. Why?
WebVTT requires UTF-8, so a GBK or Big5 file is garbled in the browser. Downloads from here are always UTF-8. If the preview on the card is already garbled, change the encoding on the card first.
Will the converted file still work in an HTML5 <track>?
Yes. The header, cue settings and STYLE blocks are unchanged and the file is UTF-8, so you can point the <track> element at it instead of the original. Only its srclang attribute is up to you, for example zh-Hant for Traditional.
Can I convert the captions of a whole course at once?
Yes. Add up to 50 files at a time, each up to 20 MB, and Download all (ZIP) gives you every converted file in one archive.