Subtitle guide Format comparisons

Best subtitle format for HTML5 video

Updated

TL;DR — Find out why WebVTT is the standard for HTML5 video. Convert SRT or ASS for browser compatibility. Free tools and step-by-step setup guide included.

Related tool

SRT to VTT Converter

Open SRT to VTT

For HTML5 video, WebVTT (VTT) is usually the safest default. The native <track> element expects browser-friendly caption files, and in practice, that means WebVTT. If your source file comes from a transcription tool as SRT or from a subtitle editor as ASS, convert a final delivery copy to VTT before testing it in the browser.

Quick answer

Use WebVTT (VTT) for HTML5 video captions. If your source subtitles are in SRT or ASS, convert them to VTT before adding them to the <track> element.

Use the HTML5 Video Subtitle Converter to create VTT output from SRT or ASS input.

Why VTT works best for HTML5 video

WebVTT is the W3C standard for HTML5 video captions. It’s designed specifically for web playback and offers several advantages:

  • Browser-native support: All modern browsers (Chrome, Firefox, Safari, Edge) have built-in WebVTT parsers
  • WEBVTT header: The WEBVTT header signals to the browser that the file is a valid caption track
  • Dot-based timestamps: 00:00:01.000 (dots) match JavaScript time formats, unlike SRT’s comma-based 00:00:01,000
  • Advanced features: WebVTT supports cue settings (alignment, position, size), styling, chapters, and metadata
  • Better debugging: If the VTT file is valid, caption issues are more likely to come from the player setup or server configuration, not the subtitle format

VTT also avoids a common handoff problem: developers can attach it directly to a video element, while editors can still keep SRT or ASS as the working format before export.

HTML5 video subtitle support by format

FormatBrowser SupportNative <track>Notes
VTT✅ All browsers✅ YesRecommended, W3C standard
SRT❌ Not native❌ NoNeeds conversion to VTT
ASS/SSA❌ Not native❌ NoNeeds conversion to VTT

Key takeaway: Only WebVTT works natively with HTML5 <track> elements. SRT and ASS require conversion.

Why SRT still shows up

SRT is still common because many subtitle tools export it first:

  • Transcription services: Rev, Otter, Descript, and most transcription tools export SRT by default
  • Legacy subtitle archives: Old subtitle files from DVD rips, fansubs, or older projects
  • Subtitle editors: Aegisub, Subtitle Edit, and other editors often default to SRT
  • Handoffs from collaborators: Translators, editors, or clients may send SRT files

That means web workflows often need a conversion step before final playback. For a format comparison, see SRT vs VTT. If that’s your case, go straight to How to convert SRT to VTT for HTML5 video.

Do not paste raw SRT into an HTML5 track and expect every browser or player wrapper to repair it. SRT uses comma milliseconds (00:00:01,000) and does not include the WEBVTT header. Those differences are small, but they’re enough to break strict WebVTT parsers.

Where ASS fits

ASS (Advanced SubStation Alpha) is useful while editing, especially for:

  • Anime fansubs: Advanced styling, positioning, karaoke effects
  • Styled captions: Custom fonts, colors, borders, shadows
  • Sign translations: Positioned text that matches on-screen signs

But ASS is usually not the final browser delivery format. If your source subtitles are ASS, converting to VTT is often the cleanest web step.

What you lose: Advanced styling (colors, fonts, positioning, karaoke effects). WebVTT supports basic cue settings (alignment, position) but not ASS-level styling.

What you gain: Browser compatibility, faster rendering, easier debugging.

Treat the VTT file as a delivery output, not as a perfect styled replica. If visual subtitle styling matters, test the result in the exact player and CSS environment that will ship.

Practical workflow

Scenario 1: You have SRT subtitles

  1. Keep the source SRT file if you may need to edit it later
  2. Convert to VTT using the SRT to VTT Converter
  3. Validate the VTT file with the WebVTT Validator
  4. Upload the VTT file to your web server or CDN
  5. Add the VTT file to your HTML5 video:
<video controls>
  <source src="video.mp4" type="video/mp4" />
  <track kind="subtitles" src="captions.en.vtt" srclang="en" label="English" default />
</video>
  1. Test playback in the browser and verify captions appear

What changes: Timestamp format (commas → dots), file header added (WEBVTT). Text content stays the same.

Scenario 2: You have ASS subtitles (anime, fansubs, styled captions)

  1. Convert ASS to VTT using the ASS to VTT Converter
  2. Validate the VTT file
  3. Upload and test

What you lose: Advanced styling. What you gain: Browser compatibility.

Scenario 3: You have multiple subtitle languages

Add multiple <track> elements with different srclang and label attributes:

<video controls>
  <source src="video.mp4" type="video/mp4" />
  <track kind="subtitles" src="captions.en.vtt" srclang="en" label="English" default />
  <track kind="subtitles" src="captions.es.vtt" srclang="es" label="Español" />
  <track kind="subtitles" src="captions.fr.vtt" srclang="fr" label="Français" />
</video>

The browser automatically detects all tracks and displays them in the captions menu.

Scenario 4: You need to serve VTT from a CDN

If your VTT file is on a different domain than the video page, configure CORS:

Server-side (CDN or origin server):

Access-Control-Allow-Origin: https://yourdomain.com
Content-Type: text/vtt; charset=utf-8

Client-side (HTML):

<video controls crossorigin="anonymous">
  <source src="video.mp4" type="video/mp4" />
  <track src="https://cdn.example.com/captions.en.vtt" srclang="en" label="English" />
</video>

Without both, the browser blocks the VTT request and captions fail silently.

Browser playback checklist

