Text Cleanup
Remove duplicate lines, sort, drop blank lines, trim whitespace, and add numbering with one click.
About this tool
The text tidy tool applies line operations β dedupe, sort, strip blank lines, trim whitespace, add numbers β to a list of lines with a checkbox. It runs in your browser and never sends your input anywhere. Here is how it works, including the things that often explain why a list will not tidy up.
The order of operations decides the result
After splitting into lines, it applies a fixed order: trim, remove blank lines, remove duplicates, sort, add numbers. This order gives intuitive results such as trimming before judging duplicates, so lines treated as distinct only because of a trailing space are correctly merged.
Dedupe is an exact match
Even after trim, lines that differ in case or in full-width vs half-width are treated as different. For deduping email addresses or names, normalize the notation first so duplicates merge cleanly.
Watch for invisible characters
Zero-width spaces slipped in by copy-paste, a BOM at the start of a line, or full-width spaces are impossible to spot by eye. When duplicates of seemingly identical lines will not merge, or the order looks off, these invisible characters are often the cause.
Sorting is locale order
It sorts strings including non-English text in a natural ascending or descending order. Because it uses a locale-aware comparison, the result can differ from a plain character-code sort.
How to use
- Paste your text, one item per line.
- Tick options like "Remove duplicates" or "Sort".
- The result updates instantly β click "Copy result".
FAQ
Is my text sent to a server?
No. All processing runs entirely in your browser (JavaScript), and your input is never sent anywhere. It is safe even for lists containing personal information.
When removing duplicates, which line is kept?
It keeps the first occurrence of a line and removes later identical ones. The order of the first occurrence is preserved (when you do not also sort).
Are lines with surrounding whitespace treated as different?
By default they are compared as-is, but enabling trim removes leading and trailing whitespace from each line before processing, so lines that differ only in whitespace are merged as the same.
Does sorting handle non-English text?
Yes. It sorts strings that include non-English text in a natural ascending or descending order. Because it uses a locale-aware comparison, the result can differ from a plain character-code sort.
What format do the sequential numbers take?
Each line is prefixed with a number starting at 1 followed by a period and a space, like "1. " or "2. ", which is handy for creating procedures or numbered lists.
Can I apply several operations at once?
Yes. Select multiple checkboxes and they are applied together in a fixed order (trim, remove blank, dedupe, sort, number). The fixed order makes the outcome easy to predict.