Text Sorter

Sort lines alphabetically, numerically, by length or randomly

Sort a list of lines A-Z or Z-A, in natural order (item2 before item10), by the numbers they contain, by length, randomly or in reverse - optionally by one column of CSV data, ignoring "the" and "a", and removing duplicates.
Try an example:

Output will appear here...

About Text Sorter

How it works

  1. Each line is one item. Natural order compares numbers inside text by value, so "item2" comes before "item10"; strict order compares character codes, as many code editors do.
  2. Number sorting finds the first number in each line (ignoring currency symbols and thousands commas), so "$1,200 laptop" sorts as 1200. Lines without numbers go last.
  3. With a column number, only that column of comma-, tab- or otherwise separated lines is compared - handy for CSV data.
  4. Shuffle uses a cryptographically secure random generator, so every order is equally likely.

What you need

  • A list with one item per line.

Tips

  • Sort a book or film list with "Ignore The, A, An" so "The Matrix" files under M.
  • Paste a spreadsheet column, sort it and paste it back.
  • Turn on "Remove duplicate lines" to sort and de-duplicate in one step.

Limitations

  • Sorting follows English alphabet rules; some languages order accented letters differently.

Runs in your browser. Your text never leaves your browser.

Frequently asked questions

How do I sort lines alphabetically?+

Paste your list, keep "A → Z, natural" selected and click Run. The sorted list appears on the right, ready to copy.

What is natural sort?+

A sort that treats numbers inside text as numbers: file2, file10, file100 rather than the computer order file10, file100, file2.

Can I sort by a column?+

Yes. Enter the column number (1 for the first) and choose the separator. Only that column is compared, but whole lines are kept together.