Subtitle Converter (SRT ↔ VTT), Explained
After reading this you will understand exactly what separates a SubRip file from a WebVTT file, how to convert between them without breaking timing, and which small formatting details cause players to reject subtitles.
What the two formats are
SubRip (.srt) and WebVTT (.vtt) are both plain text subtitle formats. Each stores a list of cues. A cue has a start time, an end time, and one or more lines of text that show during that window. Open either file in a text editor and you can read it directly.
Here is the same cue in both formats. SRT first:
200:01:02,500 --> 00:01:05,000Keep your hands inside the vehicle.
Now WebVTT:
00:01:02.500 --> 00:01:05.000Keep your hands inside the vehicle.
Three differences do all the work. SRT uses a comma before the milliseconds (02,500); WebVTT uses a dot (02.500). SRT numbers each cue on its own line; WebVTT makes that number optional. And a WebVTT file must begin with the line WEBVTT. Get those three right and the conversion is essentially a text substitution.
When to convert, and when not to
Convert to WebVTT when you serve video on the web. The HTML <track> element only accepts WebVTT, so a browser playing an <video> tag will ignore a raw .srt file. Convert to SRT when a desktop player, an encoder, or an editing tool expects SubRip, which remains the most widely accepted format for local playback and for muxing into containers like MKV.
Do not convert if the target already accepts what you have. VLC, mpv, and most set-top players read both. Converting a file that already works only risks introducing a formatting error. Convert when a specific tool refuses the file, not out of habit.
WebVTT can carry styling and positioning that SRT cannot, such as line: and position: settings on the timestamp row, plus cue classes and a styling block. Converting VTT to SRT drops those extras because SRT has nowhere to put them. The text and timing survive; the layout hints do not.
The conversion rules in full
There is no arithmetic here, only a fixed set of transformations applied to each line. Going from SRT to VTT:
- Add the header line
WEBVTTfollowed by one blank line at the top. - On every timestamp line, replace the comma before the milliseconds with a dot. Do this for both the start and the end time.
- Keep the
-->arrow and the text exactly as they are. - Cue numbers may stay or be removed; both are valid WebVTT.
Going from VTT to SRT reverses the first two steps and adds one more:
- Remove the
WEBVTTheader and any styling blocks (STYLE,NOTE,REGION). - Replace the dot before the milliseconds with a comma on every timestamp line.
- Number the cues sequentially starting at
1, because SRT requires an index line and some players fail without it. - Strip any WebVTT cue settings after the end timestamp, since SRT does not understand them.
Why the blank line matters
Both formats separate one cue from the next with a single blank line. That blank line is not decoration. It is the delimiter the parser uses to decide where one cue ends. If two cues run together with no blank line between them, a strict parser reads the second cue's index and timestamp as if they were part of the first cue's text.
Count the newlines in a well-formed cue block. A cue in SRT is: index line, timestamp line, one or more text lines, then exactly one empty line. If a file was edited by hand and someone deleted a blank line, or added a second one, the cue count can shift. The converter normalizes this: it collapses runs of blank lines to a single separator and guarantees one blank line between cues.
A trailing space on an otherwise blank line makes it non-empty. Many parsers then treat it as text, not a separator, and the two neighboring cues merge. If subtitles suddenly show two lines at once after an edit, check for whitespace on the blank lines first.
Worked example: converting the demo file
The demo loads a short three-cue SRT file. Here it is in full:
100:00:01,000 --> 00:00:03,000Welcome aboard.200:01:02,500 --> 00:01:05,000Keep your hands inside the vehicle.300:02:10,250 --> 00:02:13,750Enjoy the ride.
- Prepend
WEBVTTand a blank line. - Rewrite each timestamp:
00:00:01,000becomes00:00:01.000,00:01:02,500becomes00:01:02.500,00:02:10,250becomes00:02:10.250, and the three end times change the same way. - Leave the cue numbers and text untouched.
The result is:
WEBVTT100:00:01.000 --> 00:00:03.000Welcome aboard.200:01:02.500 --> 00:01:05.000Keep your hands inside the vehicle.300:02:10.250 --> 00:02:13.750Enjoy the ride.
Six commas became six dots, one header line appeared, and nothing else moved. Every character of text and every digit of timing is identical. That invariance is the whole point: a correct conversion should leave the displayed subtitles byte-for-byte the same on screen.
Reading a timestamp precisely
A timestamp is hours, minutes, seconds, and milliseconds. To sanity-check that a conversion preserved timing, convert a timestamp to a single number of milliseconds and compare before and after.
Here h is hours, m is minutes, s is seconds, and ms is the millisecond field. For the demo's second cue start, 00:01:02,500, that is 0 + 62000 + 500 = 62500 milliseconds. The WebVTT version 00:01:02.500 gives the same 62500. If the two numbers match, the punctuation swap changed nothing about when the cue appears.
Common mistakes
The three failures below account for most rejected files.
- Missing WEBVTT header
- A
.vttfile without theWEBVTTfirst line is not valid WebVTT. Browsers silently show no captions. Renaming an.srtto.vttdoes not add the header, so the rename alone never works. - Wrong separator
- A comma in a VTT timestamp (
00:01:02,500) or a dot in an SRT timestamp (00:01:02.500) causes strict parsers to skip the cue. The text before and after may still show, so the symptom is missing captions in the middle of a file. - Encoding and byte order marks
- A UTF-8 byte order mark placed before
WEBVTTpushes the header out of first position for some parsers. Save as UTF-8 without a BOM. Accented characters that appear as garbage usually mean the file was saved as a legacy code page rather than UTF-8.
Related tools
Conversion changes the format, not the timing. If the subtitles are correctly formatted but appear early or late against the video, that is a timing problem, not a format problem. Use the Subtitle Shifter to move every cue earlier or later by a fixed offset, then convert if you also need to change format.
Frequently asked questions
Can I just rename a .srt file to .vtt?
No. A rename does not add the WEBVTT header or change the comma before the milliseconds to a dot. A browser will load the file and show nothing. Run the actual conversion.
Does converting lose any text?
No text is lost in either direction. Going from VTT to SRT drops styling and positioning settings, because SRT cannot represent them, but every word and every timestamp is preserved.
Why do my captions show two lines at once after editing?
The blank line between two cues was removed, or it has a stray space that makes it non-empty. The parser then merges the cues. Restore a single truly empty line between them.
Are the cue numbers required?
SRT requires a numeric index on its own line before each cue. WebVTT treats the number as optional. When converting VTT to SRT, the numbers are added automatically starting at 1.
Is my file uploaded anywhere?
No. The conversion runs entirely in your browser, so the file never leaves your machine.