Duplicate Line Remover

Remove repeated lines while keeping the original order. Choose exact, whitespace or case-insensitive matching.

Input stays in this browser tab. Limit 200,000 characters.

Choose a matching rule before discarding data

Decide whether spelling or spacing identifies the item

Keep exact matching for case-sensitive codes. For informal labels with accidental spaces or capitalization differences, use the narrowest matching rule that captures the intended duplicates. Here ␠ indicates a leading space. The input in order is ␠AB, ab and AB, one entry per line.

Which lines remain from a three-line list
ComparisonOriginal lines keptMatches removed
Exact␠AB, ab, AB0
Trim for comparison␠AB, ab1
Ignore case␠AB, ab1
Trim and ignore case␠AB2

Inspect look-alike lines before broadening the rule

The tool normalizes line endings and keeps the first original line for each key. A leading space survives in the output when the first matching entry contains it, even if trim is enabled. A trailing line ending is preserved as a line ending. Multiple truly empty lines share a matching key.

Two lines displaying café can contain different Unicode sequences. One version uses a precomposed é and the other an e followed by a combining mark. The Unicode normalization standard defines ways to convert them to comparable forms. This tool does not apply Unicode normalization or fuzzy matching. Review a sample before overwriting the original list.

Editorial review

Calculation method

Use exact matching for identifiers. Enable outer-whitespace or case-insensitive comparison for human-entered labels. The first original spelling and spacing survive. Matching normalizes line breaks to LF and never sorts the output.

For each line, retain the first occurrence of its matching key.

Assumptions and limits

Substring matching, accent folding and Unicode normalization are outside this workflow. Visually similar letters or differently composed accents can remain distinct.