Sort & Dedupe Lines.
Sort lines alphabetically or naturally and remove duplicates.
Runs in your browserAbout Sort & Dedupe Lines
Sort & Dedupe Lines takes any list with one item per line and puts it in order. You can sort A to Z, Z to A, or keep the original order and only drop repeats. Natural sort compares the numbers inside each line by value, so file2.txt comes before file10.txt instead of after it, which is what you usually want for file names, versions and IDs. Comparison is case-insensitive by default, so "Apple" and "apple" count as the same line and only the first one you entered is kept. Turn on case-sensitive mode when the letter case matters, for example with Base64 strings or environment variable names. Trimming strips leading and trailing spaces and tabs, which catches the common mistake of two lines that look identical but differ only by a trailing space copied from a spreadsheet. The stats panel shows how many lines went in, how many came out and how many duplicates were removed, so you can check the result at a glance. Typical uses include cleaning up email lists, deduplicating log lines, sorting import statements or package lists, and preparing values for a SQL IN clause. The tool works with lists of up to 5 MB; anything larger than 100 KB is processed in a background worker so the page stays responsive. Your text never leaves the browser: there is no upload, no server call and no storage.
How to Use
- Paste your list into the Lines field, one item per line.
- Choose the order and switch the options on or off; the result updates as you type.
- Copy or download the result.
Frequently Asked Questions
What is natural sort?
Natural sort compares runs of digits as numbers, so "item 9" comes before "item 10". Plain alphabetical sort compares character by character and would put "item 10" first.
Which duplicate is kept?
The first occurrence in your original input is kept. Later lines that are equal to it (after trimming and, unless case-sensitive is on, ignoring case) are removed.
Can I remove duplicates without sorting?
Yes. Set Order to "none". The lines stay in their original order and only the repeats are removed.
Is my data sent anywhere?
No. Sorting runs in your browser. The page makes no network requests while you use it, and the input is kept in the shareable link only when it is shorter than 2 KB.
Related Tools
Convert text between case formats.
Count characters, words, sentences, and more.
Escape and unescape strings for different formats.
Compare two texts and see the differences.
Turn text into big ASCII art letters with the classic FIGlet Standard font.
Search emoji and Unicode symbols by name, copy the character and its code points.