Search tools

Sort Lines

Put any list in order — A to Z, by number, by length, or shuffled — with natural sorting that handles numbers the way people expect.

Sort Lines tool

Options

Processing runs in your browser.

Sorting a list sounds trivial until the numbers come out wrong. Spreadsheets and many editors sort “Chapter 10” before “Chapter 2”, or put “Zebra” before “apple” because capital letters come first. This tool sorts the way a person would, and gives you numeric, length and random orders when alphabetical isn’t what you need.

Handy for

  • File and version lists: v1.2, v1.10, v2.0 in the right order.
  • Glossaries and indexes: alphabetise terms with accents handled properly.
  • Prices or scores: order lines by the number they contain.
  • Teachers and organisers: shuffle names for random groups or presentation order.
  • Writers: sort lines by length to build tidy, pyramid-shaped lists.

How to use the Sort Lines

  1. Paste your list into the left box, one item per line.
  2. Pick how to sort in Sort by. Natural order is the best choice for most lists.
  3. Tick Descending to go from Z to A or largest to smallest.
  4. Copy or download the sorted list on the right. For a random shuffle, click Again for a new order.

Features

  • Natural sort: “file 2” comes before “file 10”, unlike plain alphabetical sorting.
  • Language-aware comparison, so accented letters sort next to their base letters (é with e).
  • Numeric sort reads the first number in each line, including decimals like 3.5.
  • Random shuffle uses your browser’s cryptographic random generator for a fair order.
  • Option to drop empty lines while sorting.

Frequently asked questions

What is natural sort and why does it matter?

Computers usually compare text character by character, so “item 10” lands before “item 2” because 1 comes before 2. Natural sort reads runs of digits as whole numbers, giving item 1, item 2, item 10 — the order people expect for file names, chapters and versions.

Is sorting case-sensitive?

No. Both A→Z options ignore case, so “apple” and “Apple” sit together. If two lines differ only by case, their relative order is kept.

How does numeric sort handle lines without a number?

They go to the end, sorted naturally among themselves. Lines like “Room 12B” are sorted by 12.

Is the random shuffle truly random?

It uses a Fisher–Yates shuffle driven by crypto.getRandomValues, so every possible order is equally likely. That makes it suitable for draws and for randomising survey options.

Written by