Skip to main content
Premier SEO Services

Text tools

Remove Duplicate Lines

Delete repeated lines from a list or block of text while keeping the remaining lines in their original order.

  • Runs in your browser
  • Free, no sign-up
  • Unlimited use
  • Updated 30 September 2026

Remove Duplicate Lines

Paste your text — the result updates as you type

How to use the remove duplicate lines

  1. 1Paste your list into Text with duplicate lines, one item per line.
  2. 2Choose whether capital letters and surrounding spaces should count as differences.
  3. 3Copy the result from Unique lines, or switch Show to Removed duplicates to see what was taken out.

Example

Input
apple
banana
Apple
cherry
banana

date
cherry 
Output
apple
banana
Apple
cherry
date

With the default settings, “cherry ” (with a trailing space) matches “cherry”, and the empty line is removed. Tick Ignore case and “Apple” is removed too.

Keeping the first or last occurrence

By default the first time a line appears is kept and later copies are removed, so the list keeps its original order. Choose The last occurrence when later lines are more up to date, for example in a log where the newest entry is at the bottom. Choose No copies to keep only lines that appear exactly once, which is useful for finding the items two lists don't share.

Case and whitespace matching

Lines are compared exactly unless you tell the tool otherwise. Ignore case treats “Apple” and “apple” as the same line; the version that is kept is the one that appears first. Ignore leading and trailing spaces stops invisible spaces, common in data pasted from spreadsheets, from making two identical-looking lines count as different.

Seeing which lines were removed

Switch Show to Removed duplicates to list every line that appeared more than once, with the number of times it appeared (for example banana ×2). The same settings apply, so this view always matches what the unique list removed.

Sorting after deduplication

This tool never reorders your lines. If you also want the list in alphabetical order, paste the result into sort lines. To compare two separate lists rather than clean one, use the list comparison tool.

Is my text private?

This tool runs entirely in your browser. Your text is not uploaded to our servers.

Questions about the remove duplicate lines

Does it keep the original order?

Yes. Remaining lines stay in the order they first appeared (or last appeared, if you choose that option). Nothing is sorted.

Can it ignore capital letters?

Yes. Tick Ignore case. The first spelling of each line is the one that's kept.

Can I just count the duplicates?

Switch Show to Removed duplicates. Each repeated line is listed once with its count, and the status bar shows how many distinct lines repeated.

Is there a limit on list length?

No fixed limit. Lists of several hundred thousand lines work in current browsers; the result updates once you stop typing.

Last updated 30 September 2026Maintained by Premier SEO Services

Report a problem