Shard Tools

SRT to VTT

Convert SubRip .srt subtitles to WebVTT for the HTML5 video track element.

Maintained by Roshan.

Use SRT to VTT

Turns a SubRip .srt file into WebVTT for HTML5 video. The file is read in this tab and never uploaded.

Renaming the file does not workSRT writes milliseconds after a comma and WebVTT after a period, and WebVTT additionally requires a WEBVTT header line. A player given the wrong one usually shows no subtitles at all rather than an error.

Explore text tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all text tools

About SRT to VTT

If you have attached an .srt file to an HTML5 video track element and seen no captions at all, this is the conversion you need. Browsers implement WebVTT and only WebVTT for the track element; SubRip is not a supported format and is rejected outright rather than partially parsed, which is why the failure is silent. The two formats look almost identical when opened in a text editor, and that resemblance is precisely what makes the problem confusing. Three differences matter. WebVTT requires the literal word WEBVTT as its first line. It separates milliseconds with a period where SubRip uses a comma. And it permits an abbreviated timestamp without an hours field, which SubRip does not. Fixing all three by hand across a few hundred cues is tedious; this page does it in one step.

Work through the input

  1. The file is read as text in this tab. A byte-order mark, which some Windows editors add, is stripped first because it would sit in front of the WEBVTT header and break detection.
  2. Line endings are normalised. Subtitle files frequently travel between operating systems, and a stray carriage return left inside cue text renders as a visible box in some players.
  3. Each block is split into its identifier, timing line and text. Timings are parsed into milliseconds so the output can be regenerated cleanly rather than patched with a find and replace.
  4. Cues are renumbered from one. Gaps or duplicates in the original numbering are common in hand-edited files and are not carried through.
  5. The WEBVTT header is written, timestamps are re-emitted with a period separator and a full hours field, and the text of each cue is preserved exactly.

When srt to vtt is useful

Captions not appearing on an HTML5 video

Check the track element's src. If it points at an .srt file, the browser is ignoring it entirely. Convert to .vtt and serve it with the text/vtt content type.

Subtitles downloaded alongside a video file

Desktop players such as VLC read SubRip happily, so files circulate in that format. Anything played in a browser needs WebVTT instead.

Check the output

Questions about SRT to VTT

Can I just rename the file to .vtt?

No. The extension is not what browsers check. Without the WEBVTT header line the file is rejected, and the comma-separated timestamps would fail to parse even if it were not.

Why do my captions silently not show up?

The track element does not report an unsupported subtitle format as a page error. It simply renders nothing, which makes this one of the harder front-end problems to diagnose.

Will the timings change?

No. They are parsed to milliseconds and written back out identically, only with a period instead of a comma and with the hours field always present.

What happens to bold and italic tags?

They are preserved. WebVTT supports the same basic inline tags, so no information is lost.

Related tools

VTT to SRT

Convert WebVTT captions to SubRip .srt for VLC, editing software and services that require SRT. Runs in your browser.

Text Case Converter

Convert text locally to upper, lower, title, sentence, camel, Pascal, snake, kebab, or constant case without uploading your content.

Word and Character Counter

Count words, visible characters, characters without spaces, lines, sentences, UTF-8 bytes, and estimated reading time locally as you type.