What Is an SRT File? Complete SRT Subtitle Format Guide (2026)

An SRT file (SubRip Subtitle, .srt) is a plain-text subtitle format containing numbered captions with start and end timecodes. Below: format anatomy with a complete working code example, HH:MM:SS,mmm timecode specification, UTF-8 encoding standard, SRT vs VTT vs ASS comparison, and how to create or convert SRT files.

Verified July 27, 2026Complete working SRT code exampleSRT vs VTT vs ASS reference table
Home/What Is an SRT File

By VexaScribe Editorial · Verified

TL;DR

An SRT file (SubRip Subtitle, .srt) is a plain-text subtitle format containing numbered captions with start/end timecodes and text. Timecodes use the format HH:MM:SS,mmm (comma for milliseconds — unlike WebVTT which uses periods). SRT is universally supported by video players, editors, and platforms like YouTube.

SRT File Structure — Anatomy of a Cue Block

An SRT file is a sequence of cue blocks separated by blank lines. Every block has exactly four parts: a sequence number, a timecode range, one or two lines of caption text, and a trailing blank line. There is no header, no XML wrapper, and no metadata — just this pattern repeated for every cue in the video.

A complete, valid SRT you can copy into a text file and load in VLC:

1
00:00:00,000 --> 00:00:04,500
Welcome to the podcast. Today we're
talking about productivity tips.

2
00:00:04,500 --> 00:00:08,750
Thanks for having me on. I've been
working remotely for five years.

3
00:00:08,750 --> 00:00:12,000
Great to have you. What's your
number one tip?

4
00:00:12,000 --> 00:00:16,200
<i>Ship the messy first draft
instead of polishing forever.</i>

5
00:00:16,200 --> 00:00:20,000
Deep. Let's unpack that.

Line-by-line breakdown

Line 1 — Sequence number: a plain integer starting at 1 and incrementing. Most players tolerate gaps or duplicates, but clean files use sequential integers from 1 upward.
Line 2 — Timecode range: HH:MM:SS,mmm --> HH:MM:SS,mmm. The comma before milliseconds is mandatory in SRT — not a period. The separator is the literal arrow --> (two hyphens, one greater-than) with a space on either side.
Lines 3+ — Caption text: one or two lines of text. The SRT spec itself sets no length limit; the 42 characters per line / two lines per cue convention comes from broadcast (see the line-length section below).
Blank line — Cue separator: exactly one blank line before the next sequence number. Miss this and most parsers merge the two cues.

SRT Timecode Format Specification

The SRT timecode is HH:MM:SS,mmm: two-digit hours, two-digit minutes, two-digit seconds, then a comma before three-digit milliseconds. Millisecond precision means the format resolves to 1/1000 of a second. Frames are not part of the format — if you need to align SRT to a specific frame rate, convert frames to milliseconds first (at 25 fps, one frame is 40 ms; at 23.976 fps, one frame is ~41.7 ms).

The comma is the single most common source of broken SRT files, because WebVTT — the closely related format used inside HTML5 <track> elements — uses a period in the same position. Converting one to the other is a one-character bulk replace, but the two are not interchangeable as-is.

Timecode format — SRT vs VTT vs ASS

FormatExampleSeparator before decimalPrecision
SRT00:01:23,456Comma before msMillisecond (3 digits)
WebVTT00:01:23.456Period before msMillisecond (3 digits)
ASS / SSA0:01:23.45Period before csCentisecond (2 digits)

Sources: matroska.org codec spec (SRT, ASS), W3C WebVTT 1.0 (w3.org/TR/webvtt1), docs.fileformat.com/video/srt.

SRT File Encoding — Why UTF-8 Matters

