SRT is the most widely supported subtitle format in existence and one of the simplest file formats you will ever meet: a number, a time range, some text, a blank line, repeat. You can write one in Notepad. Knowing exactly what the format expects is also what lets you fix the three mistakes that cause most upload rejections.
The anatomy of an SRT file
Here is a complete, valid SRT file. There is nothing else to the format.
1
00:00:01,000 --> 00:00:04,120
Welcome back to the show.
Today we are talking about subtitles.
2
00:00:04,400 --> 00:00:07,980
They are simpler than most people expect.
3
00:00:08,250 --> 00:00:11,600
And the format has barely changed in twenty years.Each block — a cue — has four parts:
- An index number, starting at 1 and counting up. Gaps and duplicates break some players.
-
A timecode line: start, then a space, then
-->, then a space, then end. - One or two lines of text. Technically more are allowed; practically, two is the limit.
- A blank line. This is the cue separator and it is mandatory.
Writing one by hand
Entirely possible, and worth doing once to understand the format. Open a plain text editor — Notepad,
TextEdit in plain text mode, or any code editor — and type cues following the pattern above. Save with
a .srt extension and UTF-8 encoding.
It is also an unreasonable way to subtitle anything longer than a minute, because the work is not the typing. It is watching the video repeatedly to find the exact millisecond each phrase starts and stops. For a three-minute video that is an hour of tedium, which is why everyone generates them.
In TextEdit on a Mac, use Format → Make Plain Text before saving. Rich text will save smart quotes and formatting into what is supposed to be a plain file, and players will show the markup.
Generating one automatically
The sensible route. A speech model produces both the text and the timings in one pass, and you spend your effort on correction rather than on stopwatch work.
-
Transcribe the video
Drop the video file in directly — there is no need to extract the audio first. Use an accurate model, since you are not waiting in real time.
-
Add names and terminology first
Anything a general model will not know. Fixing this before transcription is far quicker than find-and-replace across two hundred cues afterwards.
-
Export as SRT
The export handles cue splitting, line length and index numbering, which are the three things most likely to be wrong in a hand-made file.
-
Read it through against the video
Watch with the subtitles loaded. You are looking for misheard words and for cues that linger or vanish too fast. This takes about the runtime of the video and is the step that separates good subtitles from automatic ones.
Timing and line-length rules
These are the broadcast conventions, and they exist because of how fast people read.
| Rule | Value | Why |
|---|---|---|
| Characters per line | Up to 42 | Wider than this overflows on a phone or gets scaled down to illegibility. |
| Lines per cue | Two | Three lines covers too much of the picture, and a third line is rarely read in time. |
| Minimum duration | About 1 second | Anything briefer registers as a flash rather than as text. |
| Maximum duration | About 7 seconds | Beyond this a viewer rereads it and loses the thread. |
| Reading speed | Under ~20 characters per second | The practical ceiling for comfortable reading. |
| Gap between cues | At least 2 frames (~80 ms) | Back-to-back cues look like one flickering block. |
Break lines at grammatical boundaries. This is the rule that most improves readability and is ignored most often. Split after a clause, not mid-phrase:
GOOD
We looked at the data again,
and the result did not hold up.
BAD
We looked at the data again, and the
result did not hold up.The errors that break uploads
When a platform rejects an SRT, it is almost always one of these five.
-
A full stop instead of a comma in the timecode.
00:00:01.000is WebVTT syntax. SRT wants00:00:01,000. This is the single most common error and it rejects the whole file. - Missing blank lines between cues. Without the separator, parsers read the next index number as part of the previous cue's text.
- Overlapping or out-of-order timecodes. A cue starting before the previous one ended. Some players cope; strict validators do not.
- Wrong encoding. Save as UTF-8 without a byte-order mark. With a BOM, some parsers fail on the first cue; in a legacy encoding, every accented character is wrong.
-
An extension that does not match the content. A VTT file renamed to
.srtis still a VTT file, and theWEBVTTheader on line one gives it away.
If an upload fails with no useful message, open the file in a text editor and look at the first three lines. An unexpected WEBVTT header or a full stop in the timecode accounts for the large majority of cases.
Checking your file
Three levels of verification, cheapest first.
Open it in a text editor. Check the first cue, the last cue, and that indices run consecutively. Most problems are visible in ten seconds.
Play it in VLC. Put the .srt next to the video with the same base name
and VLC loads it automatically. If the subtitles appear and stay in sync, the file is structurally
sound.
Upload it where it is going. YouTube validates on upload and will tell you if something is malformed, which makes it a reasonable free validator even for files destined elsewhere.
If what you actually need is WebVTT rather than SRT — for an HTML5 <track> element,
for instance — the differences are small but real, and
SRT vs VTT covers them. For getting
subtitles onto a specific platform, see
how to add subtitles to a video.