Boneyard Tools

Remove Duplicate Lines From Text

Paste a list and this tool drops every repeated line while keeping the first copy of each in the exact order you pasted it. It normalises Windows and Mac line endings before comparing, and a live counter shows how many duplicates were removed. Two switches control whether matching cares about letter case and about the spaces around each line.

How to remove duplicate lines

  1. Paste your list or block of text into the Your text box.
  2. Leave Case-sensitive on to treat Apple and apple as different, or turn it off to merge them.
  3. Leave Ignore surrounding spaces on so padded copies of a line still count as duplicates.
  4. Watch the duplicates removed counter update as you edit.
  5. Click Copy to take the de-duplicated result from the Result box.

Examples

Dedupe a list and keep the original order

apple
banana
apple
cherry
banana
apple
banana
cherry

Case-insensitive match merges Apple and apple

apple
banana
apple
Apple
apple
banana

Repeated blank lines collapse to one

red

red

blue
red

blue

Frequently asked questions

Does it keep the original order?

Yes. The first time a line appears it stays in place, and later duplicates are dropped, so the sequence you pasted is preserved. It is not sorted, so if you want an alphabetical result run the output through a line sorter afterwards.

Is the comparison case-sensitive?

By default yes, so Apple and apple are treated as two different lines. Turn off Case-sensitive to fold them together, in which case the first spelling encountered is the one kept.

What about leading or trailing spaces?

By default surrounding whitespace is ignored when comparing, so ' item' and 'item' count as the same line. The kept line keeps its original spacing. Turn off Ignore surrounding spaces to treat differently padded lines as distinct.

How are blank lines handled in the tool?

In the web tool blank lines are compared like any other line, so a second empty line is removed as a duplicate. That means runs of blank lines collapse to a single one in the result.

Does it change the text on the lines it keeps?

No. Trimming and case folding only affect the comparison key, never the output. The lines you keep are written back exactly as you pasted them, including their spacing and capitalisation.

Which line endings does it understand?

Windows CRLF and classic Mac CR are converted to Unix LF before splitting, so text from any operating system deduplicates correctly. The result is joined back with LF line feeds.

Can it remove duplicate words or items on one line?

No. This tool works line by line only. To deduplicate comma-separated values on a single line, split them onto separate lines first, dedupe, then join them again.

Is there a size limit?

There is no hard limit. Everything runs in your browser, so the ceiling is your device memory, and lists with thousands of lines are handled instantly.

Is my text private?

Yes. All processing happens locally in your browser and nothing is uploaded to a server, so private lists stay on your device.

Learn more

Related tools