Remove duplicate lines
Remove repeated lines, then sort, shuffle, trim or clean up the list.
Free, no sign-up, no credit card. Your files stay on your device.
How to remove duplicate lines from a list
- Paste your list into the box, one item on each line, or open a text file.
- Choose what to clean up, such as repeated lines, spaces at the edges and empty lines.
- Choose an order if you want the lines sorted or shuffled.
- Select "Copy the result", or download it as a text file.
What to know
The order the clean-up works in
- Spaces at the start and end of each line are trimmed first, if you ask for it, so "apple" and "apple " count as the same line.
- Empty lines, and lines with only spaces, are removed next.
- Repeated lines are removed after that, keeping the first of each.
- The lines are put in order last. Shortest and longest first count letters as you see them, so an emoji counts as one.
What it tells you
Under the result you'll see how many lines you started with, how many are left, and how many repeated and empty lines were removed. A text that ends with a line break doesn't gain an extra empty line.
Shuffle
Shuffle puts the lines in a random order, and Shuffle again makes a new one. It uses your browser's ordinary random numbers, which is fine for mixing a list and not meant for anything that has to be unpredictable, such as passwords.
If something goes wrong
Lines that look the same weren't removed
They differ by something you can't see, such as a space at the end, a tab, or a capital letter. Tick "Trim spaces at the start and end" and "Treat capitals as the same".
The result has no empty lines left, and I wanted some
Untick "Remove empty lines". Without it, empty lines stay, apart from repeats of them if Remove repeated lines is on.
Sorting puts capitals and accents in an odd place
Sorting follows your browser's language rules, which can differ from another program's. Tick "Treat capitals as the same" to sort without regard to capitals.
Questions
Is my list uploaded?
No. The lines are sorted and cleaned in your browser. Nothing is sent anywhere or saved, so a list of email addresses or customer names stays on your device.
Which copy of a repeated line is kept?
The first one. Later copies are removed, and the lines that remain keep their order unless you choose to sort or shuffle.
Does it tell "Apple" and "apple" apart?
Yes, unless you tick "Treat capitals as the same". Then the first one that appears is kept as it was written.
Can I sort a list in alphabetical order?
Yes. Choose "A to Z" or Z to A under Put the lines in order. Numbers inside lines are sorted by value, so item 2 comes before item 10, and the order follows your browser's language rules for accents.
Can I sort lines without removing the repeats?
Yes. Untick "Remove repeated lines" and choose an order. Every line stays, just in the new order.
You might also need
-
Word counter
Words, characters, sentences, reading time, and your most used words. -
Find and replace
Replace words in a text, with a live match count and optional regular expressions. -
Case converter
Change text to upper, lower, title, sentence, camel, snake or kebab case. -
Compare text
Two texts side by side, with every added and removed word marked.