Longest line finder

Find which lines are too long, and by how much.

Your inputs stay on your deviceFREE · NO SIGN-UP
Flag lines over
chars
Measured in

Characters are counted the way a reader counts them, so an emoji made of several code points is one. Every line is measured, blank ones included, and the lines over the limit are listed with their line number and length. Up to 200,000 characters.

Result

Start typing and the result appears here. No button needed.

THE LITTLE DETAILS

Longest line finder, without the extra steps.

Measure every line and find the ones that break a limit. The summary reports how many lines there are, the longest and its line number, the average, and how many are over your limit; the result lists each offending line with its number and length so you can go straight to it.

How to use this tool

  1. 1Paste the lines you want to measure.
  2. 2Set the limit and choose whether it is counted in characters or UTF-8 bytes.
  3. 3Read the summary, then copy the list of lines that are over.

When Longest line finder is the right tool

  • An import keeps failing because one field is over the column's limit, and the error does not say which row.
  • Subtitle lines have to stay under about 42 characters so they fit two lines on screen.
  • A batch of meta descriptions needs checking against a 160-character guideline before it goes live.
  • A code review flags line length, and you want the offending line numbers rather than a vague complaint.

Characters and bytes are different answers

A limit written as "255 characters" in a spreadsheet is usually enforced as 255 UTF-8 bytes by whatever stores the data. For plain English the two agree; the moment an accented letter, a currency symbol, or an emoji appears they diverge — é is two bytes, a family emoji is twenty-five or more. That is why the unit is a control rather than an assumption: the same line can pass a character check and fail the import. Switch the unit and the count changes in front of you.

The line number is the point

Knowing that something is too long is only half an answer; the useful output is which line, so you can go to it. Lines are numbered from 1 in the order pasted, blank lines included, which is what makes the number line up with the editor you came from. Each flagged line is listed as number, length, then the text itself, separated by tabs — readable on screen, and two columns and a value when pasted into a spreadsheet.

Length is not width

This measures the text, not how wide it looks. A tab is one character here and eight columns in most editors; a proportional font makes an i and a W different widths at the same character count. For a hard limit — a database column, a protocol field, a style rule expressed in characters — the text measurement is the one that matters. For anything defined by what fits on a screen, treat the number as a guide and check the rendering.

GOOD TO KNOW

A few quick answers.

Characters when a person or a style rule counts them — a caption, a headline, a code line limit. Bytes when a system enforces the limit: database columns, file formats, and protocol fields are almost always defined in UTF-8 bytes, where an accented letter is two and an emoji four or more. The same text can pass one and fail the other.

Lines are numbered from 1 in the order you pasted them, counting blank lines, which is what makes the number match your editor. The longest line's number is in the summary, and every line in the result starts with its number and length, separated by tabs so it pastes into a spreadsheet.

No. A tab counts as one character here but can occupy eight columns in an editor, and proportional fonts make two lines of equal length different widths. This measures the text itself, which is what a length limit is defined in.

Yes, they are measured as zero-length lines and counted in the total, because leaving them out would shift every line number after the first gap and make the result useless for finding anything. A trailing newline at the very end ends the last line rather than creating an extra empty one.

It is the mean length across every line, rounded, and it is mostly useful as context for the longest: a document averaging 60 characters with one line at 400 has a stray paste in it, while one averaging 300 is simply prose that has not been wrapped. It is not a target.

Set the limit to 1 and every line with any content is listed with its length. That is also the quickest way to produce a length-per-line table for a spreadsheet, since each row arrives as line number, length, and text separated by tabs.

Back to all tools