Skip to content

Text Tools

Remove Duplicate Lines

Deduplicate line-based lists with optional case-insensitive matching and empty-line removal.

πŸ”’ Your files and data never leave your device

Settings

The first occurrence of each line is kept, so the original order is preserved.

Simple workflow

How to use Remove Duplicate Lines

  1. 1Paste a line-based list.
  2. 2Choose matching and empty-line options.
  3. 3Remove duplicates and copy the ordered result.

Good to know

Frequently asked questions

Does the tool trim or normalize lines before matching?

No. Leading and trailing spaces remain significant, and no Unicode normalization is applied. Remove empty lines uses trimming only to identify blank rows.

Does my list leave the browser?

No. The browser compares the line strings, keeps the first match and produces the ordered result in this tab without sending the list to a server.

Practical guide

Deduplicate exact lines without silently rewriting them

Remove Duplicate Lines reads the input from top to bottom, keeps the first occurrence of each match and removes later matches. The remaining lines stay in their original order and retain the exact spelling and spacing of the first line kept.

Matching does not trim text or apply Unicode normalization. Ignore letter case changes only the comparison key by applying the browser's locale-aware lowercase conversion. Remove empty lines uses trimming only to decide whether a line is blank; it does not trim non-empty output.

Worked example

See how case and spaces affect a list

Start with
Paste these lines in order: Apple, apple, two leading spaces plus Apple, a blank line, another blank line, then Pear.
Choose
Enable Ignore letter case and Remove empty lines, then select Remove duplicates.
You get
The result keeps Apple, the indented Apple and Pear. The lowercase duplicate is removed, both blank lines are dropped, and the indented line remains because its leading spaces are significant.

Tips for a useful result

  • Leave Ignore letter case off when Product and product must remain distinct values.
  • Use Text Compare to inspect the original and cleaned versions when whitespace differences may be meaningful.
  • Deduplication runs in this tab; the list is not uploaded or recorded in analytics.

Exact behavior matrix

These rules describe the current implementation. The first matching line is always the one retained.

Input or settingWhat happens
Case-sensitive (default)Only lines with the same code points and spacing match. Apple and apple remain separate.
Ignore letter caseLines are compared after locale-aware lowercasing. The original spelling of the first occurrence is preserved in the output.
Remove empty lines offAn exact repeated empty line is deduplicated like any other line. A line containing spaces is separate from a zero-length line.
Remove empty lines onZero-length lines and lines containing only whitespace are removed. Non-empty lines are not trimmed.
Leading or trailing spacesSpaces remain part of the comparison, even with Ignore letter case enabled, so Apple and an indented Apple are different.
Unicode variantsNo Unicode normalization is applied. Visually similar composed and decomposed text can remain as two lines.

Keep going

Related tools

View all β†’