Text & Fonts

Remove Duplicate Lines

Paste a list and delete repeated lines instantly. Ignore case, trim spaces, keep the first or last copy, sort the result and see which values repeated.

Free, runs in your browserUpdated November 2026Keeps original orderBy Talha Salman
Paste up to hundreds of thousands of lines. Processing happens in your browser.
What to do with repeated lines
Lines without duplicates
Lines in–
Lines out–
Lines removed–
Values repeated–

Quick answer: To remove duplicate lines, paste your list with one item per line, choose whether to ignore case and trim spaces, and copy the cleaned list. The tool keeps the first copy of each line in its original order. A list of 7 emails with 3 repeats comes back as 4 unique lines.

Remove duplicate lines diagram: a list of seven emails with repeats cleaned to four unique lines
Repeated lines are dropped and the first copy of each stays in place, so the order of your list does not change.

What Does Remove Duplicate Lines Do?

A remove duplicate lines tool compares every line of a text with every other line and deletes the repeats, leaving each distinct value once. It is the quickest way to clean an email list, a keyword export, a list of URLs or any column you copied from a spreadsheet, without formulas or code.

This version treats "Anna@Example.com" and "anna@example.com" as the same line when you tick Ignore uppercase and lowercase, trims stray spaces that make identical lines look different, drops empty lines, and shows which values were repeated and how often. You can keep the first or last copy, delete every line that appears more than once, and sort the result naturally so "item 2" comes before "item 10". After cleaning, the word counter gives you a quick count of the final list.

How Do You Remove Duplicate Lines from a List?

How to use remove duplicate lines: paste a list, choose the duplicate mode, set the options, then copy the unique lines
Paste a list, choose how to treat repeats, set the matching options, then copy the unique lines.
  1. Paste your list into the box, one item per line.
  2. Choose Keep one copy of each, or Delete every repeated line to keep only values that appear once.
  3. Pick which copy to keep and whether to sort the result.
  4. Set the matching options: ignore case, trim spaces, remove empty lines, treat repeated inner spaces as one.
  5. Copy the cleaned list or download it as a .txt file.

The table under the result lists the most repeated values, which helps you spot data entry problems such as the same customer added three times.

How Many Lines Will Be Removed?

The number of lines removed equals the lines checked minus the distinct values that remain. With "Keep one copy of each", every distinct value survives once, so the output length equals the number of unique values.

Lines removed = lines checked − unique lines kept
Lines checked = all lines − empty lines (when Remove empty lines is on)

Worked example: the sample list has 7 emails. With case ignored and spaces trimmed, "Anna@Example.com" matches "anna@example.com", "ben@example.com" appears twice and "carla@example.com " matches "carla@example.com". That leaves 4 unique values, so 7 − 4 = 3 lines are removed.

Remove duplicate lines chart: how ignoring case and trimming spaces change the number of unique lines in the sample list
Matching options change what counts as a duplicate. Strict matching finds fewer repeats.
Settings on the 7-line sampleUnique linesRemoved
Exact match (case and spaces count)61
Trim spaces only52
Ignore case only52
Ignore case and trim spaces43
Delete every repeated line (case ignored, trimmed)16

The last row keeps only "dev@example.com", because it is the one address that appears exactly once. That mode is useful when you want to find the items that are not shared between two pasted lists.

Which Settings Should You Use?

Use Ignore case and Trim spaces for emails, names, keywords and tags, because capital letters and trailing spaces rarely mean a different value there. Email domains are case-insensitive by standard, and in practice almost every mail provider treats the part before the @ the same way.

Turn Ignore case off for passwords, product codes, file paths on Linux and anything where "ABC" and "abc" are different values. Keep the original order when the sequence matters, such as a ranked list, and sort A to Z when you want a tidy reference list. If you work on the command line, the same job is done by sort -u or sort | uniq, as described in the GNU coreutils manual for uniq; note that uniq alone only removes repeats that sit next to each other, while this tool finds them anywhere in the list. Copied text full of broken lines? Run it through remove line breaks first.

Cleaning up copied text? Our guide shows how to remove line breaks and clean up pasted text, step by step.

Frequently asked questions

Does removing duplicates change the order of my list?

No, not unless you choose a sort option. The tool keeps the first copy of each line where it was and removes later repeats.

How do I remove duplicates but keep the last occurrence?

Set Copy to keep to Last occurrence. Each value then stays at the position of its final appearance, which is useful when later entries are more up to date.

How do I remove lines that appear more than once entirely?

Choose Delete every repeated line. Any value found two or more times is removed completely, leaving only lines that were unique to begin with.

How do I remove duplicate lines in Excel or Google Sheets?

In Excel use Data, then Remove Duplicates. In Google Sheets use Data, then Data cleanup, then Remove duplicates, or the UNIQUE function. For a quick one-off list, pasting the column here is faster.

How many lines can the tool handle?

Hundreds of thousands of lines on a typical laptop, because it uses a hash map and checks each line once. Very large files depend on your device's memory.

Is my list uploaded anywhere?

No. Everything runs in your browser, so email lists and customer data never leave your device.