Remove Duplicate Lines

Remove repeated lines while keeping the surviving source order.

Text & Regex
Preparing your workspace…
Input
Output
Your result will appear here.

How to use

  1. Paste your list or open a UTF-8 file.
  2. Choose first or last occurrence and comparison options.
  3. Copy or download the unique lines.

Deduplicating text line by line

Keep one occurrence of each line while preserving the relative order of the lines that remain. By default, comparison is exact and the first occurrence is kept.

Choose trimming, case-insensitive comparison, blank-line removal, or NFC normalization when those rules suit your data.

One line per record

Matching lines are removed as whole records. A final newline is a record delimiter rather than an extra empty record. Explicit blank lines are retained unless you choose to remove them.

Keeping the first occurrence
Input
Apple
Banana
Apple
Cherry
Banana
Result
Apple
Banana
Cherry

The first Apple and Banana remain in their original order.

First or last, with optional comparison rules

Keep First retains the earliest occurrence; Keep Last retains the latest, preserving the order of the surviving records. Ignore Case compares Unicode lowercase forms. NFC makes canonically equivalent spellings compare equal without rewriting the kept spelling.

What changes in the output

Trim Each Line removes surrounding whitespace from output as well as comparison. Other comparison options keep the surviving text as written. A leading BOM and final newline are retained; mixed line endings use the first separator found.

Processing limits

Up to 5 MiB of text, 100,000 logical lines, 20 MiB of output, and 10 seconds for text transformations. Regex tests allow 1 MiB of input, 4,096 pattern code units, 500 reported matches, and 2 seconds. Files must use UTF-8. All processing stays on your device.

?

Frequently asked questions

Does the tool sort my list?

No. It preserves surviving source order. Use Text Sorter when you want to reorder lines.

Are Apple and apple duplicates?

Only when Ignore Case is enabled; exact matching is the default.

Can I keep the last occurrence?

Yes. Select Last; earlier matching records are removed.

What does NFC comparison change?

Canonically equivalent Unicode forms compare equal, while the kept record retains its original spelling.

Does ignoring case perform full Unicode case folding?

No. It uses Unicode lowercase conversion and does not add locale-specific or full case-folding rules.

Find your next tool

Language

Switch language? Your current work will be cleared. Copy or download it first.