Subtitles

How to Convert TXT to SRT

By YoutubeToTextUpdated

A TXT file holds only the words. An SRT file holds the same words cut into short lines, each with a start and an end time, so a player can show them under the video. Converting TXT to SRT therefore means one thing: giving every line its timing. Renaming the file does not do that, and a tool that only reads your text has to guess the times.

There are three ways to get the timings right:

  1. Your own video on YouTube: paste the text into YouTube Studio and let it set the timings. Free.
  2. Any video file: load the text into a subtitle editor and set the timings yourself against the audio.
  3. You still have the video: skip the TXT and transcribe the video straight to SRT.

What an SRT file looks like

1
00:00:01,000 --> 00:00:04,200
To get a transcript of a YouTube video,

2
00:00:04,200 --> 00:00:07,500
open the video and click "Show transcript".

Every cue has four parts:

  • A number, counting up from 1.
  • The start and end time as hours:minutes:seconds,milliseconds, with a comma before the milliseconds and --> in between.
  • One or two lines of text.
  • An empty line before the next cue.

Save the file as plain text in UTF-8, with the extension .srt.

Subtitles read best in short pieces. Ours keep each cue to one phrase, at most 42 characters on a line and two lines, on screen for 1 to 7 seconds. Those are good limits for any SRT you write by hand too.

Way 1: let YouTube Studio set the timings

If the video is on your own channel, YouTube does the timing for free:

  1. Open YouTube Studio and choose Subtitles in the menu on the left.
  2. Pick the video and click Add language, then pick the language.
  3. Under Subtitles, click Add and choose Auto-sync.
  4. Paste your text and click Assign timings.
  5. When it is done, open the three-dot menu next to the language and choose Download, then .srt.

Auto-sync works best when the text matches what is said word for word, so fix the transcript before you paste it.

Way 2: set the timings in a subtitle editor

For a video that is not on your channel, use a subtitle editor. Subtitle Edit is free for Windows. Import the TXT as plain text, so every line becomes a cue, then open the video and set each cue's start and end against the waveform. For a short clip you can also type the cues in any text editor, using the format above.

Expect this to take a while: you set two times for every line, and a ten-minute video easily has a hundred lines.

Way 3: skip the TXT

If you still have the video, a transcription tool writes the subtitles with the timings already in place. With YoutubeToText you paste a YouTube link and get an SRT and a WebVTT, timed from the audio. Already transcribed the video with us? Download the SRT from the same job: the export menu offers TXT, DOCX, SRT and WebVTT.

When the subtitles do not show up

  • The file is called video.srt.txt. Windows hides known extensions, so a file saved from Notepad can keep .txt at the end. Turn on file name extensions in Explorer and rename it.
  • A time has a period instead of a comma. 00:00:01.000 is WebVTT style; SRT needs 00:00:01,000.
  • A blank line is missing between cues. The player then reads two cues as one, or stops there.
  • Strange characters instead of accents. Save the file as UTF-8.
  • Cues overlap. A cue that starts before the previous one ends can make players skip lines. Check the end times.

FAQ

Questions.
Answered.

Can't find what you're looking for?
Contact us.

It can put your text into the SRT format, with numbers and arrows, but it does not hear the video, so every time it writes is a guess. The result looks like a subtitle file and drifts out of sync within the first minute. The timings have to come from the audio: YouTube's Auto-sync, a subtitle editor, or a transcription tool.
Many players show bold and italic when you wrap a word in the HTML-style b or i tag inside an SRT cue. Not every player or platform does, and some print the tags as text, so test the file in the player you publish to before you rely on it.
SRT for video editors, desktop players and most upload forms. WebVTT for a web player, where it can also carry positioning and styling. Converting between them is mostly a matter of the comma before the milliseconds, which WebVTT writes as a period, and a WEBVTT line at the top.