Remove Duplicate Lines & Sort
Paste a list and get it back without the repeats. Email lists, keyword lists, log lines, file names and exported columns often contain the same line many times. This tool removes the extra copies, and it can also show you only the lines that are repeated, or only the lines that appear once.
Then sort the result: alphabetically in your own language, in natural order where item2 comes before item10, by number, by length, in reverse, or shuffled. Everything happens in your browser and the list is never uploaded.
How duplicates are found and lines are sorted
Each line is compared with the others as a whole. By default the comparison is case sensitive, so "Apple" and "apple" are different lines; switch it off to treat them as the same line and keep the first spelling you typed. Turning on Trim spaces ignores spaces and tabs at the start and end of each line and also removes them from the result. Lines that look the same on screen but are stored differently, such as an accented letter written as one character or as a letter plus an accent, are treated as the same line.
Alphabetical sorting uses the sorting rules of your browser's language, so accented letters sort where a reader of that language expects them, which plain code-order sorting does not do. Natural sorting reads digits as numbers, so file2 comes before file10. Numeric sorting uses the number at the start of each line, and lines without one go to the end. Sorting by length counts characters as a person sees them.
Windows (CRLF), Unix (LF) and old Mac (CR) line breaks are all understood, so a list copied from any system is split into the same lines. The result uses the line breaks of the text box. If your text ended with a line break, the result does too.
- Remove duplicate lines and keep the first or the last copy.
- Case sensitive or not, with optional trimming of spaces and removal of empty lines.
- Show only the duplicated lines, or only the lines that appear once.
- Sort A-Z, Z-A, natural, numeric, by length, reversed or shuffled.
- Language-aware alphabetical sorting using your browser's locale.
- Counts of lines in, lines out and duplicates removed; copy or download the result.
How to use the Remove Duplicate Lines & Sort
- Paste your list into Input lines. One item goes on each line.
- Choose what to remove or show, and how to sort. The result updates as you type.
- Check the counts above the result.
- Press Copy result or Download .txt.
Is it private?
Yes. Your list stays in your browser tab. It is not uploaded, not sent to any service and not stored. Big lists are processed in a background worker that is loaded from this site.
Read our tools privacy policy →
Frequently asked questions
How do I remove duplicate lines but keep the original order?
Leave the sort set to "None". The first copy of each line stays where it was and only the later copies are removed. Choose "keep the last copy" if you want the final occurrence to stay instead.
What does "Show only duplicates" do?
It lists each line that appears more than once, one time each. "Show only unique lines" does the opposite: it keeps the lines that appear exactly once and drops every line that has a repeat.
What is natural sorting?
Natural sorting treats groups of digits as numbers, so item2 comes before item10 and Chapter 9 before Chapter 10. Plain A-Z sorting compares character by character, so item10 would come before item2.
Does it sort in my language?
Alphabetical and natural sorting use your browser's language settings, so for example Swedish puts "ä" after "z" and German puts it next to "a". Which language is used is shown under the sort options.
Is my list uploaded?
No. The list is processed in your browser, in a background worker for big lists, and it is not stored. Lists of several megabytes work, with a progress message and a cancel button for the biggest ones.