Skip to main content
SubtitleMatrix

Limit Lines per Subtitle

Text and stylingRewrap lines
Or paste subtitle text

Options

One box, five choices, and each choice has a page of its own. Wrap re-flows every cue to the column count, which can shorten a line that was too long as easily as it can pull a short line back up. Split long lines breaks only the lines that are over the count and leaves the rest exactly as they were. Balance keeps the number of lines each cue already has and moves the words between them until the longest line is as short as it can be. Join puts each cue onto a single line. Limit leaves alone every cue that is already within the line count. This page fills the box in with the choice its title names and lists no other.

How tall one subtitle is allowed to be. Two is the usual figure. A cue that is already within this count is left untouched; text is never deleted to fit, so a cue that cannot be brought within the count is reported rather than shortened.

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 caps how many lines a cue is allowed to occupy. Give it a number and every cue that is over that number is squeezed down to it, with the words flowing into fewer, longer lines. Every cue that is already within the count is passed through untouched rather than rewritten. Two is the default and the usual figure, because most players and most house styles ask for at most two lines of subtitle at a time.

The constraint here is a line count, not a line width. There is no column box on this page because there is no column limit in play: the words are packed into the allowed number of lines and each line ends up as long as it needs to be. That is the difference between this page and the one that wraps to a column count. If your file is correct in width but has a cue that sprawls over three or four lines, this is the page for it; if the lines are the right number but too wide, the wrapping page is the one you want.

Nothing is ever deleted to reach the count, and that is the rule the rest of the page hangs on. When the lines are all that stand in the way — three ordinary lines of dialogue that can be packed into two — the cues come down to the count. When they cannot, the cue is left over the limit and the run reports it, so you get a number telling you how many cues stayed too tall rather than a file that quietly lost half a sentence.

One case that cannot be packed is worth naming, because it is common. A line starting with a dash marks a change of speaker, and those lines are kept apart from one another; merging two of them would put two people's dialogue on one line. A cue with three speakers and a limit of two therefore stays at three lines and is counted among the cues kept over the limit. Your work happens in the browser with no upload, and the eleven formats whose cues can hold more than one line are accepted: SRT, WebVTT, ASS, SSA, SBV, SAMI, LRC, MicroDVD, TTML, JSON and CSV.

Examples

Three lines squeezed into two

Input

1
00:00:01,000 --> 00:00:04,000
We could take the train
and be there by six
before the shops shut

2
00:00:05,000 --> 00:00:08,000
Already two lines
that fit fine

Output

1
00:00:01,000 --> 00:00:04,000
We could take the train and be
there by six before the shops shut

2
00:00:05,000 --> 00:00:08,000
Already two lines
that fit fine

The first cue was on three lines and comes back on two, re-packed into lines of 30 and 34 columns — longer lines than before, since the count was the constraint and the width was free. Not one word was removed to get there: the same eleven words are in the same order. The second cue was already within the limit, so it was not rewritten at all, which is why running this page on a file that is mostly correct is safe.

A cue that cannot be packed any further

Input

1
00:00:01,000 --> 00:00:04,000
- Then we walk
- All the way home
- And up the hill

Output

1
00:00:01,000 --> 00:00:04,000
- Then we walk
- All the way home
- And up the hill

Three lines against a limit of two, and all three stay. Each begins with a dash, which marks a change of speaker, and a dash-separated block cannot be merged with the one after it without putting two people's words on one line. Width was never the problem here — the three blocks are 14, 18 and 17 columns — so the only way to reach two lines would be to mix the speakers. The cue is left over the limit and counted.

A Chinese cue packed down to two lines

Input

1
00:00:01,000 --> 00:00:04,000
你好世界今天天气
很好我们出去玩吧
顺便买点东西回来

Output

1
00:00:01,000 --> 00:00:04,000
你好世界今天天气很好我们
出去玩吧顺便买点东西回来

Twenty-four Chinese characters on three lines of eight come down to two lines of twelve, which is 24 columns each. Chinese has no spaces, so the packing has a boundary at every character and the two lines come out exactly even. The count that decides this is the number of lines, not their width: these lines are far shorter than the 42 columns a Latin subtitle would allow, and the page is quite happy with that, because nothing it was asked to do concerns width.

Frequently asked questions

How is capping lines per subtitle different from setting a line length?

One fixes the number of lines and lets the width float, the other fixes the width and lets the number of lines float. This page takes a maximum line count and packs the words to fit it, so lines get longer as a cue is squeezed. The wrapping page takes a column count and produces as many lines as the text needs within it, so the number of lines changes instead. A cue that is over both limits needs a decision about which one matters to your player.

What happens when a subtitle cannot be brought within the line count?

It is left over the limit and the run reports how many cues that happened to, rather than being shortened to fit. The usual cause is speaker dashes, which mark lines that cannot be merged with one another. The alternative would be to delete words until the cue fits, and a tool that silently shortened your dialogue to satisfy a number would be worse than one that leaves the cue too tall and tells you.

Why was my two line subtitle left completely alone?

Because two lines is within a limit of two. The count is a ceiling, not a target: a cue that already satisfies it has nothing to gain from being re-packed, and re-packing it would risk moving line breaks that were placed deliberately for how the text reads. That is also why this page is safe to run over a whole file when only a few cues are too tall — the ones that are fine come through byte for byte.

Why were my three dash lines kept over the limit?

Because each dash line is a different person speaking, and the page will not merge two of those onto one line. With three speakers and a limit of two there is no arrangement that both fits and keeps them apart, so the cue stays at three lines and is counted among the cues kept over the limit. If you genuinely want them on one line, the page that removes line breaks will do it and will report how many speaker breaks it joined.

Does capping the line count ever delete text from a cue?

No. Words are moved between lines and never removed, so a cue that goes from three lines to two holds exactly the words it held before, in the same order. The one thing that can disappear is a line that was empty to begin with, since an empty line carries no words and would otherwise be a double gap once the text around it is re-packed. Anything that actually says something stays.

Which subtitle formats can have their line count capped?

The eleven whose cues can hold more than one line: SRT, WebVTT, ASS, SSA, SBV, SAMI, LRC, MicroDVD, TTML, JSON and CSV. Plain text is not offered, because one line of text is one cue in that format and every cue already has exactly one line, so a limit of two could never change anything. The formats are recognised from their content rather than their file name, and no file leaves your machine while the page runs.

Related tools