Skip to content
Utilboxes

Sort Lines

Paste your lines and sort them alphabetically, numerically, by length or at random, in either direction. Natural sorting puts item2 before item10, and accented letters sort where the language expects. Random order uses a cryptographic Fisher-Yates shuffle, so every order is equally likely. Your text is never uploaded.

Runs entirely in your browser

Updated

How to use Sort Lines

  1. 1Paste your lines.
  2. 2Choose a sort method and direction.
  3. 3Turn on natural sorting if your lines contain numbers.
  4. 4Copy the sorted result.

How it works

Alphabetical sorting uses your browser's locale-aware comparison, which orders accented characters the way the language expects — so 'é' sorts next to 'e' rather than after 'z', which is what a plain byte comparison would do.

Natural sorting is the option most people actually want when their lines contain numbers. A plain alphabetical sort puts item10 before item2, because it compares character by character and '1' comes before '2'. Natural sorting reads runs of digits as numbers, giving item2, item10, item100 — the order a human would use.

The random option uses a Fisher-Yates shuffle driven by cryptographic randomness, which produces a genuinely uniform permutation. Sorting by a random key, the common shortcut, does not.

Your text is processed by JavaScript running in this page and is never sent over the network. That matters when you are pasting a draft, a client brief, meeting notes or anything else you would rather not hand to a server.

Tips and common mistakes

  • Turn on natural sorting when lines contain numbers, so item2 comes before item10.
  • Use numeric mode for lists of plain numbers.
  • Remove duplicates first with Remove Duplicate Lines if the list may contain repeats.
  • Use random order to shuffle names for a draw or a seating plan.

Frequently asked questions

Why does item10 come before item2?
Because plain alphabetical sorting compares character by character, and '1' precedes '2'. Turn on natural sorting to read the digits as numbers.
How are accented characters handled?
Using locale-aware comparison, so 'é' sorts alongside 'e' rather than after 'z'.
Can I sort numbers properly?
Yes. Numeric mode parses each line as a number and sorts by value, so 9 comes before 10.
Can I sort in reverse order?
Yes. Choose the descending direction for Z to A, or highest number first.
Can I shuffle a list randomly?
Yes. The random option gives every possible order an equal chance, using your browser's cryptographic random numbers.
Can I sort by line length?
Yes. Choose length to order lines from shortest to longest, or the other way round.

Guides