Skip to main content
SubtitleMatrix

Fill Gaps Between Subtitles

TimingExtend short cues
Or paste subtitle text

Options

Milliseconds of blank screen allowed between one cue ending and the next beginning. The blank is measured from the furthest end reached so far, not from the cue immediately before it, so a long cue sitting under several short ones does not invent a gap that was never on screen. What the number does depends on the page you are on: closing gaps closes anything wider than it (0 is the usual value and means the two meet exactly), while a check page lists every stretch wider than it and leaves the file alone. Anything at or under the number is left alone either way.

The blank between two cues has two edges: the earlier cue's end and the later cue's start. End moves the earlier cue's end, so closing a gap lengthens that cue and widening one shortens it; the later cue keeps its timing to the millisecond. Start moves the later cue's start instead and leaves the earlier cue alone. Pick the one whose timing you trust more — usually the cue whose text is spoken last, since a cue should not appear before its line is heard.

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 closes the blank screen between one subtitle and the next by holding the earlier cue on screen longer. Fill in the largest gap you are willing to leave and every wider one is closed to exactly that: the earlier cue's end time moves forward, the later cue is not touched, and both cues keep their own text. A limit of 0, which is where this box starts, means the two meet exactly — subtitle after subtitle with no dark frames in between.

It is worth being clear about what this is not. Merging two cues into one is a different page, and it produces a different file: here the two lines stay two cues, each with its own style, position and karaoke timing, and the timeline preview shows them as two bars that now touch rather than one long bar. If the two lines are two halves of one sentence and you want them read as one, merge them; if they are two separate things that merely had a pause between them, hold the first one longer.

The direction of travel is the whole point of this page and it always succeeds: two cues can always be made to sit edge to edge, so whatever number you put in the box is reached exactly. The earlier cue ends where the later one begins, and never past it.

Which edge moves is yours to choose. End, the default, lengthens the earlier cue; Start pulls the later cue's start back instead and leaves the earlier cue exactly as it was. Start is the one to use when the later cue was written too late — a line that should appear the moment the previous one goes. As everywhere on this site the file is read and written inside the browser tab, with nothing uploaded: SRT, WebVTT, ASS, SSA, SBV, SAMI, MicroDVD, TTML, JSON and CSV are all accepted, and a file whose content did not change comes back byte for byte.

Examples

Two gaps, both closed

Input

1
00:00:01,000 --> 00:00:02,000
First line.

2
00:00:06,000 --> 00:00:07,000
Second line.

3
00:00:07,420 --> 00:00:08,000
Third line.

Output

1
00:00:01,000 --> 00:00:06,000
First line.

2
00:00:06,000 --> 00:00:07,420
Second line.

3
00:00:07,420 --> 00:00:08,000
Third line.

The limit here is 0, so both gaps close completely: the first line is on screen for five seconds instead of one, and the second for 1420 ms instead of 1000. The third cue never moves, and there are still three cues in the file — the text was not merged. Both times the cue that changed is the one on the left of the gap.

A gap exactly at the limit, and one a millisecond over

Input

1
00:00:01,000 --> 00:00:02,000
First.

2
00:00:02,200 --> 00:00:03,000
Second.

3
00:00:03,201 --> 00:00:04,000
Third.

Output

1
00:00:01,000 --> 00:00:02,000
First.

2
00:00:02,200 --> 00:00:03,001
Second.

3
00:00:03,201 --> 00:00:04,000
Third.

With the limit at 200, a gap of exactly 200 is inside the limit and is left alone, while a gap of 201 is shortened to exactly 200 — the second cue ends one millisecond later than it did. The two are decided differently on purpose: a gap sitting exactly on your number is a gap that meets your requirement, and treating it as work would turn a limit one millisecond too low into a change to every gap in the file.

The same file with the other edge moving

Input

1
00:00:01,000 --> 00:00:02,000
First.

2
00:00:05,000 --> 00:00:06,000
Second.

Output

1
00:00:01,000 --> 00:00:02,000
First.

2
00:00:02,000 --> 00:00:06,000
Second.

This is the run above with Start chosen instead of End. The first cue keeps the timing it had and the second one now appears the instant the first disappears, so it is the second cue that grew — four seconds on screen rather than one. Both runs close the gap; they differ in which line you decided to trust.

Frequently asked questions

Does closing the gaps merge my subtitles into a single cue?

No, and that is the difference between this page and the one that merges neighbouring cues. Here the two sentences stay in two cues, each keeping its own text, style, position and any per-word timing, and the cue count of the file does not change. Merging produces one cue running from the first line's start to the second's end with the two texts joined, which loses the styling of the second cue and changes the count. If two lines are two halves of one sentence, merge them; if they are separate, hold the first one longer.

What does a gap limit of zero actually do?

It makes every cue end exactly where the next one begins, so the subtitles run continuously with no dark frame in between. That is the usual first run on a file that was cut by hand or converted from another tool, and on the timeline preview it turns a row of separated bars into an unbroken string. Zero is a real request here rather than an empty box: it says gaps of at most nothing, which every gap wider than nothing then has to meet.

Which cue's timing changes when a gap is closed?

Whichever edge you chose. With End, which is the default, the earlier cue's end time moves forward and the later cue keeps its timing to the millisecond; the earlier cue is simply on screen for longer. With Start, the later cue's start time moves back and the earlier cue is untouched. There is no setting that moves both, because moving both would change where the pair sits on the timeline rather than only the space between them.

Can the tool make one subtitle start before the previous one has ended?

No. Only one edge of the pair moves and it stops at the other cue's boundary, so closing a gap can bring two cues together but never past each other. A file in which the earlier cue already ends after the later one begins has overlaps, not gaps, and holding the earlier cue longer would make that worse — that file wants the page that removes overlaps first.

What happens when I set the limit higher than some of my gaps?

Those gaps are widened to exactly the limit, not left as they were: the request is 'no gap wider than this', so every gap above the number is drawn down to it, and the first cue in the file can grow a long way. A very large number leaves nothing to do, because no gap in the file is wider than it — which is a safe first run on a file whose gaps you have not looked at yet.

Does the styling of each cue survive the run?

Yes, entirely. This page never touches text and never joins cues, so an italic line stays italic, an ASS cue keeps its style, position and layer, and a WebVTT cue keeps its region or alignment. The only thing that changes is the end time of the cue on the left of each gap, or its start time if you chose Start. That is why it is the right tool where the two lines have to keep their own look but not their pause.

Related tools