↕
Runs in your browserNothing is uploadedText

Sort Lines

Sort lines alphabetically, in natural number order, by length, in reverse, or shuffle them at random.

Loading tool…
Short answer

Sort Lines puts any list in order: A to Z, Z to A, natural order where item 2 comes before item 10, shortest or longest first, reversed, or shuffled at random. It works on each line of the text and runs in your browser.

What is natural sort order?

Natural order

A plain alphabetical sort compares numbers digit by digit, so "item 10" lands before "item 2". Natural order reads the numbers as numbers, the way a person would, so file names and chapter lists come out right.

Why use Sort Lines?

  • Alphabetise in one step. Reference lists, glossaries and name lists in order without a spreadsheet.
  • Handles accents properly. Sorting follows language rules, so "Émile" sits with the other E names rather than after Z.
  • Fair random order. Shuffle uses your browser's secure random generator, which is good enough for picking a running order or a prize draw.

How to use Sort Lines, step by step

Sort Lines in PrintxPDF with a file loaded, options on the right and the run button below
Sort Lines with a file loaded: the steps below follow this screen.
  1. Paste your list into Sort Lines. One item per line.
  2. Pick the order. Choose A to Z, natural, by length, reverse or shuffle, and whether case matters.
  3. Copy or download the result. The sorted list appears straight away. To drop repeats first, use Remove Duplicate Lines.

Frequently asked questions

Where do capital letters go?

With "ignore case" on, capitals sort together with lower case letters. With it off, a capital comes just before the same word in lower case.

What does reverse do?

It flips the list exactly as it is, last line first, without sorting it.

Can I sort numbers?

Yes. Natural order sorts lines that are numbers, or that contain numbers, by their value rather than by their first digit.

Looking for the long version? The guides cover each of these jobs in depth.