Remove Duplicate Lines

Keep the first or last occurrence of each repeated line in a list.

Input

Processed on your device

How to use Remove Duplicate Lines

Remove repeated lines from a list while keeping one original copy. Choose case-insensitive matching, ignore edge spaces or retain the last occurrence when list order matters.

  1. Paste one item per line.
  2. Choose how matches should treat capitalization and edge spaces, then enable Keep last occurrence if needed.
  3. Compare the removal count with your expectations.
  4. Select Remove Duplicate Lines and review the result.
Example input
Invoice-10
Invoice-2

Invoice-2
Invoice-3

Example use

Clean a list of item codes copied from several documents without alphabetizing it. Keep a case-sensitive comparison when two differently capitalized values are distinct IDs.

Output and compatibility

Matching acts on whole lines. Edge-space and case options affect the matching key; they do not rewrite all the saved text into a new case. The kept line comes from the original input.

Decide what counts as the same value

Test a sample with different spellings, punctuation and capitalization. A case-insensitive comparison can be useful for names placed on a sign, while it can combine two independent identifiers in a data file. If a repeated value denotes an update at the end of the list, check which occurrence survives. Use a column key with tabular inputs rather than comparing entire lines containing unrelated fields.

Troubleshooting

If repeated items remain, inspect internal spaces, punctuation and invisible characters. Use Unicode Inspector when values look the same but differ in their characters.

Use Sort Text Lines afterward if you also want alphabetical or natural order.

Frequently asked questions

Can I deduplicate ignoring case?

Enable Ignore case to treat capitalization variants as the same key.

Which duplicates are kept?

The first by default, or the last with the checkbox enabled.

Can I ignore whitespace?

Ignore edge spaces trims the comparison key at the beginning and end. Internal spacing remains significant.

Does it compare just a column?

Use Deduplicate CSV when the key is a column in a table.

Does it sort the remaining lines?

Their order follows the kept occurrences in the input.

How do I see which copy survived?

Compare similar original and output lines in a diff, including any spaces or capitalization that changed the matching key.

Find a tool