UTILS.
Private by default
≣

Duplicate Line Remover

Remove duplicate and empty lines from text.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
output

About this tool

Strip duplicate and empty lines from a list, all in your browser.

Lines are split at line breaks and the first occurrence of each distinct line is kept. Trim each line, off by default, removes leading and trailing spaces before comparing, so "apple" and "apple " count as different until you turn it on. Remove empty lines, on by default, also drops whitespace-only lines. Case-insensitive matching treats Apple and apple as the same and keeps the first spelling.

Turning keep order off sorts the remaining lines in plain character order, with capitals before lowercase unless matching is case-insensitive. A note shows how many lines were removed out of the total.

Frequently asked questions

Are duplicates detected after trimming?
Yes, if trim each line is enabled, lines are trimmed before comparison so spacing differences are ignored.
Is the original order kept?
With keep order on, the first occurrence of each line stays in place; turn it off to sort the result.
Why are two lines that look identical both kept?
They probably differ by trailing spaces, a hidden carriage return from Windows line endings, or letter case. Turn on trim each line, and case-insensitive matching if capitals should not matter.

More tools