How to Use This Tool
Paste your lines and pick what to do with them. Every option reports how many lines it changed, so a surprising result is visible rather than silently accepted.
Natural versus alphabetical
A default sort compares strings character by character, so "1" comes before "9" and therefore
item10 comes before item2. That is correct string ordering and almost never
what anyone wants for a list containing numbers.
Natural sort treats runs of digits as numbers, giving item2, item9, item10. It is what file managers do, what people expect, and what a plain sort call does not give you. If your list has version numbers, filenames or anything ending in a counter, this is the option you want.
Lines that look identical and are not
Deduplication compares exact strings, so anything invisible defeats it:
- Trailing spaces.
"banana "and"banana"are different, and nothing on screen shows why they both survived. - Non-breaking spaces. Text copied from a web page or a Word document often contains U+00A0 instead of a normal space. It looks identical and compares differently.
- Line endings. A file from Windows uses carriage return plus line feed; one from Unix uses line feed alone. Mixed files leave stray carriage returns on some lines.
The panel at the bottom counts each of these in your text. Turning on "trim each line" fixes the first two for comparison purposes, which is why it is on by default.
Case sensitivity is a choice about your data
Apple and apple are different strings and usually the same thing. Which
behaviour you want depends on what the lines are:
- Ignore case for names, tags, keywords, email addresses — anywhere the capitalisation is incidental.
- Respect case for identifiers, file paths on a case-sensitive filesystem, and anything a computer will compare later.
When ignoring case, the first occurrence is the one kept, so the capitalisation of your output depends on the order of your input. That is worth knowing before you assume it picked the "right" one.
Shuffling
The shuffle uses Fisher-Yates, which gives every ordering equal probability. The obvious alternative — sorting with a random comparator — is measurably biased, and this site has a separate tool demonstrating exactly how much. If you are shuffling something that matters, the method is not a detail.
