About this longest line finder
Long lines cause problems in many places: code style guides limit line length, SMS and database fields have size limits, CSV rows with extra content point to broken data, and log lines that run on often hide errors. This tool measures every line and ranks them, so you can find the worst offenders quickly. Length can be counted in characters with or without spaces, in words, or in UTF-8 bytes, which matters for storage limits because accented letters and emoji take more than one byte. Characters are counted as you see them, so an emoji counts as one character. The average ignores empty lines.
How to find the longest line
- Paste your text. Add code, CSV, a log file, or any text, or press an example.
- Choose how to measure. Pick characters, characters without spaces, words, or bytes, and how many lines to rank.
- Press Find longest line. Read the line number and length, compare lines with the bars, and copy the longest line.
Frequently asked questions
Why would I count bytes instead of characters?
Some systems limit size in bytes. In UTF-8, plain English letters take one byte, but é takes two and most emoji take four, so a line can be short in characters yet long in bytes.
How are tabs counted?
A tab counts as one character, not as the number of columns it takes on screen. Use Characters without spaces to ignore indentation completely.
What happens when two lines have the same length?
They are ranked in the order they appear, so the earlier line comes first in the list.
Are empty lines included?
They are counted in the total and shown in the full ranking, but the average length and the shortest line only look at lines that contain something.
Is there a size limit?
The text is processed in your browser, so large files work. The ranking lists up to 1,000 lines to keep the page fast.