CODDY Tool

Text Sorter

Sort lines alphabetically, numerically or by length — or shuffle and reverse them.

Reorder any list of lines. Sort A–Z or Z–A, sort numbers properly rather than as text, use natural order so item2 comes before item10, order by length, shuffle randomly, or reverse lines, words and characters.

Everything you enter stays in this browser tab. Nothing is sent to our servers, logged or stored.

Loading tool…

What Text Sorter supports

Sort

  • A → Z
  • Z → A
  • Numeric
  • Natural (item2 before item10)
  • By length

Reorder

  • Random shuffle
  • Reverse line order

Reverse

  • Reverse word order
  • Reverse characters

About Text Sorter

Sorting a list is trivial in a spreadsheet and awkward everywhere else. When your list lives in a text editor, a chat message or a form field, moving it into a spreadsheet and back is more work than the sort itself.

Natural sort deserves a specific mention because it fixes a common annoyance. A plain alphabetical sort puts item10 before item2, because it compares character by character and "1" precedes "2". Natural sort recognises the numbers inside the text and orders them numerically, giving item2 then item10 — almost always what was actually wanted.

Reversing is included here because it is the same job: changing the order of things. Reverse line order to flip a chronological log, reverse word order to test how a phrase reads backwards, or reverse characters for puzzles and palindrome checking.

How to sort a list

  1. Paste your lines

    One item per line.

  2. Choose an order

    Alphabetical, numeric, natural, by length, shuffled or reversed.

  3. Adjust the options

    Ignore case, trim whitespace or drop blank lines before sorting if the data is untidy.

  4. Copy or download

    Copy the reordered list or save it as a text file.

Sort modes explained

  • Alphabetical — locale-aware dictionary order, handling accents correctly.
  • Numeric — each line parsed as a number, so 2, 10 and 100 order correctly.
  • Natural — mixed text and numbers ordered the way people read them.
  • By length — shortest to longest, useful for spotting outliers in a data set.
  • Random shuffle — an unbiased Fisher–Yates shuffle seeded from the browser's cryptographic random source.

Frequently asked questions

Why is item10 sorted before item2?

That is standard alphabetical sorting, which compares character by character, and "1" sorts before "2". Switch to natural sort and the embedded numbers are compared numerically, giving the order you expect.

Can I sort numbers correctly?

Yes. Numeric mode parses each line as a number, so 2, 10 and 100 sort in true numeric order rather than as text. Lines that are not numbers are grouped at the end rather than scattered.

Is the random shuffle really random?

It uses a Fisher–Yates shuffle seeded from the browser's cryptographic random number generator, so every ordering is equally likely. It is suitable for drawing names or randomising a running order.

Does sorting remove duplicates?

No, duplicates are kept and end up adjacent to each other. To remove them, use the Text Cleaner either before or after sorting.

All Text Tools

Text Sorter is free to use with no account, no watermark and no usage limits. Last updated 14 August 2026.