Skip to main content
Tools

Remove Duplicate Lines

Remove duplicate lines from text, optionally ignoring case and whitespace, or list only the lines that repeat.

Keep

0 characters · 1 line

Lines
0
Removed
0
Result lines
0
Repeated lines
0

Options only change how lines are compared; the result keeps each line as written.

How to use

  1. Paste a list into “Your text”, one item per line, or click “Example” to try it out.
  2. The result appears instantly on the right (below on phones), along with the number of lines, how many were removed and how many lines repeated.
  3. Turn on “Ignore case” or “Ignore leading and trailing spaces” if needed, and choose whether the first or last occurrence is kept.
  4. To find out what repeats, set “Show” to “Only repeated lines”; “Only lines that appear once” keeps just the items that are not repeated.
  5. Click “Copy” or “Download” to grab the result.

FAQ

Is my data uploaded?

No. Lines are compared in your browser and never leave your device, even for lists with hundreds of thousands of lines.

Does “Ignore leading and trailing spaces” remove spaces from the result?

No. The options only decide which lines count as duplicates; every line in the result is kept exactly as written. To clean up spaces as well, run the text through the Whitespace Cleaner first.

What is the difference between keeping the first and the last occurrence?

The same lines remain, but in different places: with “First occurrence” a repeated line stays where it first appears, with “Last occurrence” where it last appears. When ignoring case, the result uses that occurrence’s spelling, such as Apple or APPLE.

How are empty lines handled?

“Treat like other lines” keeps only the first empty line. “Keep all” leaves every empty line in place, which preserves paragraph breaks. “Remove all” deletes them. Lines with only spaces or tabs count as empty.

Why are two lines that look the same not treated as duplicates?

Usually because of invisible trailing spaces or tabs, or full-width versus half-width characters (A and A). Try “Ignore leading and trailing spaces”, or remove non-breaking spaces and zero-width characters with the Whitespace Cleaner.

Are line breaks changed?

The result uses the first kind of line break found in the input (Windows CRLF or macOS/Linux LF), and a line break after the last line is kept.

Keyboard shortcuts

/
Search tools (on a tool page, goes to the homepage search)
?
Show this help
Esc
Close a dialog
Ctrl / ⌘Enter
Run the tool's main action (where supported)

While you type in a text field, / and ? are typed as usual.