What Is an SRT File? The Subtitle Format Explained Line by Line

A plain-English guide to the SRT subtitle format: how each block works, the exact timecode syntax, encoding pitfalls and how to create or fix an SRT file.

Captions & SubtitlesBy AI Point EditorialUpdated 24 September 20268 min read

An SRT file is a plain-text subtitle file that tells a video player what words to show and exactly when to show them. Each subtitle is a small numbered block containing a start time, an end time and one or two lines of text, and the whole file can be opened and edited in any text editor. It is the most widely supported subtitle format there is, which is why almost every caption tool, editor and video platform can import or export it.

Where SRT comes from

The name comes from SubRip, a Windows program from the early 2000s that used optical character recognition to "rip" the subtitle images from DVDs into text. The files it saved used the .srt extension, and the format was so simple that other software adopted it. There has never been an official, formally published standard for SRT; what everyone follows is the de facto format that SubRip produced. That history explains both its strengths (it is tiny, readable and universal) and its weaknesses (styling and positioning are barely defined, so different players behave slightly differently).

Anatomy of an SRT file, line by line

Here is a complete, valid SRT file with three subtitles:

1
00:00:01,000 --> 00:00:03,500
Welcome back to the channel.

2
00:00:03,800 --> 00:00:07,200
Today we're fixing captions
that drift out of sync.

3
00:00:07,600 --> 00:00:09,000
Let's get started.

Every block follows the same four-part pattern.

1. The sequence number

The first line is a counter: 1, 2, 3 and so on. It exists to identify the cue and keep blocks in order. Most modern players do not actually rely on it for timing, but some older software and certain upload validators will complain if numbers are missing, duplicated or out of order. It is good practice to renumber the file after you add or delete cues.

2. The timecode line

The second line holds the start and end time, separated by a space, two hyphens, a greater-than sign and another space:

HH:MM:SS,mmm --> HH:MM:SS,mmm
  • HH is hours, MM minutes, SS seconds, all two digits with leading zeros.
  • mmm is milliseconds, always three digits.
  • The separator before the milliseconds is a comma, not a full stop. This is the single most common reason an SRT file fails to load, because the closely related WebVTT format uses a full stop.

So 00:01:05,250 means one minute, five and a quarter seconds. The end time must be later than the start time, and ideally a subtitle should not overlap the next one.

3. The subtitle text

After the timecode come one or more lines of text. Two lines is the normal maximum for readability; the line break you type is the line break the viewer sees, so place it at a natural pause in the sentence rather than wherever the text happens to wrap. Our guide to caption reading speed covers how long each line should be and how long it needs to stay on screen.

4. The blank line

A single empty line ends the block. This blank line is structural, not decoration: it is how a parser knows one subtitle has finished and the next begins. If you delete it, two subtitles merge into one, and the second block's number and timecode appear on screen as text.

Formatting and positioning inside SRT

Because SRT has no formal specification, formatting support depends on the player. The tags below are widely, but not universally, understood:

Tag Effect Support
<i>…</i> Italics (often used for off-screen voices or song lyrics) Very wide
<b>…</b> Bold Wide
<u>…</u> Underline Moderate
<font color="#ffff00">…</font> Text colour Patchy
{\an8} at the start of the text Move the subtitle to the top of the frame Some players and FFmpeg only

If you need reliable colours, fonts, precise positioning or animation, SRT is the wrong tool. Our comparison of SRT, WebVTT and ASS explains when to move to a richer format. On YouTube in particular, styling tags in uploaded SRT files may be ignored or rendered inconsistently, so keep your text clean and let the viewer's caption settings handle the look.

Encoding: the invisible problem

An SRT file is only text, but text has to be stored as bytes, and the way characters are converted to bytes is called the encoding. Save every SRT file as UTF-8. It handles accented letters, the pound sign, curly quotes and non-Latin scripts correctly.

Encoding mistakes show up in recognisable ways:

  • £ appearing as £, or café as café, usually means a UTF-8 file is being read as an older Windows encoding.
  • Question marks or � symbols in place of accented letters usually means the reverse: a file saved in an older encoding is being read as UTF-8.

Some editors add a "byte order mark" (BOM) to the start of UTF-8 files. Most players cope, but occasionally a strict parser reads the BOM as part of the first sequence number and rejects the file. If block 1 misbehaves and nothing else does, re-save as "UTF-8 without BOM".

