Line cleaner
Remove blank/duplicate lines, trim spaces and sort in one click.
Copying a list out of a spreadsheet, a PDF, or an email usually leaves you with something unusable — stray blank lines, trailing spaces you cannot see, and the same entry repeated four times.
This tool takes that block of text and applies the tidy-up steps you choose, then reports how many lines you started with and how many you ended up with.
How it works
The options, and the order they run in
The steps always run in a fixed sequence, which matters when you combine them:
- Trim each line — strips spaces and tabs from the start and end of every line.
- Remove blank lines — drops any line that is empty or contains only whitespace.
- Remove duplicates — keeps the first occurrence of each line and discards later repeats. Original order is preserved.
- Sort — no sort, A→Z, Z→A, or by length (shortest first).
- Number lines — prefixes each surviving line with
1.,2., and so on.
Because numbering happens last, the numbers always match the final output. And because trimming happens first, two lines that differ only by a trailing space will be recognised as duplicates — which is usually what you want.
Case-insensitive dedupe
By default, duplicate removal is exact: Apple and apple are two different lines. Tick Case-insensitive dedupe and they are treated as the same entry, with the first spelling you pasted being the one that survives. This option only has an effect when Remove duplicates is also on.
Sorting
Alphabetical sorting uses locale-aware comparison, so accented Latin characters and Hangul are ordered sensibly rather than by raw character code. Sorting by length compares character counts, which is a quick way to spot outliers — a stray header row or a truncated entry usually sits at one end of the list.
Reading the counter
Under the output you will see something like 240 → 187 lines. The gap tells you how much was blank or duplicated. If the two numbers are identical, none of your enabled options matched anything.
Practical notes
Everything runs in your browser, so nothing is uploaded. The result box is read-only — use Copy result to put it on your clipboard. If you need a different combination, change the checkboxes and press Clean up again; the original text stays in the input box, so you can experiment without re-pasting.
Terms explained
- Trim
- Removing whitespace from the beginning and end of a line. Invisible trailing spaces are a common reason two identical-looking lines are not treated as duplicates.
- Deduplicate
- Keeping only the first occurrence of each repeated line and discarding the rest.
- Case-insensitive
- Treating uppercase and lowercase as equivalent, so that Apple and apple count as the same line.
- Blank line
- A line that is empty or contains nothing but spaces and tabs.
- Locale-aware sort
- Alphabetical ordering that follows language conventions rather than raw character codes, so accented and non-Latin characters land in the expected place.
Frequently asked questions
Which line survives when duplicates are removed?
The first one, in the order you pasted them. Later copies are dropped, and the surviving lines keep their original positions unless you also apply a sort.
Can I remove duplicates without changing the order?
Yes. Leave the sort option on No sort. Deduplication on its own never reorders anything — it only deletes the repeats.
Why are two lines that look the same not treated as duplicates?
Almost always an invisible difference: a trailing space, a tab, a non-breaking space, or different capitalisation. Turn on Trim each line, and Case-insensitive dedupe if the difference is upper versus lower case.
Does it handle very long lists?
It handles lists of several thousand lines comfortably, since the work is done locally in your browser. Extremely large pastes may make the page pause for a moment while it processes.
Is my text uploaded anywhere?
No. All processing happens in your browser and nothing is sent to a server or saved.
Tell us what went wrong and we'll fix it fast. (Leave an email if you'd like a reply.)