Before adding captions to HTML5 video, check:

  • Format: Use a .vtt file for browser playback
  • Header: File begins with WEBVTT (uppercase, first line)
  • Timestamps: Use dots (00:00:01.000), not commas (00:00:01,000)
  • Encoding: Use UTF-8 encoding to avoid character corruption
  • URL: Serve the caption file from a URL the page can request (not a local file path)
  • CORS: If the VTT file is on a different domain, the server must send Access-Control-Allow-Origin headers
  • MIME type: Server must send Content-Type: text/vtt (not text/plain or application/octet-stream)
  • Testing: Test in the actual player, not only in a text editor
  • Source preservation: Keep the source SRT or ASS file if the editing workflow will continue later

Common mistakes

Renaming SRT to VTT without converting

Renaming captions.srt to captions.vtt does not convert the file. The browser sees SRT-style timestamps (commas) and no WEBVTT header, so it rejects the file.

Fix: Use the SRT to VTT Converter to properly convert the file.

Testing only in a text editor

A subtitle file that looks fine in a text editor can still fail in the player due to:

  • Wrong MIME type from the server
  • CORS issues (cross-origin requests blocked)
  • Encoding problems (non-UTF-8 characters)
  • Malformed timestamps or cue structure

Fix: Always test the final file in the real playback environment (HTML5 video in a browser).

Using the wrong MIME type

If the server sends Content-Type: text/plain or application/octet-stream, the browser refuses to parse the file as WebVTT.

Fix: Configure the server to send Content-Type: text/vtt for .vtt files. See How to fix VTT MIME type for HTML5 video for server-specific instructions.

Forgetting CORS headers for cross-origin VTT files

If your video page is at example.com and the VTT file is at cdn.example.com, the browser blocks the request unless the server sends Access-Control-Allow-Origin headers.

Fix: Configure CORS on the CDN or origin server, and add crossorigin="anonymous" to the <video> element.

Expecting ASS styling to survive conversion

WebVTT supports basic cue settings (alignment, position, size) but not ASS-level styling (colors, fonts, borders, shadows, karaoke effects).

Fix: Treat VTT as a delivery format, not a styled replica. If styling matters, test the result in the target player and adjust CSS as needed.

Troubleshooting scenarios

Scenario 1: Captions don’t appear in HTML5 video

Possible causes:

  • VTT file is malformed (missing WEBVTT header, wrong timestamp format)
  • Server sends wrong MIME type (text/plain instead of text/vtt)
  • CORS headers missing (cross-origin request blocked)
  • Track element has wrong src URL (404 error)

Fix:

  1. Validate the VTT file with the WebVTT Validator
  2. Check the browser console for errors (F12 → Console tab)
  3. Check the Network tab for the VTT request - verify it returns 200 OK and Content-Type: text/vtt
  4. If cross-origin, verify CORS headers and crossorigin="anonymous" attribute

For MIME type issues, see how to fix VTT MIME type for HTML5 video. For a broader troubleshooting walkthrough, see Why subtitles do not show in HTML5 video.

Scenario 2: Captions appear but text is garbled

Cause: Wrong text encoding (e.g., Windows-1252 instead of UTF-8).

Fix: Re-save the VTT file as UTF-8 in a text editor before uploading.

Scenario 3: Captions work in Chrome but not Firefox or Safari

Cause: Firefox and Safari are stricter about MIME types and CORS than Chrome.

Fix:

  1. Confirm Content-Type: text/vtt (not text/plain)
  2. If cross-origin, ensure Access-Control-Allow-Origin is set
  3. Check the browser console for specific error messages

Scenario 4: Captions are out of sync

Cause: The subtitle file was created for a different video cut, or timestamps are wrong.

Fix: Use the Subtitle Time Shifter to adjust timing, or re-sync the subtitles to match your video.

Scenario 5: Timestamps are invalid

Cause: The VTT file has malformed timestamps (wrong format, overlapping times, negative durations).

Fix: See How to fix invalid WebVTT timestamps for detailed troubleshooting.

Frequently asked questions

Does HTML5 video support SRT natively?

No. HTML5 <track> elements only support WebVTT. To use SRT, you must convert it to VTT first.

What’s the difference between VTT and SRT?

DifferenceSRTVTT
HeaderNoneWEBVTT required
Timestamps00:00:01,000 (comma)00:00:01.000 (dot)
Browser support❌ Not native✅ Native
Cue settings❌ Not supported✅ Alignment, position, size
StylingLimited HTML tagsCSS-like cue settings

Can I style VTT captions in HTML5 video?

Yes. WebVTT supports cue settings (alignment, position, size) and CSS styling via ::cue pseudo-elements:

::cue {
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 1.2em;
}

How do I add chapters or thumbnails with VTT?

Use kind="chapters" or kind="metadata" in the <track> element:

<track kind="chapters" src="chapters.vtt" srclang="en" />
<track kind="metadata" src="thumbnails.vtt" />

What if my VTT file has a BOM (Byte Order Mark)?

Some text editors (Notepad on Windows) save UTF-8 files with a BOM - 3 invisible bytes at the start. The WebVTT parser sees this as garbage before WEBVTT and rejects the file.

Fix: Re-save the file as “UTF-8 without BOM” in your editor.

Can I use VTT for live streaming?

Yes. WebVTT supports live streaming via HLS (HTTP Live Streaming) or DASH (Dynamic Adaptive Streaming over HTTP). The browser handles live VTT captions automatically when using HLS or DASH sources.

Use the SRT to VTT Converter

Convert SRT subtitles to WebVTT online for HTML5 video, browser players, and track elements. No signup, no upload, and everything runs locally in the browser.

Open SRT to VTT