TXT

Line Sorter

Paste a list, one item per line, and sort it alphabetically, by number, by length, reversed or shuffled.

INPUT (ONE ITEM PER LINE)
OUTPUT

How it works

Each line of your text is one item. Pick a sort order and the sorted list appears in the output box. Your input is not changed until you choose “Use output as input”, and nothing leaves your browser.

  • A to Z / Z to A: sorts alphabetically using your browser’s language rules, so accented letters such as é sit next to e. Runs of digits are compared as numbers (natural sorting), so “item 2” comes before “item 10”.
  • Numbers: sorts by the first number found in each line, including decimals and negatives. Lines with no number go to the end.
  • Length: sorts by the number of characters in the line. Lines of equal length keep their original order.
  • Reverse: flips the order without sorting. Shuffle: puts the lines in a random order each time you press Sort lines.

By default case is ignored, so “apple” and “Banana” sort by their letters rather than all capitals coming first. Tick Case sensitive to have lower-case sort before upper-case for otherwise equal words.

Worked example

The sample list is item 10, banana, item 2, Cherry, apple, item 1. Sorted A to Z with natural sorting it becomes apple, banana, Cherry, item 1, item 2, item 10. A plain text sort would put “item 10” before “item 2”, which is why natural sorting is on. Sorted by length, shortest first, it becomes apple (5 characters), then banana, item 2, Cherry and item 1 (6 characters each, in their original order), and finally item 10 (7 characters).

Good to know

Alphabetical order depends on the language of your browser, so the order of punctuation and non-English letters can differ slightly between devices. To remove repeated lines at the same time, run the list through the Remove Duplicate Lines tool.

Frequently asked

Why does “item 2” come before “item 10”?

The sorter uses natural sorting, which compares runs of digits by their value rather than character by character. A plain text sort would give item 1, item 10, item 2.

Is the shuffle truly random?

It uses your browser’s cryptographic random number generator with a Fisher–Yates shuffle, so every ordering is equally likely. Press Sort lines again for a new order.

What happens to blank lines?

By default they are removed. Untick Remove blank lines to keep them; they will sort to the top in A to Z order.

Last updated: October 2026