Remove Duplicate Lines & Words
Remove duplicate lines or words
What it does
First Occurrence Wins
Each line or word keeps its original position, and only later repeats are removed.
Case and Whitespace Options
Compare lines exactly by default, or ignore case, or ignore spaces around lines.
Words, Arabic and Unicode
Words mode finds words with Unicode rules, so Arabic, accented letters and numbers work. Arabic diacritics can be ignored when comparing, and the first word keeps its marks.
Line Endings Handled
LF and CRLF text works, and a final line break is kept only if there was one.
Private by Design
Everything is computed in your browser. Your list is never uploaded or stored.
Frequently asked questions
Is my text sent to a server?
No. The lines are processed in your browser. Nothing is uploaded or stored. The page does download the code needed to run the tool.
Which duplicate is kept?
The first one. Later copies are removed, and the lines that remain keep their original order.
What does "Ignore surrounding whitespace" do?
Lines are compared after trimming spaces and tabs at both ends, so " apple " and "apple" count as duplicates. The first one is output exactly as you typed it.
How does Words mode work?
It finds every word with Unicode rules and removes each word that already appeared earlier, anywhere in the text. The first occurrence stays exactly as typed, and the line breaks, tabs and punctuation around the other words are kept. A repeat is removed together with the space or punctuation that only belonged to it.
Does it work with Arabic?
Yes. Arabic letters, diacritics and mixed Arabic and English text are recognised as words. By default Ignore Arabic diacritics is on, so مَرْحَبًا and مرحبا count as the same word and the first one keeps its marks. Different letters such as أ and ا are never merged.
What happens to empty lines?
They follow the same rule as any line: the first empty line stays and later empty lines are removed as duplicates.