Skip to main content

Remove duplicates

Clean up a list in seconds by deleting repeated values, keeping the first occurrence of each one in its original order, ready to copy or reuse.

  • Clipboard
Automate

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Remove duplicates

Was this tool useful?

How does this tool work?

Remove duplicates from a list of text values while keeping the first occurrence of each one. The tool handles one entry per line and lets you decide whether capital letters and spaces at the edges of a line count in the comparison.

Each non-empty line is compared with the values already seen. When two lines are treated as identical, only the first is kept in the result. Two options, both on by default, ignore differences between upper and lower case and trim spaces at the start and end of each line before comparing; switch them off for a strict comparison. Empty lines are dropped. The counter of removed duplicates does not include empty lines: it only measures repeated occurrences. The tool does not correct spelling or recognise synonyms. For example, “Leeds” and “leeds” are grouped when case is ignored, but “Leeds” and “Leds” stay separate. Keep your original list if the repetitions carry statistical meaning. To decide whether two values should count as the same, look at the quality of the source. In a contact directory, differences in capitals rarely matter; in a list of technical codes, they may distinguish valid identifiers. Trimming edge spaces is handy after a copy and paste, but it never touches spaces in the middle of an expression. If a line appears three times, the tool keeps the first occurrence and removes the others according to the selected rules. It never matches values that are merely similar. For an audit, keep a copy of the original list and note the options you used so you can explain the result. Removing duplicates is not the same as counting occurrences: if you care about how often each value appears, use a value counter instead.

How to use this tool

  1. Paste the items

    Enter one value per line, in the order you want to keep.

  2. Choose the rules

    Decide whether the comparison ignores case and edge spaces.

  3. Check what is kept

    Review the result and the counter of removed repetitions before copying.

Use cases

Cleaning a list of references

Remove references entered several times before building a single inventory, after checking that the spelling variants really refer to the same item.

Consolidating names or categories

Group the repeated values in a list of answers. If case or spaces matter, adjust the options first.

Preparing a comparison

Deduplicate a list before comparing it with a second source, so you can tell present values from repeated occurrences.

Examples

Exact duplicates

The second “A” is removed and the counter shows 1 duplicate.

Input

A
B
A

Result

A
B

Differences in case

With “ignore case” on, which is the default, “paris” is a duplicate of “Paris”. Without it, all three lines are kept.

Input

Paris
paris
Lyon

Result

Paris
Lyon

Tips and best practices

  • The order of first occurrences is kept: the tool does not sort the values.
  • Empty lines are not included in the number of duplicates removed.
  • A plain line comparison cannot match typos; fix them before deduplicating.

Frequently asked questions

Is the original order preserved?

Yes. First occurrences are returned in the order in which they appear.

Can “Paris” and “paris” count as the same value?

Yes, that is the default behaviour: the option that ignores case is on. Switch it off to keep the two spellings apart.

Do spaces at the start or end change the result?

Not while edge-space trimming is on, which it is by default. If you switch it off, “Leeds” and “Leeds” followed by a space remain two different values.

Are empty lines counted as duplicates?

No. They are ignored and left out of the counter.

Does the tool match typos?

No. Two values spelled differently stay separate.

Related tools

Tools similar or complementary to this one.

Similar tools

Compare two lists to find the items they share and the ones that differ.

Text & writingUse this tool

Merge two lists into a single set of lines ready to copy or reuse.

Text & writingUse this tool

Sort the items of a list alphabetically or numerically, in ascending or descending order.

Text & writingUse this tool