Text utility
Remove Duplicate Lines
Paste text to keep each first-seen line in order. Choose how case, surrounding whitespace, and empty lines affect the result.
Remove duplicate lines
How to remove duplicate lines
Process your text locally in three steps while keeping the first matching line in its original order.
- Paste or type text into the input area. Each textarea line is checked separately.
- Choose whether comparison is case sensitive, ignores surrounding whitespace, or removes trimmed-empty lines.
- Select Remove duplicates, review the counts and output, then copy the current result when ready.
Frequently asked questions
- Which duplicate line is kept?
- The first raw line for each comparison key is kept, and kept lines remain in their original first-seen order. Later matching lines are removed.
- How do the comparison options work?
- Case sensitive is on by default. When it is off, comparison uses JavaScript toLowerCase(). Ignore surrounding whitespace compares trimmed lines but keeps the first raw line unchanged. Remove empty lines excludes lines whose trimmed text is empty.
- What does Duplicates removed count?
- It counts only non-empty-filtered lines skipped because the same comparison key appeared earlier. Lines removed by Remove empty lines are excluded from that count.
Related text tools
Count your processed text or convert its ASCII letter case for the next step in your workflow.