The basics
What is an SRT file?
An SRT file holds the subtitles of a video as plain text: what to show, from when, until when. It doesn't contain the video, and the video doesn't contain it; the two travel side by side. Download subtitles for a film, export captions from a transcription tool or caption editor, or rip them from a DVD, and you usually get an .srt file.
The name comes from SubRip, a Windows program from about 2000 that read the subtitles burned into video frames with optical character recognition and saved the text and times. Its output was so simple that everything started to read it, and it became the most widely supported subtitle format, from desktop players and smart TVs to YouTube, Vimeo and LinkedIn.
That simplicity is also the catch. There is no official specification: no standards body ever wrote SRT down, so details such as the character encoding, which formatting tags work, and how strict to be about blank lines and numbering are left to each program. The WebVTT format used by web browsers was based on SRT and fills those gaps.
Anatomy
What's inside an SRT file
An SRT file is a list of cues. Each cue is a number, a timing line and one or more lines of text, and a blank line ends it. There is no header, no styling section and no metadata. Here are three cues, part by part.
1
00:00:01,000 --> 00:00:03,500
Hello, and welcome.
2
00:00:04,000 --> 00:00:06,250
This cue has <i>italic</i> text
and runs over two lines.
3
00:01:02,040 --> 00:01:05,000
[Door slams]
- 1
1The cue number
A counter that starts at 1 and goes up by one. Players mostly go by the times, but strict parsers can reject a missing or out-of-order number, so renumber after deleting cues.
- 2
00:00:01,000The start time
Hours, minutes, seconds and milliseconds, measured from the start of the video. The separator before the milliseconds is a comma. WebVTT uses a full stop instead, which makes this the most common mistake when converting between the two by hand.
- 3
-->The arrow
Two hyphens and a greater-than sign, with a space on each side, between the start and the end time.
- 4
00:00:03,500The end time
When the text disappears. A cue that ends after the next one starts overlaps it; many players then show both, stacked.
- 5
Hello, and welcome.The text
Shown at the bottom of the picture, centred, in whatever font and size the player chooses. SRT itself says nothing about appearance.
- 6
(blank line)The end of the cue
An empty line separates cues. A missing blank line glues two cues together, so the second cue's number and times show up as text.
- 7
This cue has <i>italic</i> textFormatting tags
HTML-like
<i>,<b>,<u>and<font color>are widely understood but were never standardised. Some players and sites (YouTube among them) ignore them; a few show them as raw text. - 8
and runs over two lines.A second line
Line breaks in the file are line breaks on screen. Two short lines per cue is the usual style, so viewers can read a cue at a glance.
- 9
00:01:02,040Times past a minute
Every field keeps its leading zeros, so a time is always written in full, as
00:01:02,040, even when the hours are zero. - 10
[Door slams]A sound description
Not a feature of the format, just a convention: captions for deaf and hard-of-hearing viewers describe sounds in square brackets.
Under the hood
How a player finds and shows an SRT file
- 1It looks for a file with the same name. Put
holiday.srtnext toholiday.mp4and VLC, mpv, Plex, Kodi and most smart TVs load it automatically. A language code before the extension, as inholiday.en.srtorholiday.nl.srt, lets many players offer several languages. - 2Or you add it by hand: in VLC, Subtitle, Add Subtitle File; or drag the
.srtonto the playing video. - 3It decodes the text, ideally as UTF-8. With an older file in another encoding, the player either guesses the code page or shows garbled letters.
- 4It parses the cues into a list of start time, end time and text, and at each moment draws the cues whose time range includes the current playback time.
- 5It draws the text itself, in its own font, size and position. That's why the same file looks different in VLC, on a TV and on YouTube.
Browsers don't play SRT
The HTML <track> element only accepts WebVTT. To show subtitles on a web page, convert the SRT to VTT first: the change is small, and ffmpeg -i subs.srt subs.vtt does it.
Delivery
Soft subtitles vs burned-in subtitles
There are three ways to get SRT subtitles in front of viewers, and they behave very differently:
| Sidecar `.srt` file | Track inside the video file | Burned in | |
|---|---|---|---|
| What it is | A separate file next to the video | The text stored as a subtitle stream in MKV or MP4 | The letters drawn into the video frames |
| Viewer can switch it off | Yes | Yes | No |
| Several languages | One file per language | Several tracks in one file | One version of the video per language |
| Can be edited later | Yes, in a text editor | Extract, edit, put back | No, re-encode the video |
| Works everywhere | Only where the player looks for it | Depends on the player and container | Yes: it's just pixels |
- Add it as a track to an MKV:
ffmpeg -i video.mp4 -i subs.srt -map 0 -map 1 -c copy -c:s srt out.mkv. MKV stores SRT text as it is. - Add it as a track to an MP4: use
-c:s mov_textinstead. MP4's text format is simpler, and players differ in how they handle the formatting tags. - Burn it in:
ffmpeg -i video.mp4 -vf subtitles=subs.srt -c:a copy out.mp4. This re-encodes the video and needs an FFmpeg built with libass, which draws the text. Social media clips are often burned in because many apps autoplay without sound and ignore subtitle files.
Styling
Formatting and positioning: what SRT can and can't do
SRT has no stylesheet, no fonts and no layout. What players commonly accept is borrowed from HTML and from the ASS format, and none of it is guaranteed:
| Markup | Effect | Support |
|---|---|---|
<i>…</i>, <b>…</b>, <u>…</u> | Italic, bold, underline | Wide: VLC, mpv, most TVs, FFmpeg. YouTube ignores all markup in SRT. |
<font color="#FFD700">…</font> | Text colour | Common in desktop players. Often dropped on conversion: FFmpeg removed it when we converted our sample to WebVTT. |
{\an8} at the start of a cue | Moves the cue to the top centre (the number is a keypad position: 1 to 9) | An ASS override tag. VLC, mpv and FFmpeg's subtitle renderer honour it (FFmpeg did in our test); other players ignore it or show it as text. |
If you need real styling, positioning or karaoke effects, use WebVTT for the web or ASS for desktop players, and keep an SRT version for everything else.
Related formats
SRT vs WebVTT vs ASS
| SRT | WebVTT (`.vtt`) | ASS / SSA (`.ass`, `.ssa`) | |
|---|---|---|---|
| Specification | None | W3C WebVTT | Informal, defined by tools (SubStation Alpha, Aegisub, libass) |
| First line | The first cue number | WEBVTT | [Script Info] |
| Timestamp | 00:00:01,000 | 00:00:01.000 or 00:01.000 | 0:00:01.00 (centiseconds) |
| Encoding | Not defined | UTF-8 only | Not defined; UTF-8 usual |
| Styling | A few unofficial tags | CSS through ::cue, classes, voices | Named styles, fonts, outlines, effects |
| Positioning | Unofficial {\an8} | Cue settings (line, position, align) | Exact coordinates, movement, rotation |
| Plays in web browsers | No | Yes, with <track> | No |
| Best for | Exchanging subtitles; players and TVs | Web video and accessibility | Styled fansubs, karaoke, typesetting |
Converting between them is easy as long as you only carry text and times. SRT to VTT loses nothing; VTT or ASS to SRT loses the styling and positioning. Broadcast and streaming workflows also use TTML (.ttml, .dfxp), an XML format, and SCC for US broadcast captions.
Troubleshooting
Why are my subtitles out of sync or garbled?
| Symptom | Cause | Fix |
|---|---|---|
| Every line is early or late by the same amount | The subtitles were timed for a different cut: an extra intro, a missing logo | Shift all times. In VLC, the G and H keys adjust the subtitle delay while you watch; Subtitle Edit and Aegisub can shift the file for good. |
| In sync at the start, drifting further off over time | Frame rate mismatch: timed for a 25 fps version, playing a 23.976 fps one (or the other way round). The gap grows to about 2.5 minutes after an hour. | Stretch the timings by the ratio of the frame rates (25 / 23.976), or resync two points, one near the start and one near the end. Subtitle Edit has a Change frame rate command. |
é, ’ or � instead of accented letters | The file is in another encoding than the player assumes, typically Windows-1252 read as UTF-8 | Open it in an editor with the right encoding and save it as UTF-8. With FFmpeg, add -sub_charenc CP1252 before -i. |
 or a strange character before the first number, or the first cue missing | A UTF-8 byte order mark (EF BB BF) that the program doesn't expect | Save as UTF-8 without BOM. Most players handle a BOM, but some scripts and older parsers don't. |