The SRT spec does not mandate a character encoding, but the de facto standard across modern players and platforms is UTF-8 (Unicode Consortium's universal encoding). UTF-8 is what YouTube, VLC, MPV, Premiere Pro, and DaVinci Resolve expect. If your file lands as anything else — Windows-1252, ISO-8859-1, ANSI — accented characters and non-Latin scripts (Cyrillic, Arabic, Chinese, Japanese, Korean, Hebrew) render as mojibake: replacement squares, question marks, or garbled bytes.

The fix is always to re-save as UTF-8 without a byte-order mark (BOM). In VS Code: click the encoding indicator in the bottom-right status bar → "Save with Encoding" → "UTF-8". In Notepad++: Encoding menu → "Convert to UTF-8 (without BOM)". In Sublime Text: File → Save with Encoding → UTF-8. Some older players choke on the BOM, so the "without BOM" variant is the safe default.

WebVTT, by comparison, is spec-required to be UTF-8. That's one of the few things WebVTT tightens over SRT.

SRT vs VTT vs ASS — Format Comparison

Three formats dominate for text-based subtitles. SRT is universal, VTT is web-native, ASS is styling-heavy. Pick based on where the subtitles will play and how much styling you need.

DimensionSRTVTT (WebVTT)ASS / SSA
Extension.srt.vtt.ass / .ssa
Full nameSubRip SubtitleWeb Video Text TracksAdvanced SubStation Alpha
Timecode separatorComma (HH:MM:SS,mmm)Period (HH:MM:SS.mmm)H:MM:SS.cc (centiseconds)
File headerNoneWEBVTT (required)[Script Info] section
StylingPlain text; player-dependent <i> <b> <u>CSS-like styling + positioningFull: colour, fonts, karaoke, effects
Standard encodingUTF-8UTF-8 (spec-required)UTF-8 or UTF-16
Primary useUniversal — YouTube, editors, playersHTML5 <track> elementAnime, karaoke, hardsub styling
Standardised byDe facto (SubRip project origin)W3C (2013 → present)Community (SubStation Alpha lineage)

Pick SRT if: you're uploading to YouTube, Vimeo, LinkedIn, TikTok, or Instagram; delivering to a video editor (Premiere Pro, DaVinci Resolve, Final Cut, CapCut); or you want the file to work everywhere. This is the default.

Pick VTT if: you're serving video through a native HTML5 <video> element with a <track> tag, or your player needs CSS positioning or per-cue metadata. WebVTT is standardised by the W3C.

Pick ASS/SSA if: you need typographic effects — coloured text, per-character positioning, karaoke-style timing. Standard in anime fansub workflows. Aegisub is the editor. Most Western platforms ignore ASS styling on upload.

Sources: matroska.org subtitle codec docs, W3C WebVTT 1.0, Wikipedia: SubRip.

How to Open an SRT File

Text editors. Any editor works — SRT is plain text. Windows: Notepad or Notepad++. Mac: TextEdit (Format → Make Plain Text first) or BBEdit. Cross-platform: VS Code, Sublime Text. For encoding fixes, VS Code's status-bar encoding indicator is the fastest workflow.

Video players. VLC and MPV auto-load an SRT if it sits in the same folder as the video with the matching base name (video.mp4 + video.srt). You can also drag an SRT onto the VLC window during playback. IINA (Mac) works the same way.

Subtitle editors. Subtitle Edit (Windows, free) is the industry standard for cleanup and retiming. Aegisub (cross-platform, free) is the go-to for advanced styling and karaoke-style timing. Both give you a waveform view so you can align cues to speech visually.

Video NLEs. Premiere Pro, DaVinci Resolve, and Final Cut Pro all import SRT as an editable subtitle track — the cues land on a caption timeline you can adjust like any other clip.

How to Create an SRT File

Three routes: automatic transcription from audio or video, conversion from an existing timed text file, or hand-authoring in a text editor.

1. Auto-generate from audio or video

The realistic option for anything longer than a few minutes. An AI transcription tool (VexaScribe, Whisper Large-v3 locally, Descript, Rev) listens to the audio, produces word-level timestamps, and formats the result as SRT. See our SRT generator for a browser workflow, or subtitle generator for SRT + VTT + burn-in options. Already have an SRT and just need to translate it to another language? Use the subtitle translator — 133 target languages, timestamps preserved.

2. Convert TXT to SRT

A plain TXT transcript has no timing, so a valid SRT can't be built from text alone — SRT requires a start-and-end timecode per cue. Two workable paths:

  • If you have the audio: upload it plus the TXT as a reference to an AI transcription tool. The tool aligns cues to the waveform using your text as the language model prompt — much more accurate than pure transcription for hard-to-parse names or jargon.
  • If you must go text-only: hand-add timecodes in a text editor following the format spec above. Type 1, Enter; 00:00:00,000 --> 00:00:04,500, Enter; your text; blank line; repeat.

3. Hand-author in a text editor

  1. Open a plain text editor. Notepad, TextEdit (plain text mode), or VS Code.
  2. Type 1 and press Enter.
  3. Type the timecode range, e.g. 00:00:00,000 --> 00:00:04,500. Comma before milliseconds.
  4. Type the caption text — target 42 characters per line, max 2 lines.
  5. Press Enter twice to leave a blank line before the next cue.
  6. Repeat, incrementing the sequence number.
  7. Save with a .srt extension and UTF-8 encoding without BOM.

SRT vs VTT — When (and How) to Convert

WebVTT is the format HTML5 video expects when you use the <track> element inside <video>. If you're serving video through a custom web player rather than a hosted platform (YouTube, Vimeo), you need VTT — those platforms accept both, but the browser's native <track> element wants VTT specifically.

Conversion is mechanical:

Convert SRT → VTT

  1. Add WEBVTT as the first line, followed by a blank line.
  2. Replace every comma before a millisecond value with a period: 00:00:04,50000:00:04.500. Regex find (\d\d):(\d\d):(\d\d),(\d\d\d), replace $1:$2:$3.$4.
  3. Save with a .vtt extension, UTF-8 (spec-required for WebVTT).

Convert VTT → SRT

  1. Remove the WEBVTT header line and any CSS STYLE or NOTE blocks.
  2. Replace periods before milliseconds with commas (reverse of above regex).
  3. Renumber cues from 1 (VTT allows unnumbered cues; SRT expects sequence integers).
  4. Save with a .srt extension, UTF-8 without BOM.

Common SRT Problems and Fixes

!Garbled accented characters (é, ñ, ü, Cyrillic, CJK)

Cause: File saved as Windows-1252, ANSI, or ISO-8859-1 instead of UTF-8.

Fix: Re-save as UTF-8 without BOM. In VS Code: click the encoding indicator in the bottom-right → "Save with Encoding" → "UTF-8". In Notepad++: Encoding menu → "Convert to UTF-8 (without BOM)". UTF-8 is the Unicode Consortium standard and what YouTube, VLC, and modern players expect.

!Timing drift across the file (starts synced, ends off by seconds)

Cause: Frame-rate mismatch. Common when the SRT was authored against a 23.976 fps master but the video was re-encoded at 25 fps (or vice versa).

Fix: Resample the timings against the correct frame rate. Subtitle Edit has Synchronization → Change Frame Rate. Aegisub has Timing → Shift Times → by frame rate ratio.

!Timecodes use periods instead of commas

Cause: The file is actually WebVTT saved with a .srt extension, or a converter emitted VTT-style timings.

Fix: Bulk-replace period-before-milliseconds with commas. In VS Code: regex find (\d\d):(\d\d):(\d\d)\.(\d\d\d), replace $1:$2:$3,$4. Only fixes the timing lines; text stays untouched.

!Line-too-long — captions wrap awkwardly on screen

Cause: The exporter didn't split cues, or the source was a monologue emitted as a single long block.

Fix: Split cues at sentence boundaries first, then at commas, then at word boundaries. Target the 42 chars / 2 lines convention (Netflix Timed Text Style Guide, BBC Subtitle Guidelines). Subtitle Edit and Aegisub both auto-split at a configurable line-length ceiling.

!VLC / MPV shows "no subtitles available"

Cause: Filename mismatch. VLC auto-loads an SRT only when its base name matches the video's base name in the same folder.

Fix: Rename so the base names match: video.mp4 pairs with video.srt (not video.mp4 + subs.srt). Both files must sit in the same directory. Alternatively drag the SRT onto the VLC window during playback.

!YouTube rejects the upload

Cause: Invalid timings (end-before-start), non-UTF-8 encoding, or malformed timecode line.

Fix: Validate structure with a plain-text lint pass: every cue is a sequence integer, a timecode line with '-->', text, blank line. Reject any cue where end < start. Save UTF-8 without BOM. Re-upload.

SRT Styling and Tag Support

The SubRip specification is plain text — no styling. In practice, a small set of HTML-like inline tags are widely honoured by players, but this is player behaviour, not spec. Support varies. Test on your target platform before shipping styled cues.

  • <i>italic</i> — supported by VLC, MPV, YouTube, Premiere Pro.
  • <b>bold</b> — widely supported.
  • <u>underline</u> — widely supported.
  • <font color="#RRGGBB"> — partial support; stripped by YouTube on upload.

For anything beyond basic emphasis — positioning, karaoke effects, per-word timing, drop shadows — you need VTT (positioning, CSS) or ASS (full typographic control) instead of SRT.

Line-Length Conventions

The SRT spec sets no line-length limit. The 42 characters per line / maximum 2 lines per cue convention comes from broadcast subtitle standards, not the format itself. Two authoritative sources:

  • Netflix Timed Text Style Guide — 42 characters per line as the English target, 2-line maximum per cue.
  • BBC Subtitle Guidelines — similar limits with regional variations; both used across professional QC.

Reading speed sits alongside line length: viewers process roughly 15–20 characters per second, aligned with WCAG 2.1 SC 1.2.2 (Captions Prerecorded) accessibility guidance. A 42-character line takes ~2.1–2.8 seconds to read comfortably. Push above that and viewers either miss the caption or stop watching the video to read it.

These conventions are why every professional subtitle exporter ships with automatic cue-splitting. Our SRT generator caps cues at ~80 characters and 5 seconds (10s hard ceiling) — pragmatic for online video and safely under the broadcast ceiling.

SRT for Developers — Parsing Notes

Writing an SRT parser or generator? A few edge cases worth handling explicitly.

  • Line endings. Files in the wild use both LF (Unix) and CRLF (Windows). Accept either. Emit LF for max compatibility with modern web platforms and players.
  • Trailing blank line. Some files end with a blank line after the last cue, some don't. Both are valid — don't reject either.
  • Comma vs period. Timecode line uses a comma before milliseconds. If you see a period, the file is almost certainly WebVTT saved with a wrong extension — either reject or auto-convert.
  • Arrow separator. The literal --> is two hyphens and one greater-than, surrounded by single spaces on each side. Some malformed files use a single hyphen or Unicode arrow characters — these need normalisation.
  • Sequence numbers. Almost always sequential from 1, but the spec doesn't require it and permissive players ignore the numbers entirely. Don't crash on gaps or duplicates.
  • BOM. A UTF-8 BOM at file start is technically valid but some older players choke. Strip it during read and don't emit one during write.
  • Multi-line text. A cue can contain any number of text lines, though the 2-line broadcast convention is standard. Terminate on the first blank line encountered after the text.

Generate an SRT from your audio or video

Upload an audio or video file, get a valid SRT with word-level timestamps, cue splits at ~80 characters, and UTF-8 encoding by default. 30 minutes free on signup — no card.

Try the SRT generator

Frequently Asked Questions

What does SRT stand for?

SRT stands for SubRip Subtitle (sometimes expanded as SubRip Text). It's named after SubRip, the Windows program that popularised the format by ripping subtitles from DVDs. The .srt extension is the format itself; the .rip that some tools produce is unrelated.

What is an SRT file used for?

SRT stores timed captions or subtitles for a video. It's the universal interchange format for subtitles — accepted by YouTube, Vimeo, LinkedIn, TikTok, Instagram, Facebook, Apple Podcasts (2024 transcripts rollout), Premiere Pro, DaVinci Resolve, Final Cut Pro, VLC, MPV, and virtually every video editor and player. If you need subtitles that will work everywhere, SRT is the default.

How do I open an SRT file?

Any text editor. On Windows: Notepad or Notepad++. On Mac: TextEdit (Format → Make Plain Text first) or BBEdit. Cross-platform: VS Code, Sublime Text. VLC and MPV also open SRT directly if you drop the file next to the video with the same base filename (video.mp4 + video.srt).

How do I create an SRT file?

Three routes. (1) Auto-generate from audio or video using an AI transcription tool — this is the realistic option for anything longer than a few minutes. (2) Convert an existing timed transcript from TXT or DOCX using a converter. (3) Hand-type it in a text editor following the format spec below. See our /srt-generator for the auto route.

What is the SRT timecode format?

HH:MM:SS,mmm — hours, minutes, seconds, then a COMMA before three-digit milliseconds. Example: 00:01:23,456 is one minute, twenty-three seconds, four hundred fifty-six milliseconds. The comma is mandatory in SRT and is the single most common source of broken subtitle files, because WebVTT uses a period in the same position.

What is the difference between SRT and VTT?

Three differences. (1) Timecode separator: SRT uses a comma before milliseconds, VTT uses a period. (2) Header: VTT files must start with the literal word WEBVTT on the first line; SRT has no header. (3) Styling: SRT is plain text with player-dependent basic tags; VTT supports CSS positioning, colour, and font styling. Both carry the same essential data — a numbered list of timed text cues.

What is the difference between SRT and ASS?

ASS (Advanced SubStation Alpha, extension .ass or .ssa) supports full typographic styling: colour, per-character positioning, karaoke effects, font selection, drop shadows, rotation. SRT supports none of that natively. ASS is standard in anime fansub workflows; SRT is standard everywhere else. Most Western platforms strip or ignore ASS styling on upload, which is why SRT remains the interchange default.

How do I fix garbled characters in an SRT file?

Encoding issue. The file was saved as Windows-1252, ANSI, or ISO-8859-1 instead of UTF-8, so accented characters (é, ñ, ü) and non-Latin scripts render as mojibake. Fix: open the file in VS Code, click the encoding indicator in the status bar, choose &quot;Save with Encoding&quot; → UTF-8 (without BOM). Notepad++ and Sublime Text have equivalent menus. UTF-8 is the encoding YouTube and modern players expect.

Can SRT files contain formatting like italics?

The SubRip spec itself is plain text — no formatting. In practice, a small set of HTML-like inline tags are widely supported by players: &lt;i&gt; for italic, &lt;b&gt; for bold, &lt;u&gt; for underline, and &lt;font color=&quot;#RRGGBB&quot;&gt; for colour. Support is player-dependent, not spec-mandated — VLC and MPV honour them, YouTube strips some. For guaranteed styling, use WebVTT or ASS instead.

How do I convert TXT to SRT?

A plain TXT transcript has no timing, so you can't produce a valid SRT from text alone — SRT requires a start-and-end timecode per cue. Two workable paths: (1) if you have the audio, run it through an AI transcription tool with your TXT as a reference prompt and let the tool align cues to the waveform, or (2) if you must go text-only, hand-add timecodes in a text editor following the HH:MM:SS,mmm format. Some tools generate placeholder timings, but those need per-cue review before use.

How do I convert SRT to VTT (or VTT to SRT)?

Two mechanical changes. To go SRT → VTT: add the line &quot;WEBVTT&quot; followed by a blank line at the top of the file, then replace every comma before a millisecond value with a period (00:00:04,500 becomes 00:00:04.500). To go VTT → SRT: remove the WEBVTT header, remove any CSS style blocks, and replace periods with commas in timecode lines. Sequence numbering is optional in VTT but expected in SRT — renumber cues from 1 if going VTT → SRT.

What's the maximum line length for SRT?

The SRT spec itself imposes no limit — but the readability convention is 42 characters per line, maximum 2 lines per cue. Sources: BBC Subtitle Guidelines and the Netflix Timed Text Style Guide, both used across broadcast and streaming. Longer lines are technically valid; they just become hard to read at video-caption font size and break the ~15–20 characters-per-second reading-speed target recommended by WCAG 2.1 for accessible captions.