Free exact browser converter
Duplicate Line Remover
Remove repeated lines while preserving the first occurrence and original order. Compare exactly, ignore case or ignore line-edge whitespace.
Interactive tool
Duplicate Line Remover
Ready
Choose a clear output representation.
Detailed conversion guide
How Duplicate Line Remover Works
The tool records each comparison key as it scans the input and writes only its first occurrence. It does not sort the remaining lines.
Ignore-case lowercases keys for comparison; ignore-edge-whitespace trims keys. Both modes retain the first original line, including its case and spaces.
| Input | Output | Meaning |
|---|---|---|
apple
pear
apple
Pear | apple
pear
Pear | Default example |
b
a
b
| b
a
| Boundary example |
JavaScript Example
Runnable example for the default sample. The tool also validates its full input contract.
const unique=Array.from(new Set(input.split("\n"))).join("\n");Formats, Boundaries and Limitations
Repeated blank lines are consolidated like any other duplicates. Exact mode keeps differently spaced or differently cased lines distinct.
Line endings become LF, and one final newline is kept if present. Case folding uses JavaScript lowercase rules rather than locale-specific linguistic matching.
Related converters
More Text and Encoding Tools
Choose the tool that matches your text or byte workflow.