Line Sorter & Deduplicator
Sort text lines, remove exact duplicates, and optionally trim whitespace. Includes examples and details about case sensitivity, blank lines, and ordering.
How to process a list
- Paste one item per line.
- Choose whether to keep the original order or sort the lines.
- Leave duplicate removal enabled to retain only the first occurrence of each exact line.
- Optionally trim whitespace at each line’s edges, then select Process lines.
A simple example
banana
apple
bananaWith original order and duplicate removal, the result is banana followed by apple. With ascending text order, the result becomes apple followed by banana.
Exact matching matters
Matching is case-sensitive. Apple and apple remain separate lines. Spaces are significant unless Trim line edges is enabled; trimming happens before duplicate detection. This can deliberately merge a line with leading spaces into its unindented counterpart.
Blank lines are retained. If duplicates are removed, multiple blank lines collapse into one. A final line ending creates an empty final item. Output uses LF line endings, so this tool is not a byte-for-byte file editor.
Text order is not numeric order
Sorting uses deterministic JavaScript string comparison by UTF-16 code units. It does not apply locale-specific alphabet rules or natural numeric sorting. For example, 10 sorts before 2 in ascending text order. Use a numeric workflow for lists of quantities.
Frequently asked questions
Will this understand CSV records with embedded newlines?
No. It operates on physical text lines. Use the CSV / JSON converter for quoted CSV tables.
Can it compare two lists?
This tool processes one list. Use Text Compare to review differences between two blocks.
Does it change the original file?
No file is opened or overwritten. Keep the original text and review the result before replacing it elsewhere.
