An SRT file already contains every word of the dialogue. It is mixed in with cue numbers, timecodes and line breaks that only a video player needs. Converting SRT to TXT strips those parts away and leaves text you can read, quote, search or paste into show notes, a blog post or a translation brief.
This guide shows what to remove, how to do it in any text editor that supports regular expressions, and how to keep timestamps when you need a transcript with times.
What an SRT file contains
Each cue in an SRT file has four parts:
42
00:03:15,200 --> 00:03:18,050
We tested three microphones
before the interview started.- A cue number.
- A timecode line with a start time, an arrow and an end time.
- One or two lines of text.
- A blank line before the next cue.
A plain text transcript keeps only part 3, usually joined into sentences and paragraphs.
Convert SRT to TXT in a text editor
Most code and text editors, including VS Code, Sublime Text and Notepad++, support find and replace with regular expressions. Work on a copy of the file, turn on the regex option, and replace each pattern below with nothing:
- Cue numbers:
^\d+\s*$matches lines that contain only a number. - Timecodes:
^\d{2}:\d{2}:\d{2},\d{3} --> \d{2}:\d{2}:\d{2},\d{3}.*$matches every timecode line. - Blank lines:
^\s*$\nremoves the empty lines left behind. Some editors need\r?\nfor files saved on Windows.
Save the result with a .txt extension. You now have the dialogue as short lines, in the original order.
Check one thing before the next step: a line of dialogue that is only a number, such as a countdown, also matches the first pattern. Search the original file for those cues if numbers matter in your video.
Turn subtitle lines into readable paragraphs
Subtitle lines break wherever the screen needed a break, often mid-sentence. To make the text read like a transcript:
- Join lines. Replace line breaks with spaces, then add paragraph breaks back where the topic or speaker changes.
- Remove formatting tags. SRT files sometimes carry italic or color tags around words. Remove them so they do not appear as stray symbols.
- Decide on bracketed descriptions. SDH files include sound descriptions such as
[door slams]. Keep them for an accessible transcript, or remove them with the pattern\[[^\]]*\]for a clean dialogue-only version. - Fix split words and duplicates. Rolling captions from live sources sometimes repeat a line across two cues. Read through once and delete repeats.
Keep timestamps in the transcript
Sometimes you need the times as well: for show notes with chapter markers, for an editor who wants to find a quote, or for research coding. Instead of deleting the timecode lines, shorten them to the start time:
- Replace
^(\d{2}:\d{2}:\d{2}),\d{3} --> .*$with[$1]to turn each timecode into a bracketed start time such as[00:03:15]. Some editors write the group reference as\1instead of$1. - Remove the cue numbers and blank lines as before.
The result is a transcript with a time before each subtitle line, which you can thin out to one timestamp per paragraph.
When the SRT is in another language
If the subtitle file is in a language you need to translate, translate the SRT first and convert it to text afterwards. Translating the SRT keeps every line tied to its timecode, so you can still check the translation against the video. Converting first and translating the plain text loses that link.
Exporting text from Aivently
Aivently accepts SRT, WebVTT, ASS/SSA, SBV, TTML and other subtitle formats, and exports SRT, VTT, ASS, TXT and JSON. After you translate a subtitle file, you can export the result as SRT for the video and as TXT for a plain text version, without running the conversion steps above.
If you are starting from audio or video rather than a subtitle file, Aivently's transcription produces timed text you can review and correct in the editor, then export as TXT or SRT. The file is measured first, so you see the exact credit total before a job runs.
Translate a subtitle file or transcribe audio or video to text.
