Remove Duplicate Lines
Paste a list with one item per line and click Remove Duplicates. The first occurrence of each line is kept, in its original position unless you choose a sort order.
Runs in your browser: your files and text are not uploaded. Free, no account needed.
Last updated: · Reviewed by the QuickTooly Team
Remove Duplicates Guide
How lines are compared
- Case Sensitive Yes (default):
Appleandappleare different lines. No: lines are compared in lowercase, and the kept line uses the spelling of its first appearance. - Trim Whitespace On (default): spaces and tabs at both ends of each line are removed before comparing, and the output shows the trimmed lines. Off:
applewith a trailing space andappleare different. - Empty lines are always dropped and are not counted in Lines Input. With Trim off, a line made only of spaces is kept.
- Spaces inside a line count:
New Yorkwith two spaces differs fromNew York. - Only whole lines are compared. Repeated words inside a line, or two CSV rows that differ in one column, are left alone.
Sort order after removing duplicates
Preserve keeps first-seen order. A→Z and Z→A use the browser's localeCompare, which gives dictionary order rather than character-code order: in English, apple sorts just before Apple, and éclair sorts next to eclair. Numbers inside lines are compared digit by digit, so item10 comes before item2.
Duplicate removal questions
Which copy of a duplicate is kept?
The first one. Later copies are removed. With Case Sensitive set to No, the kept line uses the capitalization of its first appearance.
Why is Lines Input lower than the number of lines I pasted?
Empty lines are removed before counting, so they are not included in Lines Input or Duplicates Removed.
Can I sort the result numerically?
Not here. A→Z compares text, so 10 sorts before 2. Copy the result into Sort Lines and use its Numeric option.
Related text tools
- Sort Lines: numeric sort and shuffle for the de-duplicated list.
- Text Cleaner: collapse inner spaces first, so lines that differ only in spacing count as duplicates.
- Word Frequency: count how often each word repeats instead of removing lines.