Skip to content
ToolZone

Remove Duplicate Lines

Scan a list of text and remove any duplicate lines automatically, leaving only unique entries, useful for cleaning up lists and exported data.

Runs in your browser. Nothing you enter or upload leaves your device.

Unique lines appear here

0 duplicate lines removed.

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Remove Duplicate Lines

Remove Duplicate Lines cleans up a list by keeping the first appearance of each line and dropping every later repeat. Two checkboxes control how strict the match is, and a counter tells you how many duplicates were removed.

How it works

The text is split into lines, and each line is turned into a comparison key. With Trim whitespace on, leading and trailing spaces are ignored for the comparison. With Case sensitive off, the key is lowercased so "Apple" and "apple" match. The tool walks down the list and keeps a line only if its key has not appeared before.

The lines you get back are the original lines, not the trimmed or lowercased keys, so the first occurrence keeps its exact formatting. Empty lines are treated like any other line, so only the first blank line survives. The removed count is the number of input lines minus the number of output lines.

How to use

  1. 1

    Paste your list into the input box, one item per line.

  2. 2

    Leave Trim whitespace checked to ignore leading and trailing spaces, or uncheck it for an exact match.

  3. 3

    Uncheck Case sensitive if "Apple" and "apple" should count as the same line.

  4. 4

    Review the unique lines and the removed count, then click Copy.

Worked examples

Default settings

A fruit list with a repeat and a near-repeat.

Input
apple Banana apple banana cherry
Result
apple Banana banana cherry (1 duplicate line removed)

The second "apple" is removed. "banana " differs from "Banana" in case, so it is kept while Case sensitive is on.

Case-insensitive

Same list with Case sensitive unchecked.

Input
apple Banana apple banana cherry
Result
apple Banana cherry (2 duplicate lines removed)

After trimming and lowercasing, "banana " matches "Banana" and is dropped.

Limitations
Only whole lines are compared; it does not find duplicate words within a line. Trimming affects only the start and end of a line, not extra spaces in the middle.
Assumptions
Each item in the list is on its own line.
Privacy
Deduplication runs in your browser, and the list is not uploaded or saved.

Frequently asked questions

Is the comparison case sensitive?+

Yes by default. Uncheck Case sensitive to treat lines that differ only in capitalization as duplicates.

Does it preserve the original order?+

Yes. The first occurrence of each line stays where it was, and only later repeats are removed.

Which copy of a duplicate is kept?+

The first one, exactly as it was written, including any spaces or capitalization.

Are blank lines removed?+

Repeated blank lines are. The first blank line is kept like any other unique line.

Related tools