
Everything runs in your browser. Your text and files are never uploaded to Flipper File.
Find the Longest Line in a Text File
Paste text or load a file, and this tool lists its longest lines as you type, with each line's number and length. Switch to Shortest to find the shortest lines, measure in characters, words, or bytes, and flag every line over a limit you choose. It works with code, logs, CSV and JSON files, subtitles, and any other plain text.
How to use it
- Paste text into the box on the left, or click Load file or drop a file onto the box.
- Choose Longest or Shortest, and how many lines to show.
- Click any line in the results to select it in the input box, so you can see it in context or edit it.
- Use Copy lines to copy the listed lines, or Download report for a CSV with each line's number, length, and text.
Characters, words, or bytes
- Characters counts each letter, number, space, and symbol once. An emoji or accented letter counts as one character.
- Words counts groups of characters separated by spaces or tabs.
- Bytes counts the line's size in UTF-8, the encoding most files and databases use. Accented letters take 2 bytes and most emoji take 4, so this is the number to check against byte limits in databases and APIs.
For code, open More options and set Tab width to 2, 4, or 8. Tabs are then counted the way a code editor displays them, using tab stops, so the lengths match what you see on screen.
Flagging lines over a limit
Enter a number in Flag lines over, and every line longer than that is counted and highlighted in red. Click the link in the note to list all of them in order. Common limits:
| Use | Typical limit |
|---|---|
| Python code (PEP 8) | 79 characters |
| Code style guides for other languages | 80, 100, or 120 characters |
| Git commit message body | 72 characters |
| Title tags | about 60 characters |
| Meta descriptions | about 155 to 160 characters |
| Single SMS text message | 160 characters |
Search engines cut off titles and descriptions by pixel width, not an exact character count, so treat those two as guides.
Finding the shortest lines
The Shortest view helps you find cut-off records in a data file, stray fragments in a list, or lines that are missing text. Empty lines are skipped by default, since they'd always be the shortest. Uncheck Skip empty lines to include them.
Line stats
Along with the list, you'll see the total number of lines and the longest, shortest, average, and median lengths. The median is the middle length when every line is sorted, so a few very long lines don't skew it the way they skew the average.
Frequently asked questions
Is my file uploaded anywhere?
No. Files are read and measured in your browser, and nothing is sent to a server.
How large a file can I check?
Files up to 50 MB. Files over 5 MB are analyzed in full but aren't shown in the text box, to keep the page responsive.
Do line endings count toward the length?
No. Windows (CRLF), Mac, and Linux line endings are all recognized and aren't counted. A file that ends with a line break doesn't get an extra empty line at the end.
What counts as an empty line?
A line with nothing on it, or only spaces and tabs.
Can I ignore indentation?
Yes. Turn on Ignore leading and trailing spaces under More options to measure each line without its indentation or trailing spaces.
