Skip to content
Browser Tools

How to Remove Duplicate Lines From a List (and Sort It)

Remove duplicate lines from email lists, keywords, names or URLs, ignore case and extra spaces, drop empty lines and sort A to Z, Z to A or by length.

By Browser Tools Team · · 3 min read

Open the free Remove Duplicate LinesDedupe and sort lists. Runs in your browser.

To remove duplicate lines, paste your list (one item per line) into a dedupe tool, choose whether to ignore upper/lower case and extra spaces, and copy the result. Each line is kept once, in its original order, unless you choose to sort it. The free Remove Duplicate Lines tool does this in your browser and tells you how many duplicates it removed.

How do you use the tool?

  1. Open Remove Duplicate Lines.
  2. Paste your list, one item per line.
  3. Choose your options:
    • Ignore upper/lower case (Apple = apple)
    • Ignore spaces at the start and end
    • Remove empty lines
  4. Choose the order: Keep original order, A → Z, Z → A or Shortest first.
  5. See how many duplicates were removed, then Copy the clean list.

Nothing is uploaded, so you can safely clean customer emails or private data.

Which options should you turn on?

List Ignore case Ignore spaces Remove empty lines Order
Email addresses On On On A → Z
SEO keywords On On On Keep original
Names Usually off On On A → Z
URLs Off (paths can be case-sensitive) On On Keep original
Product codes Off On On A → Z

Email addresses are effectively case-insensitive for most providers, so "Ali@Example.com" and "ali@example.com" are the same contact. URLs and codes can genuinely differ by case, so leave case-sensitivity on for those.

A worked example

Before:

apple
Banana
apple
 banana
cherry

Apple

With ignore case, ignore spaces and remove empty lines on, and the original order kept:

apple
Banana
cherry

The second "apple", " banana" (with a leading space), "Apple" and the empty line are gone.

How do you remove duplicates in Excel or Google Sheets?

  • Excel: select the column, then Data → Remove Duplicates.
  • Google Sheets: Data → Data cleanup → Remove duplicates, or use =UNIQUE(A:A).

Spreadsheets work well for data that's already in columns. For a list you've copied from an email, a document or a website, pasting into the tool is faster, and it handles trailing spaces and empty lines in the same step.

Why aren't my duplicates being caught?

Hidden differences are the usual cause:

  • Trailing or leading spaces: turn on "Ignore spaces at the start and end".
  • Different capitals: turn on "Ignore upper/lower case".
  • Invisible characters from websites (non-breaking or zero-width spaces): clean them first with Remove Formatting.
  • Items on one line separated by commas: put them one per line first. Remove Line Breaks goes the other way, turning a clean list back into one comma-separated line.

Tips for cleaning email lists

Before you import a list into a newsletter tool or CRM:

  1. Put one address per line. If they're separated by commas or semicolons, replace those with line breaks first.
  2. Turn on Ignore upper/lower case and Ignore spaces at the start and end, and Remove empty lines.
  3. Sort A → Z so obvious typos ("gmial.com", "yaho.com") sit next to the correct version and are easy to spot.
  4. Delete lines that clearly aren't addresses (no "@").
  5. Only email people who agreed to hear from you; deduplicating doesn't replace consent.

The same steps work for phone numbers: strip spaces and dashes first so "0300 1234567" and "0300-1234567" match.

Common uses

Clean your list now

Paste it into the free Remove Duplicate Lines tool. Need it as one line again? Use Remove Line Breaks, and count the result with the Word Counter.

Frequently asked questions

Does it keep the original order?

Yes, unless you choose a sort. The first time each line appears is kept and later copies are removed.

How do I treat "Apple" and "apple" as the same?

Turn on "Ignore upper/lower case". The first version that appears is kept.

Why are some duplicates not removed?

Usually because of hidden spaces at the start or end of a line. Turn on "Ignore spaces at the start and end".

Is my list uploaded?

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

Try these free tools

More from the blog