Free Sort Lines and Remove Duplicates Tool

Paste a list — names, emails, URLs, anything one-per-line — then sort it and strip the duplicates. Output updates live.

Why "file10" sorts before "file2" without natural sort

Plain alphabetical sorting compares text character by character, and as a character, "1" simply comes before "2" — so "file10" sorts before "file2" even though 10 is the larger number. This is a routine source of confusion whenever a list mixes text and numbers: version numbers, file names, invoice numbers, product SKUs. Natural sort (built here on the browser's Intl.Collator with numeric comparison enabled) fixes this by recognizing a run of digits as a single number for comparison purposes rather than a string of individual characters — so it correctly places file2 before file10, and works just as well on plain numeric lists, sorting values in true numeric order rather than character order.

Common reasons to sort and dedupe a list

Frequently Asked Questions

How does "ignore case" affect deduplication?

With it on, "Apple" and "apple" count as the same line and only the first occurrence is kept. Sorting also becomes case-insensitive, so both spellings group together.

What is natural sort?

Number-aware ordering: file2 comes before file10, the way humans expect. Plain alphabetical sorting puts file10 first because "1" precedes "2" as a character.

Can I sort a list of plain numbers numerically instead of alphabetically?

Yes — the Natural sort mode treats runs of digits as actual numbers rather than character sequences, so a list of plain numeric lines sorts in true numeric order (2 before 10) rather than lexical text order.

Does trimming whitespace happen before or after deduplication?

Before — if "Trim whitespace" is checked, leading and trailing spaces are stripped first, so " Apple" and "Apple" are correctly treated as the same line and deduplicated together rather than being kept as separate entries.

How large a list can this handle?

Tens of thousands of lines sort instantly — the work happens in your browser with native JavaScript sorting, so the practical limit is your device's memory.

Which duplicate is kept?

The first occurrence in the original order is kept and later repeats are dropped. If sorting is enabled, the survivors are then sorted.