Skip to content
Utilboxes

Sort Lines

Sort lines alphabetically, numerically, by length, or shuffle them at random.

Runs entirely in your browser

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.

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.