Sort & Dedupe Lines
Sort lines alphabetically, remove duplicates, trim whitespace and strip blank lines — all in your browser.
Cleaning up a raw list of lines is one of those tasks that sounds trivial until you're staring at a 2,000-row export with mixed capitalisation, accidental blank lines, and duplicates scattered throughout. The Sort & Dedupe Lines tool handles all of it in one shot — no scripts, no spreadsheets, no installs.
What this tool does
Paste any block of text, one item per line. The tool processes it in real time and shows the result in the output panel on the right. You control exactly what happens through a handful of toggles and a sort selector:
- Sort A→Z / Z→A — alphabetical ascending or descending using locale-aware comparison.
- Remove duplicates — keeps the first occurrence of each line, drops the rest. Combine with "Case-insensitive" to treat Apple and apple as the same entry.
- Trim whitespace — strips leading and trailing spaces and tabs from every line before any other processing, so " apple " and "apple" deduplicate correctly.
- Remove empty lines — filters out blank or whitespace-only lines, handy after copy-pasting from editors that insert extra newlines.
- Reverse order — flips the final list; useful if you sorted A→Z but actually need Z→A without touching the sort dropdown.
Common use cases
The tool covers a wide range of everyday text-cleaning tasks:
- Deduplicating email lists or user-uploaded CSV rows before importing into a CRM.
- Sorting keyword lists for SEO research or PPC campaigns alphabetically.
- Alphabetising a bibliography or reference list before pasting it into a document.
- Cleaning up log snippets where the same error line repeats hundreds of times.
- Normalising country or city names exported from different data sources before a VLOOKUP.
How to use it
Click Try example to load a sample list with mixed case and duplicates, then watch how toggling the switches changes the output live. When you're happy with the result, hit Copy to put the processed text on your clipboard — ready to paste anywhere.
Because everything runs locally in your browser, it works offline and there is no limit on input size beyond what your device's memory can handle. No sign-up, no rate limits, and your data never leaves your machine.
Frequently Asked Questions
How do I remove duplicate lines from a text file?↓
Paste your text into the Input box, enable the "Remove duplicates" switch, and the output panel instantly shows only unique lines. The first occurrence of each line is kept; subsequent duplicates are dropped.
Can it deduplicate lines ignoring upper/lower case differences?↓
Yes. Turn on both "Remove duplicates" and "Case-insensitive". Lines like "Apple", "apple", and "APPLE" will be treated as identical, and only the first occurrence is preserved.
Does my text get sent to a server?↓
No. Every operation — sorting, deduplication, trimming — runs entirely in your browser using JavaScript. Nothing is uploaded or stored.
What order does the tool apply the operations in?↓
Operations are applied in this sequence: trim whitespace → remove empty lines → deduplicate → sort → reverse. This order ensures the cleanest results (e.g. trimming before deduplication so " apple " and "apple" are treated as the same value).