Paste a list and sort it, remove duplicates, strip blank lines, trim whitespace, number the lines, reverse the order or shuffle it. Operations apply in a fixed, predictable order, and a few details are handled the way you would actually want. Natural sort reads embedded numbers as numbers, so item2 comes before item10 — plain alphabetical sorting gets that backwards, which is technically correct and practically useless for anything numbered. Deduplication keeps the first occurrence and the original order unless you also sort, rather than quietly rearranging your list. Line numbers are padded so a hundred-line list stays aligned instead of stepping right at line ten. And the shuffle takes a seed, so the same seed gives the same order — worth having when you need to reproduce or share a shuffle.
| Mode | item10, item2, item1 |
|---|---|
| Alphabetical | item1, item10, item2 |
| Natural | item1, item2, item10 |
| Length | item1, item2, item10 |
| Reverse order | item1, item2, item10 (input order flipped) |
| Numeric | Sorts by a leading number, not an embedded one |
No. Everything happens in your browser.
It reads numbers inside the text as numbers, so item2 sorts before item10. Alphabetical sorting compares character by character, reaches 1 against 2, and puts item10 first. Use natural sort for anything numbered — files, versions, chapters.
No. The first occurrence of each line is kept in its original position. The order only changes if you also choose a sort.
Trim, then remove blanks, then deduplicate, then sort, then number. That order matters — trimming first means a line of spaces counts as blank, and numbering last means the numbers reflect the final list.
Puts them after the numeric ones, sorted among themselves. Letting a comparator return NaN scatters them unpredictably, which is what happens in most naive implementations.
So it can be repeated. The same seed always produces the same order, which means you can share a seed and get the same result, or re-run one. An unseeded shuffle is impossible to reproduce.
Operations apply in a fixed order — trim, remove blanks, deduplicate, sort, number — because the order changes the answer and an arbitrary one produces results people cannot predict. Trimming runs before blank removal so a line of spaces counts as blank, which is almost always what is meant. Deduplication uses a Set, which preserves first-seen order, so removing duplicates without also sorting leaves the text in its original sequence rather than silently reordering it. Numbering runs last and pads the numbers to a common width, so a hundred-line list stays aligned instead of stepping right at line ten. The sorting modes are where the detail is. Natural sort uses a numeric-aware collator, so item2 comes before item10 — plain alphabetical comparison reaches the second character, compares 1 against 2, and puts item10 first, which is correct alphabetically and wrong for anything a person numbered. Numeric sort reads a leading number from each line and places lines with no number after the ones that have one, rather than letting NaN comparisons scatter them unpredictably, which is what happens when a comparator returns NaN. Case-insensitive sort lowercases only for comparison and leaves the text as written. Shuffling uses a seeded generator, so the same seed reproduces the same order — useful when a shuffle needs to be repeated or shared, and impossible with Math.random. Character counts are by grapheme, so an emoji counts as one character rather than four. Everything runs in your browser.