| A cue number and times appear on screen | A missing blank line between two cues | Add the blank line; a subtitle editor's error checker finds them all. |
| Nothing loads at all | A full stop instead of the comma in the times, -> instead of -->, or the file name doesn't match the video | Fix the timing lines, or rename the file to match the video exactly. |
Line endings rarely matter: players accept both Windows-style CRLF and Unix-style LF. They matter to scripts that split the file on \n\n to find cues, which then fail on CRLF files. Our samples include both kinds.
How to
How to open, edit and convert an SRT file
- Watch with it: give it the same name as the video and keep both in one folder, then open the video in VLC (Windows, Mac, Linux, Android, iPhone) or mpv. On a smart TV, copy both files to the same folder on a USB stick.
- Read or fix it: any text editor works. Save as UTF-8 and keep the blank lines.
- Edit timing and text: Subtitle Edit (Windows, free), Aegisub (Windows, Mac, Linux, free) and most video editors import and export SRT, with waveforms that make timing easier.
- Convert to WebVTT for the web:
ffmpeg -i subs.srt subs.vtt, or by hand: add aWEBVTTline at the top and change the commas in the times to full stops. - Upload to YouTube: YouTube accepts SRT in plain UTF-8 and ignores formatting tags.
- Turn speech into an SRT: transcription tools and speech-to-text services export SRT directly; always check names, numbers and timing by hand.
Security
Is it safe to open an SRT file?
An SRT file is text and can't run anything by itself. The risk is in the player that parses it. In 2017 Check Point researchers showed that crafted subtitle files could exploit flaws in VLC, Kodi, Popcorn Time and Stremio and take over the device, and that they could push such files to the top of shared subtitle sites so players downloaded them automatically. All four projects fixed the flaws.
Keep media players updated, and be wary of subtitle downloads that come as .exe, .scr or .zip files with a program inside: a real subtitle file ends in .srt and opens in Notepad.
Free downloads
Sample SRT files to download
Free sample SRT files, timed to our 10-second sample MP4 (sample-720p-h264-aac.mp4), for testing players, parsers, converters and encoding detection. Every file parses with the Python srt and pysrt libraries (the Windows-1252 one once decoded as Windows-1252) and converts to WebVTT with FFmpeg.
Loading…What's inside sample-720p-h264-aac.srt
SRT has no comments, so the file explains itself through its cues. It has the same base name as the sample video: download both into one folder, open the video in VLC or mpv, and the subtitles load by themselves.
Cue 1: two lines
Runs from
00:00:00,000to00:00:01,900, with a line break that the player keeps.Cue 2: a sound description
Describes the steady 440 Hz and 660 Hz test tone in square brackets, as captions for deaf and hard-of-hearing viewers do.
Cue 3: what's on screen
Names the colour bars of the test pattern, from 4 to 5.9 seconds.
Cues 4 and 5: gaps of 100 ms
Cue 4 ends at
00:00:07,500and cue 5 starts at00:00:07,600, so you can see whether a player clears the screen between cues.Cue 6: the last second
Ends at exactly
00:00:10,000, the length of the video. A player that cuts it short or keeps it after the end is rounding times.The bytes
UTF-8 without a byte order mark, LF line endings, no tags: the plainest form of the format, which every SRT reader should accept.
All sample SRT files
English subtitles for the sample MP4
sample-720p-h264-aac.srt · 491 bytes
Six cues timed to our 10-second 720p sample video, describing the test pattern, the tone and the beep. UTF-8, LF, no BOM.
- Checking that a player picks up a same-named subtitle file
- A minimal, valid SRT for parser tests
Formatting tags and positioning
sample-formatting.srt · 521 bytes
<i>,<b>,<u>, nested tags,<font color>, the unofficial{\an8}top-position tag, a two-speaker cue with hyphens, and a literal<and&that aren't tags.- Seeing which tags a player or site honours
- Testing what a converter keeps or drops
Non-Latin scripts, UTF-8 with BOM
sample-multilingual-utf8-bom.srt · 735 bytes
Greek, Russian, Hebrew, Arabic, Chinese, Japanese, Korean, Hindi and Thai. Starts with the UTF-8 byte order mark
EF BB BFand uses Windows CRLF line endings.- Font coverage and right-to-left text in players
- BOM and CRLF handling in parsers
Legacy Windows-1252 encoding
sample-windows-1252.srt · 486 bytes
French, German, Spanish and Dutch accents, the euro sign, curly quotes, an ellipsis and dashes in Windows-1252, with CRLF. It is not valid UTF-8: decoded as UTF-8 it shows
�characters, and FFmpeg drops the affected cues unless you add-sub_charenc CP1252.- Testing encoding detection
- Reproducing garbled-subtitle bugs
Ways to test with them
- Auto-loading: download
sample-720p-h264-aac.srtand the sample MP4 into one folder and open the video. The first cue should appear at once, without adding the file by hand. - Timing precision: step through the video frame by frame: cue 4 should disappear at 7.5 seconds and cue 5 appear at 7.6, with one blank frame or more in between.
- Encoding detection: import
sample-windows-1252.srtandsample-multilingual-utf8-bom.srt. Both should come out readable, with noÃ,or�. - Conversion: run the files through your converter to VTT and back, and compare. Times and text should survive; tags may not.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have an SRT file? Give it a link.
Drop an SRT file on 99helpers and it gets its own web address. Anyone who opens the link reads the subtitles as plain text in their browser, ready to check, copy or download.
Questions
SRT files, frequently asked
What is an SRT file?
A plain-text subtitle file. It lists numbered cues, each with a start time, an end time and the text to show, and players display them over the video.
How do I open an SRT file?
To read it, open it in any text editor. To watch it, give it the same name as the video, put both in one folder and open the video in VLC or another player; it loads automatically.
How do I add an SRT file to a video?
Keep it as a separate file with a matching name, add it as a subtitle track to an MKV or MP4 with FFmpeg or MKVToolNix, or burn it into the picture with FFmpeg's subtitles filter or HandBrake.
What's the difference between SRT and VTT?
WebVTT is based on SRT. It starts with a WEBVTT line, uses a full stop instead of a comma in the times, must be UTF-8, and adds styling and positioning. Browsers only play VTT.
Why are my subtitles out of sync?
A constant offset means a different cut of the video: shift all times. Drift that grows over time means a frame rate mismatch, such as 25 vs 23.976 fps: stretch the timings or resync two points.
Why do my subtitles show strange characters?
The file is in a different encoding from the one the player assumes, usually an old Windows code page read as UTF-8. Reopen it with the right encoding and save it as UTF-8.
Can I edit an SRT file in Notepad?
Yes. Keep the number, timing line and blank line of each cue intact and save as UTF-8. For retiming, a subtitle editor such as Subtitle Edit or Aegisub is easier.
Can an SRT file contain a virus?
The text itself can't run, but crafted subtitle files have exploited bugs in media players. Keep players updated, and don't run anything that came with a subtitle download.
Related formats
Other file types explained
Keep going
Related
Sources
- Library of Congress: SubRip Subtitle format (SRT)
- W3C: WebVTT, The Web Video Text Tracks Format
- YouTube Help: Supported subtitle and closed caption files
- Aegisub manual: ASS override tags
- Check Point: Hacked in Translation (subtitle vulnerabilities, 2017)
Last reviewed 27 October 2026.