Skip to content
Tezmy Tools

Line Length Finder

Find the longest and shortest lines in your text, with line numbers and character counts

Paste or type text. Each line is measured separately and empty lines are skipped when finding the shortest. Emoji count as one character.

Paste some text to see its longest and shortest lines.

Runs in your browser. Nothing is uploaded.

About the Line Length Finder

Paste any text, such as code, a list, a CSV export or a poem, and the line length finder shows how long each line is, which lines are the longest and shortest, and how they rank. It reports the number of lines, how many are empty, the average length of the lines that have text, the longest and shortest lines with their line numbers and a top-5 ranking. Empty lines are counted but are not treated as the shortest line, which would not tell you anything useful. Characters are counted as people see them in most cases: letters with accents and most emoji count as one. The text stays in your browser.

Updated October 2026

How to use the Line Length Finder

  1. 1Paste or type your text into the box.
  2. 2Read the number of lines, empty lines and the average length.
  3. 3Look at the longest and shortest lines and their line numbers.
  4. 4Check the top five lines by length for a quick overview.
  5. 5Copy the summary if you want to paste it into a report or a code review.

Why check line lengths

Long lines hurt readability, whether you are writing code, prose or data. Style guides such as PEP 8 for Python set a limit to keep files readable side by side in an editor or a code review. In data files, an unexpectedly long line often means a missing separator, a field with unquoted text or two records that have run together. A very short line can mean a broken row or a stray character. Finding these outliers by eye in a long file is slow, and this tool does it at once.

Reading the results

The longest line and the top-5 list show where to start if you need to shorten text. The shortest lines point to fragments and stray characters. The average tells you whether your text is mostly short or long lines, and the difference between the average and the longest line shows how extreme the outliers are. A large number of empty lines may mean double spacing or leftover formatting. Line numbers match the text you pasted, counting from 1, so you can jump straight to the right spot in your editor.

A quick example

Paste three lines: Short, A very long line and Hi. The longest line is line 2 with 16 characters, the shortest is line 3 with 2 characters, and the average is about 7.67. Add a blank line between two of them and the empty line count becomes 1 while the shortest line stays the same.

Related tools

Features

  • Longest and shortest lines with line numbers
  • Top 5 lines ranked by length
  • Line count, empty line count and average length
  • Empty lines are skipped when finding the shortest
  • Accents and most emoji count as one character
  • Handles Windows and Mac line endings
  • Instant results as you type; runs in your browser

Frequently asked questions

How does it count characters?

It counts Unicode characters rather than bytes. A letter with an accent counts as one, and most emoji count as one. Emoji that are built from several parts, such as family or flag emoji, count as more than one, because they are made of several characters joined together.

What counts as an empty line?

A line with no characters at all. A line that contains only spaces is not empty, because the spaces are characters. A single line break at the very end of the text does not add an extra line.

Why isn't an empty line shown as the shortest line?

If it were, a text with any blank line would always report a shortest length of zero, which tells you nothing. The shortest line is the shortest line that has text. The number of empty lines is shown separately.

Can I use it to check code line length limits?

Yes. Many style guides limit lines to 80, 100 or 120 characters. Paste your code and check the longest line. If it is over the limit, its line number and content are shown so you can find and shorten it. Tabs count as one character each.

What if several lines share the longest length?

All lines with the maximum length are listed as the longest, up to ten. The same applies to the shortest lines. The top-5 ranking puts lines of equal length in the order they appear in the text.

Is the average length of all lines?

It is the average of the lines that have text, not of the empty ones, because blank lines would drag the figure down. For example, lines of 5 and 2 characters with a blank line between them average 3.5.

Related tools