How to Remove Timestamps from SRT and Get Clean Text
An SRT file contains useful text buried between sequence numbers and timestamps. When you need a clean transcript for a blog post, show notes, YouTube description, or SEO purposes, stripping the metadata by hand is tedious. Here is how to extract just the spoken words efficiently and correctly.
By CapsAI · Updated 19 August 2026
Key takeaways
- Remove sequence numbers, timestamp lines, and blank separator lines to get clean text.
- Preserve line breaks between subtitle blocks as spaces or paragraph breaks depending on your use case.
- A simple regex can strip all SRT metadata in seconds.
- For Hindi or bilingual content, ensure the stripping process does not damage multi-byte characters.
Why you would want plain text from an SRT
Repurposing video content as written content is one of the most effective strategies for Indian creators building an audience across platforms. Your subtitle file already contains a complete transcript - extracting it gives you raw material for blog posts, LinkedIn articles, newsletter content, or YouTube descriptions that boost SEO.
Clean text is also useful for translation workflows. Sending an SRT file to a translator forces them to work around timestamps. Sending clean text lets them focus on language, and you can re-sync the translated text to timestamps afterward using CapsAI or similar tools.
Manual removal in a text editor
Open the SRT in any text editor that supports regex find-and-replace. Use the pattern ^\d+$ to match and delete sequence number lines. Then use ^\d{2}:\d{2}:\d{2},\d{3}\s*-->\s*\d{2}:\d{2}:\d{2},\d{3}$ to match and delete timestamp lines. Finally, remove the resulting excess blank lines.
After deletion, you will have subtitle text with single blank lines between what were separate blocks. Replace double newlines with a space if you want flowing paragraph text, or keep them as paragraph separators. Review the result for any artifacts like lone formatting tags that were part of the SRT.
- Step 1: Delete all lines that are just a number (sequence IDs).
- Step 2: Delete all lines containing the --> timestamp arrow.
- Step 3: Remove excess blank lines.
- Step 4: Join remaining text into paragraphs as needed.
- Step 5: Remove any stray HTML tags (<b>, <i>) if present.
Start with 3 free minutes
Put Accurate Captions Into Practice
Create editable subtitles with CapsAI, then review Indian names, brands and places using the workflow in this guide.
Using a one-line command
On Mac or Linux, a single command can strip an SRT file: grep -v -E '^[0-9]+$|^[0-9]{2}:[0-9]{2}:[0-9]{2}|^\s*$' input.srt > output.txt. This filters out numeric lines, timestamp lines, and blank lines, leaving only the subtitle text. The output file contains one line per original subtitle entry.
For Windows users, PowerShell offers a similar approach: Get-Content input.srt | Where-Object { $_ -notmatch '^\d+$' -and $_ -notmatch '^\d{2}:' -and $_.Trim() -ne '' } | Set-Content output.txt. Both commands preserve UTF-8 encoding, which is important for Hindi and other Indian language subtitles.
Handling bilingual and multi-script SRT files
If your SRT contains both Hindi and English (common for Indian YouTube content), the extraction process is identical. The timestamp and sequence number patterns are always ASCII, so removing them never touches Devanagari or other script characters. Your output will contain the mixed-language text exactly as it appeared in the subtitle blocks.
One edge case to watch for: some SRT files contain position tags or font tags like {\an8} from video editing software. These are not standard SRT but are common in practice. Add them to your removal pattern or clean them manually after extraction. They appear as gibberish in plain text and serve no purpose outside a subtitle renderer.
Frequently asked questions
Will removing timestamps lose the timing information permanently?
Yes, the output text file has no timing data. Always keep your original SRT file as the source of truth. The plain text extraction is a one-way derivative for content repurposing.
Can I re-add timestamps to the extracted text later?
Yes, but you will need to re-sync it. Tools like CapsAI can take plain text and the original video to generate fresh timestamps. It is essentially re-captioning from a pre-written script.
Does this work for VTT files too?
The same principle applies but the regex patterns differ slightly. VTT uses dots instead of commas in timestamps and has a WEBVTT header to remove. Adjust your patterns or convert to SRT first, then strip.
Start with 3 free minutes
Create Your Next Subtitle with CapsAI
Upload a video and generate editable AI subtitles with 3 free minutes to get started.