All Tools

List Sorter: Alphabetical, Numeric, Natural, Random

Sort a list alphabetically, naturally, numerically or by length, or shuffle it, in your browser. Any separator, trim, remove blanks and duplicates. Nothing is uploaded.

Items are separated by
Sort
Order

0 characters, 0 bytes

0 characters, 0 bytes


About the List Sorter

The List Sorter puts the items of a list in order: alphabetical, natural, numeric or by length. It can also shuffle a list at random or simply reverse it. Paste a column of names, a comma-separated line of tags, a set of file names or any other list, choose how the items are separated, and the sorted list appears straight away, ready to copy. You can trim spaces, drop blank items and remove duplicates in the same step. Everything runs in your browser, so it works on any list you can paste.

How to sort a list

Steps

  1. Paste or type your list into the input.
  2. Under Items are separated by, choose New line, Comma, Semicolon, Space or Custom. For Custom, type the exact text that sits between items, for example |.
  3. Under Sort, choose Alphabetical, Natural, Numeric, Length, Shuffle or Reverse, and pick Ascending or Descending where the choice applies.
  4. Set the options below: Case insensitive, Trim items, Remove blank items and Remove duplicates.
  5. Copy the result. A note under it reports the item count and what was removed.

Privacy

Sorting happens entirely in your browser. Your list never leaves your device, and nothing is kept once you close or reload the tab.

Which sort to choose

Alphabetical

Items are compared character by character from the left. With Case insensitive on, the default, banana, Apple and cherry come out as Apple, banana, cherry, and accented letters sort beside their plain forms, so é sits with e. With it off, the order follows the raw character codes, so every capital letter comes before every lower-case one: banana, Apple, cherry and Banana give Apple, Banana, banana, cherry.

Natural

Numbers inside the text are compared by value instead of digit by digit. Alphabetical order puts item10 before item2, because the character 1 comes before 2 and the comparison stops there. Natural order reads 10 as ten and gives item1, item2, item10. Use it for file names, version labels, chapter numbers and anything with a counter in it. Leading zeros are ignored when comparing, so item007 sorts as 7.

Numeric

Items are read as numbers and placed by value, so 10, 9, 100, -5, 2.5 becomes -5, 2.5, 9, 10, 100. Anything that is not a number is placed after the numbers in its original order, and the note says how many there were: 10, abc, 2, xyz gives 2, 10, abc, xyz. The Sort Numbers page opens with this mode already selected.

Length

Items are ordered from shortest to longest, or the reverse. Length counts characters, so an emoji counts as one. Items of equal length stay in their original order: ccc, a, bb, d give a, d, bb, ccc.

Shuffle and Reverse

Shuffle puts the items in a random order using a Fisher-Yates shuffle, and Shuffle again gives a new order. The random numbers come from your browser's cryptographic random generator, the same source used to create encryption keys, rather than a predictable pseudo-random formula. Reverse flips the list end to end without comparing anything. Neither mode shows the Order choice, but trimming, blank removal and duplicate removal still apply.

Clean-up options

  • Trim items removes spaces around every item. It is on by default, so pear, apple, fig is read as three tidy items. With a comma or semicolon separator, trimming also puts one space after each separator in the output.
  • Remove blank items drops empty items, such as the gap left by a double comma or an empty line. It is on by default.
  • Remove duplicates keeps the first of any equal items. It is off by default. With Case insensitive on, Apple and apple count as the same item; turn it off to keep both.

Clean-up runs before sorting. For example, b, a, an empty line, b and A with all three options on give a and b, and the note reads 2 items, 1 blank and 2 duplicates removed.

Separators

New line accepts Unix, Windows and old Mac line endings and writes the result with plain line breaks. The sorted list is always joined with the same separator you split on, so a comma list stays a comma list. An empty Custom separator shows an error asking for one.

Related tools

To strip repeated entries without sorting, use the Duplicate Remover. The Text Case Converter changes capitalisation before you sort, and the Whitespace Remover cleans up stray spaces and blank lines in the source text. If you need a random pick rather than a shuffled list, try the Random Number Generator.

Frequently asked questions

Why does item10 sort before item2 in alphabetical order?

Alphabetical order compares one character at a time from the left, and at the first difference the digit 1 comes before 2, so the comparison ends there. The tool does not read 10 as ten. Choose Natural instead and the digit runs are compared by value, giving item1, item2, item10.

What is the difference between case insensitive and case sensitive sorting?

With Case insensitive on, which is the default, upper and lower case letters are treated alike, so Apple, banana and cherry are in the order a reader expects. With it off, items follow raw character codes, so every capital letter sorts before every lower-case letter and Banana lands ahead of apple.

How does the shuffle work and is it really random?

Shuffle runs a Fisher-Yates shuffle, and each swap position is drawn from your browser's cryptographic random generator rather than a predictable pseudo-random formula. Every ordering is equally likely, and the Shuffle again button draws a fresh order from the same cleaned list whenever you want one.

Which separators can I use to split my list?

You can split at new lines, commas, semicolons, spaces or any Custom text you type, such as a pipe with spaces around it. The sorted items are joined back with the same separator. A custom separator must not be empty, otherwise the tool asks you to enter one.

Does sorting remove blank lines and duplicates?

Blank items are removed by default, while duplicates are kept until you turn on Remove duplicates, which keeps the first copy of each. Clean-up happens before sorting, and the note under the result reports how many blanks and duplicates were dropped so nothing disappears without a trace.

How are items of the same length ordered when sorting by length?

Items of equal length keep the order they had in your input, so the result is stable and predictable. Length is counted in characters rather than bytes, which means an emoji or an accented letter counts as one. Descending puts the longest items first and still leaves ties in their original order.

What happens to numbers when I sort a list of mixed items?

In Numeric mode the items that are numbers are placed first by value, and every item that is not a number follows in its original order, with a note counting them. If your list is really text with numbers inside, such as file names, pick Natural, which keeps words and digits together.

Other related tools