The order things happen in
When several options are on, the order changes the result, so the cleaner always works through them in the same sequence:
- Line endings are normalised, so Windows (CRLF), old Mac (CR) and Unix (LF) breaks all count as one kind of line break.
- If you gave a separator, each line is split at it.
- Spaces are trimmed from the start and end of each line.
- Runs of spaces and tabs inside a line become one space.
- Blank lines are removed.
- Duplicate lines are removed.
- Lines are sorted or reversed.
- Your text is added to the start and end of each line.
- Lines are joined into one, if you asked.
Because trimming comes before duplicate removal, " Wellington" and "Wellington " become the same line before duplicates are checked. Because prefixes come last, a sort isn't thrown off by the quotes or bullets you add.
A worked example
This list of cities has stray spaces, two blank-looking lines and repeats that differ in case:
Wellington
auckland
Wellington
Christchurch
Auckland
Dunedin
With trim, "remove empty and whitespace-only lines", duplicates ignoring case, and A to Z sorting, the cleaner returns 4 lines and reports 2 blank and 2 duplicate lines removed:
auckland
Christchurch
Dunedin
Wellington
Notice that the first spelling of each city is kept. That's what "keep the first copy" means; choose "the last copy" to keep later versions instead.
Pages for single jobs
If you only need one thing done, these pages open the same cleaner with the right options already set, and explain the details of that job: removing duplicate lines, removing blank lines, sorting lines alphabetically, and adding text to the start and end of lines. To count words and characters instead, use the word and character counter.
Where messy lists come from
Columns copied out of a spreadsheet often carry trailing spaces and empty cells. Lists pasted from an email pick up blank lines between every item. Text copied from a PDF can have tabs, double spaces and lines broken in odd places. Exports from different systems repeat the same entries with different capitals. Each of these is one or two switches here, and the counts at the top of the results show how many lines each run removed, so you can see the effect before copying.
Limits and privacy
The cleaner accepts up to 2,000,000 characters, which is around a million very short lines. Text over 200,000 characters is processed in a background thread of your browser, so the page stays responsive while it works. Everything happens on your device: your text, prefixes and separators aren't sent anywhere, saved, or added to the page address. Only your on/off choices are kept after the # sign, so a bookmark reopens the cleaner set up the same way. Copy the result before you close the tab.
Questions people ask
Does the cleaner change the text inside a line?
Only if you ask: trimming touches the ends of lines, and collapsing turns runs of spaces or tabs into one space. Letters, punctuation and case are never changed.
Can I undo a step?
Your original text stays in the input box, so turning an option off brings the result back. "Use result as input" replaces the original, so copy it first if you need it.
Last reviewed: