🔒 100% private — runs in your browser, nothing is uploaded

Remove Duplicate Lines

Delete repeated rows and lines from pasted text, keep the first occurrence.

Duplicate lines creep into mailing lists, keyword lists, inventories and data exports. Rows pasted from a spreadsheet or export count the same way — each repeated row is removed like any repeated line, with no file upload involved.

Quick answers

How does removing duplicate lines work?

Paste your list in and the tool reads it line by line, keeping a note of every line it has already seen. The first time a line shows up, it stays. Any later copy gets dropped. You end up with each line once, in the order it first appeared, plus a count of duplicates removed.

That top-to-bottom pass is the whole trick. Nothing gets sorted and nothing gets rewritten, so a list you pasted in a deliberate order still reads that way afterwards. If your result looks wrong, check the toggles first. Nine times out of ten, a line you expected to vanish is still there because a capital letter or a trailing space made it look different.

What's the difference between Trim whitespace and Ignore case?

Trim whitespace removes spaces and tabs from the ends of a line before the tool compares it, so 'apple' and 'apple ' count as the same line. Ignore case folds capital and small letters together, so 'Apple' and 'apple' also match. Trim is on by default. Ignore case starts off, so capitals matter until you switch it on.

Use them for different messes. Trim fixes the invisible stuff you pick up copying from spreadsheets and web pages, where stray spaces sneak onto the ends of lines. Ignore case fixes lists pulled from more than one source, where one person typed names in lower case and another used capitals. Neither one changes the line you get back. They only change what counts as a match.

Which copy of a repeated line does the tool keep?

The tool always keeps the first copy it meets, exactly as you typed it, with its original capitals and spacing. Later copies are removed even if they look cleaner or neater. That means the spelling in your result comes from the earliest version in the list, not from the last one and not from a tidied up version.

This trips people up with Ignore case on. If 'Apple' appears first and 'apple' appears third, you keep 'Apple' and lose 'apple', even though the matching was done in lower case. If the tidier version is the one you want to keep, move it to the top of its group before you run the tool. First in wins, every time.

How to use

  1. Paste your list, one item per line.
  2. Toggle case/whitespace options if needed.
  3. Click Remove duplicates, then copy the clean list.

About this tool

This tool keeps the first occurrence of each line and reports how many were removed.

Your list never leaves your browser.

How it works

The tool reads your text line by line and keeps a record of every line it has already seen. The first time a line appears it is kept; every later repeat is dropped. This runs in linear time with a hash set, so even lists with tens of thousands of lines process instantly.

Comparison is exact — "Apple" and "apple" count as different lines, and trailing spaces matter. If your data has inconsistent spacing, run it through the Whitespace Normalizer first for cleaner results.

There's no heavy math here. Think of it as a notebook that fills up as the tool reads. It walks your list from top to bottom and keeps a set of lines it has already seen. The first time a line shows up, it goes into the set and stays in the output. The next time that same line shows up, it's already in the set, so it gets dropped and the removed count goes up by one.

That's also why the order never shuffles. The tool doesn't sort anything and it doesn't collect the survivors at the end. It writes each new line out the moment it meets it, in place. So your result reads in first-appearance order, which is the order you probably meant when you built the list in the first place.

The two toggles only change the note in that notebook, not the line you get back. With Trim whitespace on, the comparison copy has the spaces stripped off both ends. With Ignore case on, that copy gets lowercased too. The tool compares those tidied copies, but the output always keeps the first occurrence exactly as you typed it, capitals, spacing and all. Turn Trim off and 'apple ' stops matching 'apple', because now those trailing spaces are part of what gets compared.

What this tool can’t do

This tool matches whole lines, and only whole lines. It can't look at just one column or field, so two rows like 'Sam Lee, Leeds' and 'Sam Lee, York' count as different lines even though the name repeats. If you need to dedupe by email or by ID, you'll have to pull that piece out first and run the tool on that alone.

Near misses stay. 'Jon' and 'John' are different lines here, and so are 'colour' and 'color', a typo and the word you meant, or the same address with one extra comma. There's no fuzzy matching and no spell check running underneath. If two lines aren't the same once trim and case are sorted out, both of them stay in your result.

Blank lines have their own little rule. The first blank line is kept, like any other first copy. Every blank after that counts as a duplicate of it and gets removed. That cleans up stray gaps nicely, but it also means you can't keep a blank line as a separator between groups. Paste the groups separately if those gaps matter to you.

A line is the limit in the other direction too. The tool can't merge a record that spreads over two or three lines, and it won't dedupe words inside a single line. Paste in a huge list and it still runs on your device, not on a server, so a very large paste can hit your browser's memory limit. Split monster files into chunks if the tab starts to struggle.

Worked examples

Email list: A 5,000-address mailing list with 300 accidental duplicates becomes 4,700 unique addresses in one click.

Log cleanup: Strip repeated error lines from a server log so each unique error appears once.

One short list, two different results: Say you paste in eight lines, in this order: apple, banana, Apple, 'apple ' with a trailing space, cherry, banana, cherry, date. Leave Trim on, since it's on by default, and turn Ignore case on too. Now walk it through. apple sets the key apple, banana stays banana, Apple folds down to apple and matches the first line, and 'apple ' trims to apple and matches as well. Cherry is new, the second banana is a repeat, the second cherry is a repeat, and date is new. You finish with 4 kept — apple, banana, cherry, date — and 4 removed. The spelling that survives is that first lowercase apple, not the capital one. Now run the same list with Ignore case off and Trim still on. The trailing space still gets trimmed, so 'apple ' still matches apple, and the repeated banana and cherry still go. But Apple now forms its own key, so it survives as a separate line. This time you get 5 kept and 3 removed, from the same paste.

Frequently asked questions

Does it keep the original order?

Yes — the first occurrence of each line stays in place; only later repeats are removed.

What does "ignore case" do?

"Apple" and "apple" count as the same line when enabled.

Is my list uploaded?

No — processing is 100% local.

Can I remove duplicates from just one column of my data?

Not directly, no. The tool only sees whole lines. The usual workaround is to copy that one column out into its own list, dedupe that, and then work from the cleaned list. Just keep a copy of the original rows somewhere safe first. Once lines are gone from a combined row, you can't rebuild the row that went with a value you removed.

Why did a line I swear is duplicated stay in my list?

Look closely at the two copies. There's nearly always a small difference hiding in there — a trailing space with Trim turned off, a capital letter with Ignore case off, a double space in the middle, or a punctuation mark that isn't in the other copy. Turn both toggles on and run it again. If it still stays, the lines really do differ somewhere, and a side-by-side look will usually spot it.

Can I dedupe a list of a million lines?

You can try, but be ready for your browser to complain. Everything happens on your device, in the tab's memory, so a million lines means a million lines stored twice over while it works. Most lists in the tens of thousands run fine. For something huge, split it into smaller pastes, dedupe each one, paste the results together, and run that combined list through once more to catch repeats across the chunks.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/dedup/" title="Remove Duplicate Lines" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools