Remove Duplicate Lines & Sort Lines

Remove duplicate lines from a list, or sort lines A to Z, naturally, by length or at random, with case and blank-line options.

Runs in your browser. Nothing is uploaded.

How to use the Remove Duplicate Lines & Sort Lines

  1. Choose Remove duplicates or Sort lines, then paste your list into the left box, one item per line, or open a file.
  2. Duplicates are removed as you type. The first occurrence of each line is kept, in its original order.
  3. Tick Case-sensitive if "Apple" and "apple" should count as different.
  4. Keep Ignore spaces at line ends on so stray spaces don't hide duplicates.
  5. Copy or download the unique lines.

Clean up any list in seconds

Lists collect duplicates. Email sign-ups from several sources, product codes pasted from different reports, keyword lists, log entries, names from a spreadsheet: merge a few of them and the same item appears again and again. This tool removes repeated lines and keeps exactly one copy of each.

Keeps your original order

Many deduplication methods sort the list as a side effect. This one doesn’t. It walks through your lines from top to bottom, keeps each line the first time it appears, and drops any later copies. If your list was in a meaningful order, such as by date or priority, that order is preserved.

Catches near-duplicates too

Real-world lists are messy. The same entry might appear with different capitalisation or with a stray space at the end, which would normally make it look unique. The default options handle this:

  • Case-insensitive matching, so Lee.Chen@example.org and lee.chen@example.org count as the same
  • Ignoring spaces at line ends, which also trims the lines in the result
  • Removing empty lines, so blank rows don’t clutter the output

Turn any option off when you need exact matching. The message shows how many lines were kept and how many were removed.

Sorting lines

Switch to Sort lines to put the list in order: A to Z or Z to A, natural order (so file2 comes before file10), shortest or longest first, reversed, or shuffled with a secure random source. Sorting follows your language’s alphabet rules, so accented letters land where you’d expect. Tick Also remove duplicates to sort and dedupe in one step, and Case-sensitive when Apple and apple should stay apart.

Private by design

Mailing lists and customer data are personal information. This tool runs entirely in your browser: nothing is uploaded, and nothing is stored except your option settings.

Frequently asked questions

Which copy of a duplicate is kept?

The first one. Every later line that matches an earlier line is removed, and the remaining lines stay in their original order, so nothing is reshuffled.

Are "Email@Example.com" and "email@example.com" duplicates?

By default, yes, because the comparison ignores case. Tick Case-sensitive to treat them as different. For email addresses, ignoring case is usually what you want.

Can I remove duplicates and sort at the same time?

This tool keeps the original order. To sort as well, use the Sort Lines tool and tick Remove duplicates there.

How many lines can it handle?

Hundreds of thousands of lines are processed almost instantly, and files up to 20 MB can be opened. Everything stays in your browser.

Is my list uploaded?

No. Your list is processed in your browser, which matters for email lists and customer data.

Tutorials