Skip to content
PrivBay

Remove duplicate lines and sort a list

Keep one copy of each line, preserve the original order or sort the remaining lines.

Line options

Ready. This runs on your device.

What to do next

  • Word counter Count words, characters, sentences and paragraphs as you type.

How to remove duplicate lines and sort a list

  1. Paste a list into Original lines.
  2. Choose a Line order and set any matching or cleanup options.
  3. Select Process lines, review the number removed and choose Copy result.

Deduplicate a list while keeping the first entry

Paste one item per line from a keyword list, log extract, group of filenames or spreadsheet column into this duplicate line remover. By default the tool is set to remove duplicate lines by keeping the first occurrence in its original position and dropping later exact matches. When you deduplicate a list, whole lines are compared rather than repeated words inside a single line, and the summary bar reports the exact number of removed entries.

Trim line edges, ignore case or skip blank lines

Select Ignore letter case when entries such as Blue and blue represent the same item. Enable trim line edges if pasted rows picked up leading or trailing spaces; trimming cleans both the comparison key and the returned lines. Turn on skip blank lines to strip empty or whitespace-only rows at the same time, or leave those checkboxes off when indentation is significant.

Sort a list in natural order or keep original order

Choose ascending or descending natural order when you want to sort lines or sort a list containing numbers, so file-2 appears before file-10 instead of after it. Clear Remove duplicate lines if you want to sort every row without removing repeats. Use remove extra spaces to collapse spacing inside lines, text compare to inspect differences between two versions and the case converter if the cleaned items need uniform capitalization.

Frequently asked questions

Which copy of a duplicate is kept?

The first occurrence is kept. When Ignore letter case is on, that occurrence keeps its original capitalization.

Can I sort without removing lines?

Yes. Clear Remove duplicate lines and choose ascending or descending natural order.

What is natural order?

Digits are treated as numbers inside each line, so item 2 comes before item 10 in ascending order.

Can I ignore whitespace around a line?

Choose Trim line edges to remove outside whitespace before comparing and to return the trimmed lines.

How many lines can I process?

Up to 10,000 lines and 100,000 characters per operation.

Last updated November 11, 2026