How to use the line counter
Paste text into Input and the bar at the top counts it immediately: total lines, non-empty lines, blank lines, unique lines, duplicate lines, words, characters and the length of the longest line. The duplicates tile turns amber when the list contains repeats, so you know before you start whether deduplication will change anything.
The three groups of options — Clean, Order and Add — transform a copy of the list into Output, live, without touching what you pasted. The sentence under the boxes reports exactly what happened: “1,204 lines out of 1,380 — trimmed 12 lines, removed 41 blank lines, removed 135 duplicates, sorted A → Z”. Copy or download the result, or press Use as input to make the output your new starting point for another pass. Your option choices are remembered next time; your text is not.
For breaking a paragraph into lines, or joining lines back into a paragraph, the remove line breaks tool is the better fit. To count how often each word appears rather than each line, use the word frequency counter.
The order options are applied in
When several options are ticked they always run in the same sequence, so the output is predictable:
- Trim removes spaces and tabs from both ends of each line.
- Remove blank lines drops lines that are empty or contain only whitespace.
- Remove duplicates keeps the first occurrence of each line and drops later repeats. Case-sensitive is on by default; untick it and Apple, APPLE and apple count as one, with the first spelling kept.
- Sort, then reverse, then shuffle.
- Numbers, prefix and suffix are added last, so they never affect sorting or duplicate detection.
Because trimming runs before deduplication, apple and apple (with trailing spaces) only count as duplicates when Trim is ticked — the most common reason a “remove duplicates” tool appears to miss some. Invisible characters such as non-breaking spaces and zero-width spaces pasted from web pages can have the same effect; if two lines look identical but are not merged, one of them contains a hidden character.
Sorting: alphabetical, natural and by length
| Sort | Result for: item 10, Item 2, éclair, apple | Use it for |
|---|---|---|
| A → Z | apple, éclair, item 10, Item 2 | Names, words, general lists |
| Natural | apple, éclair, Item 2, item 10 | File names, versions, numbered items |
| Length | apple, Item 2, éclair, item 10 | Finding outliers, tidying code |
Alphabetical sorting uses your browser’s language rules, so accented letters sort with their base letter and capitals sit with lower case rather than all coming first, as they would in a plain computer sort. Natural sorting reads runs of digits as numbers, so file2 comes before file10. Every sort is stable: lines that compare equal stay in their original relative order. Lists of more than 150,000 lines fall back to a faster character-by-character alphabetical sort so the page stays responsive.
Shuffle uses the browser’s cryptographic random generator. The shuffled order is kept while you adjust other options, so adding a prefix doesn’t reshuffle everything; press Shuffle again for a new order. For drawing random winners or numbers, the random number generator is built for that job.
How lines are counted
A line is everything between two line breaks. Windows files use CRLF (\r\n) and Mac, Linux and the web use LF (\n); both are read correctly, and a pasted mixture is normalised. A single line break at the very end of the text does not create an extra, empty line — most text editors and the Unix wc -l command disagree by exactly one on this, and ours matches what you see. Blank lines are lines that are empty or contain only spaces and tabs.
Output uses LF by default, which every modern system understands. Choose CRLF if you are pasting into an old Windows tool, a CSV importer that expects it, or a system that shows everything on one line. Characters are counted as user-perceived characters, so an emoji or an accented letter is one, and the longest-line figure uses the same rule.
Frequently asked questions
How do I remove duplicate lines but ignore upper and lower case?
Tick Remove duplicate lines, then untick Case-sensitive. Lines that differ only in capitalisation are treated as the same and only the first one is kept, with its original spelling. Tick Trim as well if some lines may have stray spaces at the ends, otherwise those lines will not be recognised as duplicates.
Why doesn't my line count match my text editor?
Usually because of a trailing line break. If your text ends with a newline, some editors show an extra empty line and wc -l counts differently; we do not count that final empty line. Line wrapping also matters: an editor with word wrap shows one long line across several rows, but it is still one line here.
Is there a limit to how many lines I can paste?
There is no fixed limit. Lists of a few hundred thousand lines count and clean in well under a second on a typical laptop, and very large sorts switch to a faster method to keep the page responsive. Your browser’s memory is the only real ceiling, and nothing is uploaded, so confidential lists stay on your device.
Can I add quotes and commas to every line to make a list for code or SQL?
Yes. Put a quote mark in Prefix and a quote followed by a comma in Suffix, and every non-blank line becomes 'item', ready to paste into an array or an SQL IN clause. Remove the comma from the last line by hand, or tick Remove blank lines first so there are no empty entries.
How do I number lines starting from zero or with leading zeros?
Tick Number lines, set Start at to 0 (or any number, including negatives), and choose Zeros under Padding to get 001, 002 and so on up to the width of the largest number. Change the After number field to a tab, a colon or a closing bracket to match your format. Blank lines are skipped unless you untick that option.