Remove Duplicate Lines from a Text File or List
Remove duplicate lines is a free OpenAnyDoc tool. Drop a text file or paste a list, then remove its repeated lines.
Runs on your device: no upload, no sign-up, no ads How to check
Paste text instead
Pasted text stays in this tab and is never sent anywhere.
How it works: remove repeated lines from text
Open your list
Drop or choose a .txt file, paste the lines into the paste box, or try one of the samples. It opens in the editor with the two duplicate tools marked in the toolbar, and no line is removed yet.
Click Remove duplicate lines
Every later copy of a line is deleted and the first one stays in place. Turn on Ignore case first if "Apple" and "apple" should count as the same line.
Or see what was repeated
Only duplicate lines keeps one copy of each line that occurs more than once and removes all the others. Undo brings the full text back.
Download
The status line shows how many lines are left. Click Download to save them as a .txt file; the file on your device is never changed.
Remove duplicate lines: what it can't do
- No fixed limit; it depends on your device's memory
- Lines must match exactly: an extra space at the end or a different spelling makes two lines different. Trim the spaces first with the Clean tools.
- Whole lines are compared; duplicates in one column of a table need the Remove duplicates page for CSV and Excel files.
- Blank lines are never treated as duplicates by Remove duplicate lines, so they all stay.
- Only duplicate lines always compares capital and small letters exactly; Ignore case does not change it.
Removing duplicate lines: questions and answers
- Is my file uploaded?
- No, your file is not uploaded: your browser reads the text and removes the lines on your device; nothing is sent to a server. To check it yourself, see how to check that a website does not upload your file.
- Which copy of a repeated line is kept?
- The first copy of a repeated line is kept. It stays in its place and every later copy is deleted, so the remaining lines keep their original order.
- Do I have to sort the lines first?
- No, you don't have to sort the lines first: copies are found anywhere in the text, not only next to each other, and nothing is reordered.
- Are "Apple" and "apple" the same line?
- Not unless you turn on Ignore case, which sits in the Sort group of the same toolbar. With it on, Remove duplicate lines keeps whichever spelling comes first.
- Why is a line that looks the same still there?
- It is probably not identical: a space or tab at the end, or a different invisible character, makes it a different line. Trim trailing spaces in the Clean menu, then remove duplicates again.
- How do I remove duplicate rows from a CSV or Excel file?
- This page compares whole lines of plain text. For a table, use the Remove duplicates page, which compares rows by the columns you choose.
Why it's private: your files never leave your browser
Many online file tools upload your file, so a copy of it leaves your device. OpenAnyDoc works the other way round: your browser reads the file and draws it on your screen. Nothing is uploaded, there is no account, and the file is gone from memory when you close the tab, so there is nothing for us to store, see or lose.