TextyConverterbeta
⌘K

Remove Duplicate Lines

Keep only the first occurrence of each line, preserving original order. Browser-only.

0 duplicates removed

About Remove Duplicate Lines

Duplicate-line removal keeps the first occurrence of each line and drops any subsequent identical lines. Order is preserved — the output looks like your input with later duplicates erased. Use the case-sensitive and trim-whitespace options to control what counts as a duplicate.

When to use it

  • Cleaning up a deduplicated list (emails, IDs, hostnames)
  • Removing repeated entries from a log slice
  • Producing a unique-rows version of a CSV (combine with line-count after)
  • Tidying a hand-edited list before processing it further

How it works

Lines are split on LF/CRLF. Each line is keyed against a Set; if the key has been seen, the line is dropped. The case-sensitivity toggle controls whether the key is lowercased; the trim toggle controls whether leading/trailing whitespace is normalized before comparison.

Examples

apple
banana
apple
cherry
banana
apple
banana
cherry

Frequently asked questions

Is line order preserved?
Yes. The first occurrence of each line keeps its position; only the later duplicates are removed.
What about case differences?
By default, comparison is case-sensitive — 'Apple' and 'apple' are different. Toggle the option to merge them.
Are surrounding spaces treated as significant?
By default yes — 'foo' and ' foo' are different. Enable the trim option to ignore leading/trailing whitespace.

Related tools