Skip to main content
SubtitleMatrix

Remove Timestamps from Subtitle Text

Text and stylingRegular expression replace
Or paste subtitle text

Options

A regular expression, matched against the text of each cue. Every match is replaced. The two pages in this section share the box: one opens it empty for a pattern you already have, the other starts it off with a pattern you can edit either way.

What each match becomes. Leave it empty to delete every match. Unlike the literal find-and-replace page, a dollar sign here is special: $1 stands for the first bracketed group of the match, $& for the whole match, and $$ for a literal dollar sign.

The letters the pattern is compiled with. g and u are on by default: u makes the pattern read the text a character at a time rather than a code unit at a time, which is what makes \p{L} and friends mean what they say. Add i to ignore case, m for line anchors, s to let a dot match a line break. Clear the box to compile with no flags at all. Any other letter is refused rather than ignored, because a pattern run under flags you did not ask for is a pattern that quietly means something else.

Which frame rate the timings are counted in. On the format pages this is what MicroDVD needs, because it stores timing as frame numbers. On the frame rate pages it is the rate the file was timed against — the version the subtitles were made for — and the page's second box takes the rate of the video you are going to use them with. 23.976, 24, 25, 29.97, 30, 50, 59.94 and 60 are the common ones. Getting it wrong shifts the whole timeline, and on the frame rate pages it shifts it by a ratio rather than by a fixed amount.

This page removes the timestamps printed inside the text of a cue — the `[00:00:01]` a transcript, an auto-caption export or a rough cut tends to carry at the start of every line. Those stamps are part of the words, not part of the subtitle: they are on screen, they are what a reader sees, and this page takes them out along with the bracket and the space that followed. The cue times themselves, the ones the player uses, are not touched at all.

It is deliberately not a page that deletes anything in brackets. Sound cues stay — `[door slams]`, `[phone rings]`, `(music)` are information a hearing-impaired track is required to carry, and a transcript full of stamps is exactly the kind of file that also has them. Numbers that merely look like times stay as well: `10:30` is a time of day and has no seconds, and `12:34:56:07` is a frame-based timecode with four parts, not a clock. Only a stamp with hours, minutes and seconds goes.

The pattern in the box is what decides that, and you can edit it. Both ends of it check the characters next to a candidate — if the character before or after is a digit or a colon then this is part of something longer and none of it belongs to us. That check is not decoration: without it, the engine happily starts in the middle of `12:34:56:07` and the line comes back as `SMPTE 12:` plus whatever followed, with the page reporting one removal. If your files use a different shape — `MM:SS` with no hours, or stamps in curly brackets — change the pattern rather than working around it.

Nothing is uploaded, each file is written back in its own format, and a folder of transcripts can go through the queue in one go. Where a cue's whole text was a stamp, the cue stays and its text is empty: a gap in the timeline is a different problem from a line that should not be there, and the quality tools are the place to look for it.

Examples

A transcript that carries the moment of every line

Input

[00:00:01] We should go.
[00:00:05] The train leaves at 10:30.

Output

We should go.
The train leaves at 10:30.

Both stamps go, with the brackets and the space after them. The second line is the one to look at: 10:30 is a time of day with two parts and no seconds, so it is left exactly where it is. That distinction is the whole reason this page runs a pattern rather than deleting anything inside brackets.

Stamps inside a real subtitle file

Input

1
00:00:01,000 --> 00:00:04,000
[00:00:12] (phone rings)

2
00:00:05,000 --> 00:00:08,000
(00:01:02.500) So I said yes.

Output

1
00:00:01,000 --> 00:00:04,000
(phone rings)

2
00:00:05,000 --> 00:00:08,000
So I said yes.

Square brackets, round brackets and milliseconds — all one rule. The sound cue and the sentence both come out starting at the left edge, and the cue times at the top of each block are untouched because they are the file's timeline rather than text.

Everything that looks like a timestamp and is not

Input

1
00:00:01,000 --> 00:00:04,000
SMPTE 12:34:56:07 and a ratio of 1:2:3 here.

2
00:00:05,000 --> 00:00:08,000
Call me at 10:30.

Output

1
00:00:01,000 --> 00:00:04,000
SMPTE 12:34:56:07 and a ratio of 1:2:3 here.

2
00:00:05,000 --> 00:00:08,000
Call me at 10:30.

The file comes back byte for byte, which is the point. A frame timecode, a ratio and a clock time with no seconds are all left alone — and the frame timecode is the sharp case, because a pattern without the check in front of it starts three characters in and eats `34:56:07`, leaving a line that reads `SMPTE 12:` and looks almost plausible.

Frequently asked questions

Do the cue times change when the stamps are removed?

No. The lines this page edits are the words on screen; the start and end times that the player reads are in the file's structure, and they come back untouched, along with the cue numbers and the order of the cues. If a file needs its timeline moved, that is what the timing tools are for.

Why is a time like 10:30 still there?

Because it has two parts and no seconds, and the pattern asks for hours, minutes and seconds in that order. A stamp removed by this page is a position in a recording; 10:30 is a time of day that somebody said out loud, and deleting it would change what the character said. If your files really do carry two-part stamps, drop the hours from the pattern and add the guard back in front of it.

Will it remove a frame timecode like 12:34:56:07?

No, and that is the case the pattern was written around. Both ends of it check the neighbouring character: if the character before or after a candidate is a digit or a colon, the candidate is part of something longer and is left alone. Without that check the engine would start three characters in and remove `34:56:07`, turning the line into `SMPTE 12:` — a plausible-looking line that has lost information.

Why did the sound cues in my file survive?

Because they are not timestamps. A pattern that removes `[00:01:23]` has no reason to touch `[door slams]`, and that is deliberate: non-speech information is exactly what a hearing-impaired track is for, and files carrying printed stamps are often the ones that carry it. If you want bracketed text gone as a class, there is a separate page that removes any matched pair of brackets and closes the gap behind it.

Can I change the pattern?

Yes — the box is editable and it is a full regular expression box, so anything from the general pattern page works here. The two things worth keeping are the bracket group that goes with the stamp and the space after it, and the guards at either end, since without them a longer number can be cut in half. If your stamps are `MM:SS` with no hours, removing the hours group is the edit you want.

What happens if a cue was nothing but a timestamp?

The stamp goes and the cue's text becomes empty, so that cue shows nothing for its few seconds. The cue itself is not deleted: a hole in the timeline is a different problem from a line that should not be printed, and removing text is this page's whole job. Empty cues are easy to find afterwards with the quality tools, which is the right place to decide what they should become.

An LRC file's timestamps are the format's own — are those removed?

No. In an LRC file the `[mm:ss.xx]` at the start of a line is the file's timing, and this page only edits the words of a line, never its timing. The same goes for an SRT's cue numbers and timecodes or a WebVTT file's cue settings. A stamp is only removed when it is printed inside the text itself.

Related tools