Text Sorter

Sort lines alphabetically, by length or into a random order. One line in, one line out — the order is the only thing that changes.

Your list

Order
Before sorting
Sorting is stable, so lines that compare as equal keep their original relative order.

Sorted list

0 Lines in
0 Lines out
0 Removed
Your sorted list will appear here.
Paste a list on the left and pick an order.

Private by design. This page has no backend. Your list is sorted by JavaScript running on your own device and is never sent anywhere.

How the orders work

A to Z and Z to A

Compares lines using your browser's own language rules rather than raw character codes. That is why Zürich sorts next to Zurich instead of being pushed past z, and why accented words land where a dictionary would put them. Leave Case sensitive off — the default — and Apple and apple sort together.

Shortest and longest first

By the number of characters in the line. Lines of equal length keep their original relative order, so this is a useful way to group a list without scrambling it.

Numerically

Reads a number from the start of each line and sorts on that, so 2 apples comes before 10 pears. A leading currency symbol, plus sign or minus sign is understood, as are decimals and grouped thousands — 12,345.60 reads as twelve thousand. Lines with no number at the start are pushed to the end in their original order rather than being silently dropped.

Natural order

Sorts text and numbers the way a person reading a file list would: file2 before file10, where A to Z would put file10 first because 1 comes before 2. Use this for anything with numbers embedded in names — versions, chapters, invoice codes.

Random

A Fisher-Yates shuffle, which gives every possible order the same chance. Press Shuffle again for a different one; changing any other setting also reshuffles.

Reverse current order

No sorting at all — just turns your list upside down as it stands.

The four options

Trim spaces removes leading and trailing whitespace from each line, which matters because apple and apple otherwise sort apart and count as different for deduplication. Drop blank lines removes empty lines instead of collecting them at the top. Remove duplicates keeps the first occurrence of each line and respects the case setting, so with case sensitivity off Apple and apple count as one. Case sensitive affects both sorting and deduplication; with it on, capitals sort before lowercase.

Common uses

Alphabetising a list of names or tags, ordering version numbers or filenames properly, picking a random order for a rota or a playlist, and cleaning up a list pasted out of a spreadsheet or an email.

How to use the Text Sorter

  1. Paste your list, one entry per line.
  2. Choose how to sort — A to Z, Z to A, by length, numerically, naturally, or shuffle randomly.
  3. Optionally trim, remove duplicates and drop blank lines, then copy the sorted list.

Frequently asked questions

What is natural sort order?

Natural order sorts 'item2' before 'item10' by treating number runs as numbers, unlike a plain alphabetical sort.

Does it remove duplicate lines?

Only if you enable the dedupe option; otherwise every line is kept.

Can it sort numbers?

Yes. The numeric mode compares values as numbers rather than as text.