Remove Duplicate Lines
Remove repeated lines while keeping their order. Keep the first or last match, with optional case and whitespace comparison.
Your text stays in this page. Usage analytics are enabled. Privacy details.
Enter text to get started.
How to use Remove Duplicate Lines
- Paste or type your input, or load an example above.
- Adjust the available options. Results update after you finish typing; for very large inputs, select Run.
- Review the result, then copy it or download it to your device.
Input and output examples
Keep the first occurrence in its original order
Input
pear
apple
pear
plum
appleOutput
pear
apple
plumMatch case-insensitively and keep the last occurrence
Input
Blue
green
BLUE
redOutput
green
BLUE
redCommon tasks and settings
Remove duplicate emails while keeping list order
Paste one email address per line from lists you want to compare. Choose First occurrence to preserve the order of the earliest matching entries. Ignore surrounding spaces compares rows without their outer whitespace; the retained line keeps its original spelling and spaces. Enable Ignore case only when those differences should match. This compares full lines, without validating addresses, merging aliases, or checking whether an inbox exists. Review the output before replacing your source list.
Tidy a reading queue of URLs
To tidy a reading queue collected from several documents, put each complete URL on its own line. Choose First occurrence to keep the queue in its existing order. Leave Ignore case off when paths or query values may distinguish resources: /Guide and /guide could refer to different pages. Decide whether surrounding spaces are accidental before enabling that comparison. Matching uses the whole line, so URLs with different tracking parameters remain separate and need manual review.
Keep the final copy of checklist items
For a checklist assembled over several editing rounds, choose Last occurrence to retain the final copy of each repeated item. Survivors stay at the positions of their last appearances. This selects repeated complete lines, rather than a newer record by date or by one column. Keep all blank lines preserves separators between groups; enable Remove blank lines for a compact list. Items with different notes or spelling will not match, so review those differences yourself.
How this tool works
Whitespace and case options affect matching keys only. Retained text is unchanged. Blank lines may pass through, be deduplicated, or be removed; remove blank lines takes priority. First and last modes both preserve the relative order of surviving entries.
Input and output stay in the current page. Refreshing or closing the page clears them. For very large inputs, use Run to start processing; a task that takes too long is stopped so you can change the input.
Frequently asked questions
Does trimming alter output?
No. It only changes how equality is tested; the selected original line is preserved.
Does keeping the last occurrence sort the list?
No. It keeps each final occurrence in its original relative position.