Sort lines alphabetically, in natural number order, by number or by length, or reverse and shuffle them, with sorting rules for Hindi and other languages.
Remove Duplicate Lines
Delete repeated lines from a list while keeping the original order, with options to ignore case, extra spaces and empty lines.
0 lines · 0 characters
Options
Apple, apple and APPLE count as the same line.
“ apple” and “apple ” count as the same line. The line that is kept is not changed.
Shows each line that appeared more than once and how many times.
0 lines · 0 characters
- Lines before
- 0
- Lines after
- 0
- Duplicates removed
- 0
Repeated lines
| Line | Times found |
|---|
Runs entirely in your browser. Your files and text are not uploaded.
How to use Remove Duplicate Lines
-
Step 1: Paste your list
Type or paste lines into the box, or open a .txt or .csv file. Each line is one item.
-
Step 2: Choose the rules
Decide whether case and spaces matter, which copy to keep and what happens to empty lines.
-
Step 3: Copy or download
The result updates as you type. Copy it or download it as a .txt file.
How duplicates are found
The tool compares whole lines. Two lines are duplicates when they contain exactly the same characters, with two adjustments you can switch on or off:
- Ignore case treats Apple, apple and APPLE as the same line. It uses Unicode case rules, so the German straße also matches STRASSE.
- Ignore spaces at the start and end treats " apple" and "apple " as the same line. This is on by default because stray spaces are invisible and usually accidental. The line that is kept is not changed, so its spaces stay as they were.
Accented letters are compared after Unicode normalisation, so an é typed as one character matches an é typed as e plus an accent mark. Lines that differ in any other way, such as colour and color, both stay.
Which copy is kept
With First occurrence, every line stays where it first appears and later copies are removed. With Last occurrence, the last copy stays instead, which is useful when newer entries are added at the bottom of a list. The remaining lines keep their original order unless you choose A → Z or Z → A. Sorting uses natural order, so item 2 comes before item 10, and empty lines that are kept go to the end.
Empty lines
By default an empty line is treated like any other line, so only the first one stays. Keep all leaves every empty line where it is, which keeps paragraph breaks in ordinary text. Remove all deletes them. Lines that contain only spaces count as empty.
Worked example
Take this list of six lines:
apple
Banana
apple
banana
Cherry
apple
With the default options the result has four lines: apple, Banana, " banana" and Cherry. Two extra copies of apple were removed. The line " banana" stays because its small b differs from Banana; the space in front does not matter. Turn on Ignore case and it goes too, leaving three lines. With Last occurrence instead, the result is Banana, " banana", Cherry, apple, because the last apple is on line 6.
Switch on List the repeated lines to see each line that appeared more than once and how many times, for example to check which e-mail addresses were entered twice.
Files and line endings
You can open a plain-text file or drop it on the box. If an unchanged file uses Windows line endings (CRLF), the download keeps them; otherwise the download uses Unix line endings (LF), which Windows Notepad, Excel and other current programs read without problems. If the file starts with a byte order mark (a hidden marker that says the file is Unicode text), the download starts with one too.
Text boxes become slow with very many lines, so when you paste or open a list of more than 20,000 lines, the box shows its first 20,000 lines and cannot be edited, and the result box also shows at most 20,000 lines. The tool still uses every line, and Copy and Download include the whole result. The list is processed in your browser and is not uploaded.
Limitations
- Whole lines are compared. Near-duplicates with different spelling, punctuation or word order stay.
- In a CSV file the entire row must match; the tool does not remove rows that repeat only one column, such as a repeated e-mail address with a different name.
- Spaces in the middle of a line always count, so "New Delhi" (two spaces) and "New Delhi" are different lines.
- Lists longer than 2 million characters are not accepted, and very long lists can be slow on older phones.
- A file that is not saved as UTF-8 or UTF-16 is read as Windows-1252 (Western European), and the tool tells you when that happens. Files in other encodings may show wrong characters.
Frequently asked questions
Does removing duplicates change the order of my list?
No. Lines stay in their original order and only the extra copies are removed. The order changes only if you choose A → Z or Z → A, or keep the last occurrence instead of the first.
Why is a line I think is a duplicate still there?
It differs somewhere, often by a capital letter or a space between words. Turn on Ignore case, check for double spaces, or compare the two lines with the Text Diff Checker.
Can I see which lines were repeated?
Yes. Turn on List the repeated lines. A table shows each line that appeared more than once and how many times, and you can copy that list.
Can I remove duplicate rows from a CSV file?
Yes, if the whole row repeats exactly. Open the .csv file, then download the result and rename it to .csv. Rows that share only one column, such as the same e-mail address with a different name, are not treated as duplicates.
Is there a limit on how many lines I can use?
The limit is 2 million characters, which is about 80,000 typical e-mail addresses. Long lists are processed in the background so the page stays usable; the longest take a few seconds. A list of more than 20,000 lines is shown in part, but every line is used and Copy and Download include the whole result.
Is my list uploaded anywhere?
No. Everything happens in your browser. The list is not sent to a server or saved, and it disappears when you close the page.
Related tools
Find text and replace it in one step, with match case, whole word and regular expression options, highlighted matches and a count.
Compare two texts and see what was added, removed or changed, line by line, word by word or character by character.
Count words, characters, sentences and paragraphs as you type, with reading time and keyword density.
Change text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case and more. The result updates as you type.