Text Sorter

Sort lines A to Z, Z to A, by number, by length, in reverse or at random, with options to remove duplicates. Free and private.

Runs in your browserNo sign-upWorks offline
Ctrl+Enter to run
Input131 characters
Output
✓ ReadySample content shown

What the Text Sorter does

The Text Sorter puts lines of text in order. Sort alphabetically either way, by the numbers inside each line, by line length, reverse the current order or shuffle it. Options let you ignore upper and lower case, remove duplicates and drop empty lines while sorting.

How to use it

  1. Paste your lines into the Input box, one item per line.
  2. Pick the order: A to Z, Z to A, numbers low to high or high to low, shortest or longest first, reverse, or shuffle.
  3. Set the options for case, duplicates and empty lines.
  4. Copy or download the sorted list. For shuffle, press Shuffle again for a new random order.

Example

A list of file names reads “chapter 10, chapter 2, chapter 1, Chapter 3”. A plain alphabetical sort would put “chapter 10” before “chapter 2”. Because the A to Z option compares numbers by their value and “Ignore upper and lower case” is on, the result is chapter 1, chapter 2, Chapter 3, chapter 10, which is the order a person expects.

Sorting by number

The number options read the first number in each line, including decimals and negative numbers, and sort by its value. Lines without a number go to the end. This is handy for prices, scores or lines such as “Order 125 – shipped”.

Shuffle uses your browser’s random numbers to mix the lines, which is fine for picking a random order of names or questions. For draws that need to be provably fair, use a dedicated tool.

Questions people ask

Does it sort accented letters correctly?

Yes. Sorting follows the rules of your browser’s language, so “é” sorts next to “e” rather than after “z”.

Can I sort a CSV by one column?

This tool sorts whole lines. Lines that start with the column you want will sort by it; for other columns, use a spreadsheet or the CSV Editor.

Will it remove duplicates?

Only if you tick “Remove duplicates”. The first copy is kept.

Is my list private?

Yes. Sorting happens in your browser.

Related tools