Developer Tools

Remove Duplicate Lines

Remove duplicate lines from any list online for free: keep the first or last copy, keep only lines that appear once, or list only the repeats, with ignore-case, trim, normalize spaces, remove empty lines and A to Z sorting, live stats and a removed-lines audit. 100% in your browser, no signup.

Deduplication options

Your clean list will appear here.

What counts as a duplicate?

Two lines count as the same line when their comparison keys match. Ignore case lowercases both lines before comparing, so Apple and APPLE are one line. Trim removes leading and trailing spaces, and Normalize spaces also collapses every run of spaces or tabs inside a line to a single space, so "New York" and "New York" match. The kept line always keeps its original casing: only the comparison is lowercased, never your text.

🔒 Privacy: deduplication runs locally in your browser. Nothing you paste is uploaded, stored or seen by anyone else.

More text tools

How this calculator works

A list with repeats is a small mess that grows fast: an email list pasted from a spreadsheet, a keyword list merged from three files, a log file with the same error a hundred times. Removing the repeats by hand means scanning every line and hoping you do not miss one. This tool does it in one paste: every line that appears more than once is reduced to a single copy, in the order you pasted it, and the count of removed lines is shown at the top. Paste a column copied from Excel or Google Sheets, a list of URLs, email addresses or names, and the clean list appears live as you type. Everything runs in your browser, so nothing you paste is uploaded or stored.

Four modes cover the ways people actually use a deduper. Keep first occurrence is the default and the one most lists need: the first copy of each line stays and every later copy goes. Keep last occurrence does the opposite and keeps the newest copy, which is what you want when a list was appended over time and the last entry is the fresh one. Only lines that appear once keeps exactly the lines with no twin anywhere, which is how you find the entries that exist in one list but not another after merging two lists. Only repeated lines does the reverse and shows one copy of each line that appears more than once, which is the fastest way to see what is duplicated before you decide what to delete. Case and whitespace options decide what counts as the same line: ignore case treats Apple and APPLE as one line, trim removes leading and trailing spaces, and normalize spaces collapses repeated spaces inside a line, so "New York" and "New York" match. Empty lines can be dropped, and the result can be sorted A to Z or Z to A instead of keeping the original order.

The removed-lines audit under the result lists every line that was taken out and how many copies of it were removed, so you can verify nothing important disappeared before you copy the clean list. Copy the result or download it as a .txt file ready to paste back into a spreadsheet or a text file. Use the Text Diff Checker when two versions of a list need comparing line by line, the Case Converter when the casing itself needs fixing first, and the Word Counter when you need a quick count of the words in the cleaned list.

Frequently asked questions

How do I remove duplicate lines from a list?
Paste your list into the input box, one item per line, and the clean list appears live with each repeated line reduced to one copy. Choose Keep first occurrence to keep the earliest copy, or Keep last occurrence to keep the newest one. Copy the result or download it as a .txt file.
What does "only lines that appear once" mean?
It keeps only the lines that occur exactly one time in your list and drops every line that appears twice or more. It is the mode to use after merging two lists when you want the entries that exist in only one of them. The opposite mode, Only repeated lines, keeps one copy of each line that appears more than once.
Can I paste a column from Excel or Google Sheets?
Yes. Copy the column, paste it here, and each cell becomes one line. The cleaned list can be copied back and pasted into a single column, or downloaded as a .txt file and opened in your spreadsheet. Tabs inside a cell are treated as part of the line, so paste one column at a time.
Does ignore case treat Apple and APPLE as duplicates?
Yes, when Ignore case is on, lines are compared after lowercasing, so Apple, APPLE and apple count as the same line and only the first (or last, if you chose Keep last) survives with its original casing. With the option off, casing matters and all three are kept as different lines.
What do trim and normalize spaces do?
Trim removes leading and trailing spaces from every line, so " Apple" and "Apple" match. Normalize spaces goes further and collapses every run of spaces or tabs inside a line to a single space, so "New York" and "New York" match too. Both only affect the comparison and the kept line; the original text is never sent anywhere.
Is my list uploaded anywhere?
No. Deduplication runs locally in your browser with no server round trip, no account and no storage. Closing the page discards your list, which is why the tool is safe for email lists, customer names and other private data.
Disclaimer: Results are estimates for planning purposes only and are not financial advice. Actual loan terms, taxes and investment returns vary. Consult a qualified professional before making financial decisions.