Skip to content

Text Sorter

Sort lines A–Z, Z–A, by length or randomly.

Runs in your browser · free · no sign-up

Input
Result

About the Text Sorter

Put names, words or numbers in order in one click. Numeric sorting understands that 10 comes after 9, and the natural sort keeps "item2" before "item10".

Sorting a list in a word processor or spreadsheet takes several clicks and often treats numbers as text, so “10” lands before “9”. This sorter puts any list of lines in order instantly. It is used by teachers sorting student names, developers ordering imports or config keys, SEO specialists cleaning keyword lists and anyone preparing a list for publishing.

Choose A to Z or Z to A with natural ordering, numeric order for lists of numbers, shortest or longest first, reverse the current order or shuffle randomly. Shuffling uses the Fisher–Yates algorithm, which gives every order the same chance. Options remove empty lines, remove duplicates and trim spaces in the same step, so you get a clean list in one go.

How to use the Text Sorter

  1. 1Paste text with one item per line.
  2. 2Choose a sort order.
  3. 3Copy the sorted list.

Key features

  • A–Z and Z–A natural sorting.
  • Numeric sort, so 9 comes before 10.
  • Sort by length, reverse or shuffle.
  • Remove empty lines and duplicates.
  • Trim spaces before sorting.

Practical uses

  • Alphabetising a class register or guest list.
  • Ordering keywords by length to find long-tail phrases.
  • Randomising the order of quiz questions or presenters.
  • Sorting lines of code or CSS properties.
  • Putting a bibliography or reference list in alphabetical order.

Example

The lines file10, file2 and file1 sort to file1, file2, file10 with natural A–Z, instead of the file1, file10, file2 order a basic sort produces.

Tips and common mistakes

  • Trim spaces first; a leading space puts a line at the top of an A–Z list.
  • Use Shuffle again for a new random order each time.
  • Numeric sort works best when each line starts with a number.

Limitations

  • Each line is treated as one item; it does not sort by a column inside the line.
  • Alphabetical order follows your browser’s rules for your language, which may differ slightly from a dictionary.

Privacy

Sorting happens in your browser. Lists are not uploaded or stored.

Frequently asked questions

Does A–Z handle numbers correctly?

Yes. It uses natural sorting, so "file2" comes before "file10".

Is the shuffle truly random?

It uses the Fisher–Yates shuffle with the browser’s random number generator.

Can I remove empty lines?

Yes, tick "Remove empty lines" before sorting.

Is sorting case-sensitive?

No. Upper and lower case versions of the same word sort together.

What does Reverse do?

It flips the current order of the lines without sorting them, so the last line becomes the first.

Can it sort numbers with decimals?

Yes. Choose 1 → 9 and values such as 2.5 and 10.25 are placed in numeric order.

Related tools

Word CounterCount words, characters, sentences and reading time.
Case ConverterUPPER, lower, Title, Sentence, camelCase and more.
Slug GeneratorTurn titles into clean, SEO-friendly URL slugs.
Remove Duplicate LinesDelete repeated lines from a list.