Sort Lines of Text (A–Z, Numeric, Length)

Paste one item per line and choose how to order them. Sorting happens in your browser, so private lists stay private.

Runs in your browser — nothing you enter is uploaded

Sort Lines Alphabetically

All fields are required unless marked “optional”.

Tip: press Ctrl+Enter (Cmd+Enter on Mac) inside a text box to run.

Your result will appear hereStart typing and it updates instantly.

Formula

  • A to Z: compare lines piece by piece, treating runs of digits as whole numbers
  • by number: sort on the number a line starts with
  • Natural order puts item2 before item10 because 2 < 10
  • Lines without a leading number go to the end in numeric modes

Each line is compared with the others using your language's alphabetical rules, then placed in order.

Worked examples

Natural alphabetical order

Your lines
item10 Banana item2 apple Cherry item1
Order
A to Z
Upper and lower case
Ignore case (apple = Apple)
Remove blank lines
No
Remove duplicate lines
No

Lines

6

Order: Sorted A to Z

apple
Banana
Cherry
item1
item2
item10

Numbers in front of words

Your lines
10 apples 2 pears 300 plums notes
Order
By leading number, lowest first
Upper and lower case
Ignore case (apple = Apple)
Remove blank lines
No
Remove duplicate lines
No

Lines

4

Order: Sorted by number, lowest first

2 pears
10 apples
300 plums
notes

How it works

Alphabetical order uses your browser's language-aware comparison, so accented letters sort next to their base letters and numbers inside text are read as numbers: item2 comes before item10, which a plain character-by-character sort would get wrong. The case option decides whether Apple and apple are treated as equal. Reverse order simply flips the list you pasted, and shuffle uses the browser's secure random generator for a fair, unbiased shuffle.

Numeric sorting reads the number at the start of each line, including thousands separators such as 1,500 and negative or decimal values, and orders by that value. Lines that do not begin with a number are placed at the end and the result notes how many there were. Length sorting counts characters, with ties broken alphabetically, which helps when you want the longest entries first.

You can also strip blank lines and remove duplicates in the same pass. To only deduplicate while keeping the original order, use Remove Duplicate Lines; to count what is in the list, use the Word Counter; and to change the capitalisation of every line, use the Case Converter.

Assumptions and limits

  • Alphabetical order follows your browser's language settings.
  • Numeric sorting uses the number at the very start of each line only.
  • Shuffling gives a different order each time you run it.

Common questions

Does it sort numbers correctly, like 2 before 10?
Yes. Alphabetical mode uses natural ordering, so item2 comes before item10. For lines that start with a number, choose the numeric order.
Is sorting case sensitive?
Not by default: apple and Apple sort together. Choose “Case matters” to separate them.
Can I sort a list without changing it on a server?
Yes. Nothing is uploaded; the lines are sorted in your browser tab.
Can I sort in reverse alphabetical order?
Choose Z to A. To flip an existing order without sorting, choose Reverse.