Remove Duplicate Lines

Paste a list and get back only the unique lines, in their original order. Decide whether “Apple” and “apple” count as the same, whether spaces around a line matter, what happens to blank lines and whether the first or last copy survives. The removed lines are listed so nothing disappears silently.

Text Cleanup Runs in your browser

Remove Duplicate Lines from Your List

How to Use the Remove Duplicate Lines

  1. Paste your list into the box, one item per line.
  2. Set the comparison options: ignore case, trim spaces, how to treat blank lines and whether to keep the first or last copy.
  3. Read the summary tiles and copy or download the unique lines.
  4. Check the Removed lines box to confirm which lines were dropped.

About This Tool

Marketers cleaning email or keyword lists, developers tidying logs and config files, researchers merging data lists and anyone with a messy pasted list.

Input: Plain text, one item per line  ·  Output: Unique lines.

Features and Limitations

Features

  • Keeps the original order of the lines that remain.
  • Case-sensitive or case-insensitive comparison.
  • Keep first or keep last occurrence.
  • Shows how many lines were removed and lists them.

Limitations

  • Only complete lines are compared; near-duplicates (a typo, a trailing comma) are not detected.
  • Comparison ignores nothing except what you choose: “a” and “a ” differ unless trimming is on.
  • Blank means empty or spaces only. Very long lists are limited by your browser's memory, but several hundred thousand lines work.
  • Results are computed in your browser; nothing you enter is sent to a server.

Example

The list apple, Banana, apple, banana, cherry (one per line) gives apple, Banana, banana, cherry in the default mode, and apple, Banana, cherry when “Ignore upper and lower case” is ticked (one line removed in the first case, two in the second).

Frequently Asked Questions

Does it keep the first or last duplicate?

You choose. “First occurrence” keeps the earliest copy where it is. “Last occurrence” keeps the final copy and places it where that copy was.

Is the comparison case-sensitive?

By default yes: “Apple” and “apple” are different lines. Tick the ignore-case option to treat them as the same.

What happens to blank lines?

By default every blank line is kept, so the spacing of your list is preserved. You can keep only one blank line or remove all of them.

Can I see which lines were removed?

Yes, the Removed lines box lists every dropped line in the order it appeared, and the summary shows the counts.

Related Tools

More like this: all Text Cleanup tools, all Text & Writing tools or the TinySandy home page.