Sort Lines

Sort a list A to Z, Z to A, by length, by number, or shuffle it, with options to ignore case and drop blank lines. Runs in your browser.

Also searched as: alphabetical order · sort alphabetically · alphabetize list · sort text

Updated November 6, 2026

Loading the tool…

How to use it

  1. 1

    Paste your list

    One item per line.

  2. 2

    Pick an order

    Choose alphabetical, by length, numeric or random.

  3. 3

    Copy the result

    Press Sort lines, then copy the sorted list.

Questions about sort lines

Can it sort numbers correctly?

Yes. "By number" reads the number at the start of each line, so 2 comes before 10.

Can I remove blank lines?

Yes, tick "Remove blank lines" before sorting.

Is my list uploaded?

No. Sorting happens entirely in your browser.

What each sort order does

Paste one item per line, pick an order and press Sort lines. A to Z and Z to A compare the lines as text using your browser’s language rules, so accented letters sort sensibly. By length orders the lines by number of characters, shortest first. By number reads the number at the start of each line, and Shuffle puts the lines in a random order.

Ignore upper/lower case treats Apple and apple as equal in the A to Z and Z to A orders, and Remove blank lines (on by default) drops empty lines from the result.

Sort orderInput linesResult
A to Zbanana, Apple, cherryApple, banana, cherry
Z to Abanana, Apple, cherrycherry, banana, Apple
By lengthpear, fig, bananafig, pear, banana
By number10, 9, 1009, 10, 100
A to Z on numbers (as text)10, 9, 10010, 100, 9

Tips for cleaner results

Plain A to Z compares text, so numbers sort as words and 10 comes before 9. Use By number when your lines start with numbers; a line with no number at the start counts as 0.

The tool does not remove duplicates, but sorting puts identical lines next to each other so they are easy to spot. Shuffle uses your browser’s ordinary random numbers, which is fine for ordering a list; use the Random Number Generator for a draw where fairness matters.

Related tools