Line endings matter less than they used to. Windows-style (CRLF) and Unix-style (LF) are both accepted by nearly everything current.

How to create an SRT file

You have three realistic options.

  1. Type it by hand. Fine for a 30-second clip. Use a plain-text editor such as Notepad, TextEdit in plain-text mode, or VS Code, never a word processor, which adds hidden formatting.
  2. Use a subtitle editor. Free desktop editors such as Subtitle Edit and Aegisub show the waveform, let you drag cue boundaries and check for overlaps, and export clean SRT.
  3. Generate it from speech recognition. Tools built on models such as Whisper produce an SRT directly from the audio. With the open-source Whisper command-line tool, for example:
whisper interview.wav --model small --language en --output_format srt

Automatic output always needs a human pass for names, jargon and punctuation. The Whisper guide explains why errors happen and where to look for them.

Common mistakes and how to fix them

Symptom Likely cause Fix
File will not load at all Full stop instead of comma in timecodes, or a missing --> Find and replace . with , in the timecode lines only
Numbers and times appear on screen Missing blank line between blocks Add an empty line after each block's text
Garbled accented letters or £ Wrong encoding Re-save as UTF-8
Two subtitles flash on top of each other Overlapping times Make each end time earlier than the next start time
Captions correct at the start, late by the end Frame-rate mismatch or different cut See fixing subtitle sync drift
Everything is early or late by the same amount A fixed offset Shift all timings, for example with our SRT shifter

A useful check before uploading is to open the file in a proper media player alongside the video and scrub to the beginning, middle and end. If all three points line up, the file is almost certainly fine.

Using SRT files with FFmpeg

FFmpeg reads and writes SRT natively, which makes it handy for quick conversions and burn-ins. The >FFmpeg documentation covers the subtitles filter in full.

Convert SRT to WebVTT:

ffmpeg -i captions.srt captions.vtt

Add the SRT as a selectable (closed) subtitle track in an MP4 without re-encoding the video:

ffmpeg -i video.mp4 -i captions.srt -c copy -c:s mov_text -metadata:s:s:0 language=eng output.mp4

Burn the subtitles permanently into the picture (this re-encodes the video):

ffmpeg -i video.mp4 -vf "subtitles=captions.srt" -c:a copy output.mp4

Whether to embed or burn in is a decision in its own right; see open vs closed captions.

Uploading SRT to YouTube

YouTube accepts SRT files through YouTube Studio's Subtitles section, and at the time of writing it is one of the formats listed as supported. Uploading your own file rather than relying on automatic captions means your spelling of names and terms is what viewers see. Because platform details change, check the official page "YouTube Help: Supported subtitle and closed caption files" at >support.google.com/youtube before building a workflow around a specific option.

Quick checklist

  • One block per subtitle: number, timecode, text, blank line.
  • Timecodes in HH:MM:SS,mmm format with a comma before the milliseconds.
  • No more than two lines of text per block, broken at natural pauses.
  • No overlapping cues; each end time before the next start time.
  • Saved as UTF-8 (without BOM if a strict tool complains).
  • Checked against the video at the start, middle and end before publishing.

FAQ

Can I open an SRT file without special software?

Yes. It is plain text, so Notepad on Windows or TextEdit on a Mac (switched to plain-text mode) will open and edit it. To see it alongside the video, load it in a media player such as VLC with the video file.

Is SRT the same as closed captions?

SRT is a file format; closed captions are a way of delivering text that the viewer can turn on or off. An SRT file is often used to supply closed captions, but it can equally be burned into the picture as open captions.

Why does my SRT work in VLC but not on another platform?

Desktop players are forgiving. Platforms and web players often validate more strictly, so a missing blank line, a full stop in a timecode, a BOM or unsupported tags can cause a rejection that VLC quietly ignored.

Does the sequence number have to be correct?

Most players time subtitles from the timecodes, not the numbers, so a wrong number rarely breaks playback. Some validators and older tools do check it, however, so renumbering is a cheap way to avoid problems.

Software, platform rules and settings change. We review our guides regularly, but always check the official documentation for the tools you use. Found an error? Email soubickdas@gmail.com. See our editorial policy.
A

AI Point Editorial

We build caption, transcription and video-workflow tools and write about what we learn doing it — practical, tested and free of hype.