List sorter and de-duplicator
Sort, de-duplicate, trim, number, prefix, wrap and reverse a list of lines — the twenty seconds of text editing nobody wants to open an editor for.
The twenty seconds nobody wants to open an editor for
You have a column pasted out of a spreadsheet, or a list of emails, or the output of a command, and you need it sorted, de-duplicated, or turned into a comma-separated line. It is thirty seconds in a text editor if you already have one open with the right plugin, and five minutes if you do not.
Natural sort, which is the one you meant
A plain alphabetical sort puts item10 before item2, because it compares character by character and 1 comes before 2. That is correct for text and wrong for every list a person has ever written.
Natural sort reads runs of digits as numbers, so item2, item10, item100 come out in that order. Use it for anything with a number in it — filenames, versions, chapter headings, invoice numbers.
De-duplicate, keeping the order or not
Two versions, because they answer different questions. Sorting while de-duplicating is right when you want to know the distinct set. Keeping the original order is right when the order carries information — a log, a sequence of steps, a priority list — and you only want the repeats gone.
Turning off case sensitivity is what you want for email addresses. Jane@Example.com and jane@example.com are the same mailbox, and a case-sensitive de-duplication leaves you sending both of them the same message. For an actual list of case-sensitive identifiers, leave it on.
Counting occurrences
Gives each distinct line with how many times it appeared, most frequent first. This is the quickest way to find the top errors in a log file, the most common value in a column, or the duplicate that is breaking a unique constraint.
Comparing two lists
Paste both, separated by a line containing only ---. You can then get the lines present in both, or the lines only in the first — which between them answer "who is on both lists" and "who did we lose".
The join field is the useful one
Leave it blank for one item per line. Put a comma in it and a column from a spreadsheet becomes a single line — which is how you turn 400 pasted IDs into an SQL IN clause, or a list of emails into something the To field will accept.
Combined with the prefix and suffix fields you can wrap each item first: a prefix of ' and a suffix of ' with a comma join gives you a quoted, comma-separated list ready to paste into a query.
The shuffle is a real shuffle
Fisher-Yates, using the browser's cryptographic random source. Worth mentioning because the usual shortcut — sorting with a random comparator — is measurably biased and does not produce a uniform permutation, since a comparator that is not a consistent ordering breaks the sort itself. If you are drawing a winner from a list, that matters.
Nothing is uploaded
Lists of email addresses, customer IDs, employee names and internal hostnames are exactly what people paste into a tool like this. It runs in the page.
Common questions
Why is item10 sorted before item2?
That is a plain alphabetical sort comparing characters, where 1 comes before 2. Use the natural sort, which reads runs of digits as numbers.
How do I turn a column into a comma-separated line?
Put a comma in the join field. Add a prefix and suffix of an apostrophe first if you need each value quoted for an SQL IN clause.
Should I turn off case sensitivity?
Yes for email addresses — Jane@ and jane@ are the same mailbox, and a case-sensitive de-duplication leaves both in. Leave it on for identifiers where case is meaningful.
What is the difference between the two de-duplicate options?
One sorts as well, which answers "what is the distinct set". The other keeps the original order, which is what you want when the order carries information.
How do I compare two lists?
Paste both separated by a line containing only ---, then choose lines in both, or lines only in the first.
Is the shuffle random enough to pick a winner?
Yes — Fisher-Yates with the browser\u2019s cryptographic random source. The common sort-by-random-comparator trick is biased and would not be.