Guides

How to Create SRT Subtitles

What an SRT file looks like, how to write one by hand, how to generate one automatically, and the formatting mistakes that make uploads fail.

Published 9 min read

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.

example.srt
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:

  1. An index number, starting at 1 and counting up. Gaps and duplicates break some players.
  2. A timecode line: start, then a space, then -->, then a space, then end.
  3. One or two lines of text. Technically more are allowed; practically, two is the limit.
  4. A blank line. This is the cue separator and it is mandatory.
700:01:12,400 --> 00:01:15,920That is the whole format.Nothing else to it.IndexTimecodeTextcounts from 1comma, not full stopmax two linesblank line — mandatory cue separator
One cue, annotated. The comma before the milliseconds is the detail most hand-written files get wrong.

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.

The TextEdit trap

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Subtitle timing conventions
RuleValueWhy
Characters per lineUp to 42Wider than this overflows on a phone or gets scaled down to illegibility.
Lines per cueTwoThree lines covers too much of the picture, and a third line is rarely read in time.
Minimum durationAbout 1 secondAnything briefer registers as a flash rather than as text.
Maximum durationAbout 7 secondsBeyond this a viewer rereads it and loses the thread.
Reading speedUnder ~20 characters per secondThe practical ceiling for comfortable reading.
Gap between cuesAt 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:

Line breaking
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.000 is WebVTT syntax. SRT wants 00: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 .srt is still a VTT file, and the WEBVTT header on line one gives it away.
The first thing to check

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.

Share LinkedIn X Hacker News
Guides

How to Transcribe Lectures Into Study Notes

Stop scrambling to write everything down. How to record a lecture, transcribe it accurately, and turn the text into notes you will actually revise from.

9 min read

Guides

How to Translate Audio to English Text

Turning foreign-language audio and video into English text and subtitles — and why transcribing first, then translating, usually beats doing both at once.

9 min read

Stop reading. Start talking.

BarqType runs on your computer: hold a key and dictate into any app, or drop in a recording and get a transcript. The free plan needs no account, and your audio never leaves the machine.