How to sort text
- Paste a list with one item per line.
- Choose the order: alphabetical (A–Z or Z–A), numerical, by line length, or reversed.
- Adjust the options if needed, then copy or download the sorted list.
What each sort order does
- A–Z / Z–A sorts alphabetically using natural, language-aware ordering. Numbers inside text are compared as numbers, so Chapter 2 comes before Chapter 10 — unlike a plain computer sort, which would put "10" first because "1" comes before "2". Accented letters sort next to their plain equivalents (é with e).
- Numbers ↑ / ↓ reads the first number on each line — including decimals, negatives and thousands separators such as 1,250 — and sorts by its value. Lines without a number are placed at the end in their original order.
- Line length sorts from the shortest line to the longest, which is useful for spotting outliers, arranging tag clouds, or finding the shortest headline option.
- Reverse order flips the list upside down without sorting it — the last line becomes the first.
How the options work
Ignore case treats apple and Apple as equal when sorting (on by default). Turn it off and, for identical words, uppercase versions come first. Remove duplicate lines keeps one copy of each line — combined with Ignore case, it also merges lines that differ only in capitalisation. Trim whitespace removes invisible spaces at line ends, which otherwise make " banana" sort before "apple". Remove empty lines keeps blank lines from bunching up at the top.
Examples
Input: file10.txt, file2.txt, File1.txt (one per line) → A–Z → File1.txt, file2.txt, file10.txt.
Input: Keyboard $49.99, Monitor $1,199, Mouse $19.50 → Numbers ↑ → Mouse $19.50, Keyboard $49.99, Monitor $1,199. The currency symbol is ignored and the thousands separator is understood.
Tips
- Sorting a list you have just de-duplicated? You can do both at once by ticking Remove duplicate lines — or use Remove Duplicate Lines on its own when you need to keep the original order.
- If a list has inconsistent capitalisation, standardise it first with the Case Converter so the final list looks tidy.
- Want to reverse the characters or words themselves rather than the list? Use the Text Reverser.
- Lines copied from PDFs often carry stray spaces; Remove Extra Spaces cleans them before sorting.
Frequently asked questions
Why does 10 come after 9 here but before 9 in other tools?
Many simple sorters compare text character by character, so "10" sorts before "9" because "1" is less than "9". This tool uses natural sorting, which compares numbers by their value.
How are lines without numbers handled in numeric sorting?
They are moved to the end of the list and keep their original relative order, so nothing is lost.
Can I sort by the second column of a CSV?
Not directly — each whole line is sorted. For column-based sorting, a spreadsheet is the better tool.
Is sorting done on your server?
No, it happens in your browser. Your list is not uploaded.
Last updated . Spotted a mistake? Let us know and we will correct it.