Web Media Standards

SRT vs WebVTT for Web Video: Complete Syntax, Cue Styling, and Streaming Guide

10 min read • Technical Reference & In-Depth Guide

While SubRip (.srt) and Web Video Text Tracks (.vtt) may appear virtually identical at first glance, they were designed for entirely different eras and architectures of digital media. SRT originated as a lightweight software hack for ripping DVD subtitles on desktop computers in the early 2000s, whereas WebVTT was engineered by the W3C and WHATWG specifically for native HTML5 <track> video rendering across modern web browsers, mobile operating systems, and adaptive streaming protocols.

Author Note: SRT and VTT may look similar because both describe subtitle cues with timestamps and text, but they are not interchangeable in every situation. VTT is commonly used for web video and supports features that ordinary SRT files do not represent in the same way. When choosing between them, I consider where the subtitles will be used and which features the target player supports.

1. The Architectural Divergence: Desktop Legacy vs W3C Web Standard

The fundamental distinction between the two formats lies in their governing specifications and target execution environments:

SubRip (.srt)

SubRip has no formal standard body or governing RFC. It evolved informally through open-source software like SubRip, VLC, and Media Player Classic. It is universally accepted by desktop media players, video editing non-linear editors (Premiere Pro, DaVinci Resolve, Final Cut Pro), and video platforms like YouTube and Vimeo for bulk desktop uploads. However, modern web browsers cannot render .srt files natively inside the HTML5 <video> element without heavy third-party JavaScript parsing engines.

WebVTT (.vtt)

WebVTT is formally standardized under the W3C Candidate Recommendation track. It is the only caption format natively understood and rendered by the HTML5 DOM, Safari on iOS and macOS, Chrome on Android, Firefox, Edge, and adaptive HTTP Live Streaming (HLS) and MPEG-DASH caption playlists. It supports bidirectional text, line positioning, CSS styling hooks, and accessibility metadata.

2. The Three Critical Syntactic Differences

If you rename an .srt file to .vtt, modern browsers will reject it immediately. The differences in syntax are subtle but absolute:

Difference A: The Mandatory "WEBVTT" Magic Byte Header

Every valid WebVTT file must begin with the exact ASCII string WEBVTT on the very first line, followed by an optional space and header description, and then a mandatory blank line before the first cue block. An SRT file has no file header whatsoever and begins directly with the numeric cue index 1.

Difference B: Millisecond Decimal Delimiters (Comma vs Dot)

In SRT, the decimal delimiter separating seconds from milliseconds is strictly a comma (00:01:25,500). In WebVTT, the decimal delimiter is strictly a period / dot (00:01:25.500). Providing commas in WebVTT causes browser HTML5 parsers to fail parsing the timestamps completely, dropping the entire cue from display.

Difference C: Cue Identifiers and Optional Hours

In SRT, numeric sequentially incrementing cue numbers (1, 2, 3...) are strictly required before every timestamp line. In WebVTT, cue identifiers are optional string labels. Furthermore, WebVTT permits omitting the hours component if the timecode is under 60 minutes (e.g. 03:14.200 --> 03:18.500), whereas SRT requires full HH:MM:SS,mmm format.

3. Worked Side-by-Side Code Example

Below is the exact same dialogue sequence encoded first as standard SubRip (.srt) and second as standards-compliant WebVTT (.vtt) with positioning settings:

SubRip (.srt) Format
1
00:00:14,200 --> 00:00:17,800
Welcome to the deployment pipeline.
Make sure all unit tests pass.

2
00:00:18,100 --> 00:00:21,450
Warning: Database migration in progress.
WebVTT (.vtt) Format
WEBVTT - Pipeline Onboarding Demo

intro-cue
00:14.200 --> 00:17.800 position:50% line:85%
Welcome to the deployment pipeline.
Make sure all unit tests pass.

migration-alert
00:18.100 --> 00:21.450 align:center
Warning: Database migration in progress.

4. Advanced Cue Positioning & Voice Tagging

One of WebVTT's most significant capabilities is screen coordinate management. In video production, subtitles must avoid covering lower-third graphics, breaking news tickers, or speaker chyrons. WebVTT introduces cue settings directly on the timecode line:

  • line:10% or line:85%: Places the subtitle text at the top (10%) or bottom (85%) of the video frame to prevent visual clutter.
  • position:20% align:left: Pins subtitles to the left side of the screen when two distinct speakers talk simultaneously.
  • size:50%: Restricts the text box width to 50% of the video canvas to prevent long lines from stretching edge-to-edge.
  • <v SpeakerName>...</v>: Assigns a voice identifier to dialogue cues for screen readers and assistive technology.

5. Cue Styling: WebVTT CSS Integration vs SRT Limitations

While SRT relies on crude legacy pseudo-HTML tags (<b>, <i>, <font color="#FF0000">) that many modern players simply ignore or strip, WebVTT can be styled directly from your website's CSS stylesheet using the ::cue pseudo-element:

/* Modern WebVTT Cue Styling in CSS */

video::cue {

background-color: rgba(2, 6, 23, 0.85);

color: #f8fafc;

font-family: 'Inter', -apple-system, sans-serif;

font-size: 1.1rem;

border-radius: 6px;

padding: 4px 10px;

}

video::cue(v[voice="System"]) {

color: #fbbf24;

}

6. Delivering WebVTT in HLS and DASH Streaming Protocols

In modern HTTP Live Streaming (HLS) architecture, subtitle tracks are delivered alongside video and audio representations inside the HLS master playlist (master.m3u8). Apple's HLS specification strictly requires WebVTT captions delivered as segmented media files:

# In HLS master.m3u8:

#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="en",URI="subtitles_en.m3u8"

Each segmented WebVTT playlist (subtitles_en.m3u8) references short 6-second WebVTT cue chunks with synchronized X-TIMESTAMP-MAP headers that lock the subtitle wall-clock time directly to the video stream's MPEG-2 Transport Stream (TS) or fragmented MP4 (fMP4) Presentation Time Stamp (PTS). Attempting to use SRT inside an HLS streaming pipeline will break compatibility across iOS Safari and smart TV hardware.

7. Common Mistakes in Web Video Captioning

Mistake 1: Missing MIME Type in Web Server Configuration

Even if your WebVTT file is syntactically pristine, Apache, Nginx, or cloud storage buckets (Amazon S3, Google Cloud Storage, Cloudflare R2) will often serve it as text/plain or application/octet-stream. Browsers strictly require Content-Type: text/vtt; otherwise, the <track> element will silently fail to load.

Mistake 2: Missing Cross-Origin Attributes (CORS)

When your .vtt file is hosted on a CDN (e.g., cdn.example.com) while the webpage is on www.example.com, the browser will block the subtitle track under the Same-Origin Policy unless you specify <video crossorigin="anonymous"> and your CDN returns Access-Control-Allow-Origin: *.

Mistake 3: Overlapping Cue Timecodes

If Cue A ends at 00:10.500 and Cue B starts at 00:10.200, some HTML5 video players will stack both cues vertically, while older smart TV browsers will drop Cue B entirely. Always sanitize your subtitles with an editor to remove overlapping millisecond intervals.

8. Conversion Tools on Black Claaw

When preparing video assets across web and desktop workflows, convert seamlessly between formats using our free client-side converters:

Have feedback or questions on this guide?

Our engineering guides are continually refined with real production feedback.

Contact Technical Desk