Line Sorter

Paste lines of text and sort them A–Z, Z–A, by length, numerically, or shuffle them.

Last updated

Sorted text will appear here.
Copied

How to sort lines of text

  1. Paste your list, one item per line.
  2. Click A → Z, Z → A, a length order, Numeric or Shuffle.
  3. Click Copy result.

About this tool

A–Z and Z–A use locale-aware "natural" comparison, so numbers inside lines sort by value (item 2 before item 10); with "Case sensitive" ticked they use strict character order instead, which puts capitals first. "Numeric" extracts the first number found in each line and sorts by that value, so a list like item 9, item 10, item 2 sorts as 2, 9, 10 rather than as plain text (where "10" would sort before "2"). Lines with no number sort to the end. Shuffle uses an unbiased Fisher–Yates shuffle, not a naive sort-by-random-comparator, which can otherwise produce skewed results.

Nothing you paste here is sent to a server — the entire tool runs as JavaScript in your browser tab.

Questions about sorting lines

How do I sort a list alphabetically?

Paste it and click A → Z. Numbers inside lines sort by value, so “item 2” comes before “item 10”.

How does the numeric sort work?

It uses the first number in each line, so “9 apples, 10 pears, 2 plums” sort as 2, 9, 10. Lines with no number go to the end.

Is the shuffle truly random?

Yes. It uses the Fisher–Yates shuffle, so every order is equally likely.

Can I remove duplicates too?

Use the duplicate line remover before or after sorting.

☕ Support toolcrate