Skip to content
toolgrid

No tool found. Try another word.

Text Sorter

Sort lines of text alphabetically (A–Z or Z–A), by number, by length, in reverse or random order. Remove duplicates and empty lines while sorting.

lines

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the Text Sorter

  1. 1 Paste your list into the left box, one item per line.
  2. 2 Choose the order and the options, such as removing duplicates.
  3. 3 Copy or download the sorted list.

About the Text Sorter

The text sorter puts the lines of a list in order: alphabetically from A to Z or Z to A, numerically, by length, in reverse, or shuffled at random. It is a quick way to alphabetize names, keywords, references, glossaries or any list you work with.

Alphabetical sorting ignores accents, so "Éclair" sorts with the other words starting with E, and by default it ignores uppercase and lowercase. Numeric sorting looks at the first number in each line, so "item 2" comes before "item 10" and negative numbers and decimals are handled correctly; lines without a number go last.

While sorting you can also remove duplicate lines and empty lines. With "Random order" the lines are shuffled; press "Shuffle again" for a new order, for example to draw names or randomise a quiz.

Frequently asked questions

Why does "item 10" come after "item 2"?

In numeric order the tool reads the number in each line, so 2 comes before 10. In alphabetical order, text is compared character by character, so "item 10" comes before "item 2".

Are uppercase letters sorted separately?

Not by default: "apple" and "Apple" sort together. Tick "Case-sensitive" to sort uppercase letters before lowercase ones.

How are accented letters sorted?

Accents are ignored when comparing, so "é" sorts like "e". Lines that differ only in accents keep a fixed order.

Is the random order really random?

Yes, every shuffle uses a new random order generated in your browser. Each line has the same chance of ending up in every position.