Line Sorter
Sort a list of lines alphabetically, numerically or by length — in either direction.
How to Use This Line Sorter
Paste a list with one item per line, pick a sort order and click Sort lines. The result appears below, ready to copy.
- A to Z / Z to A — dictionary order using your locale.
- Length — orders by the number of characters in each line.
- Numeric — reads the leading number, so 2 comes before 10.
- Ignore case — treats uppercase and lowercase letters as equal.
Frequently Asked Questions
Why does 10 sort before 2 in alphabetical mode?
Alphabetical sorting compares characters, so "10" starts with "1" and comes before "2". Choose a numeric mode to sort by value instead.
Can I sort and remove duplicates at once?
Yes. Enable Remove duplicates before sorting to keep only the first occurrence of each line.
What if a line has no number in numeric mode?
Lines without a leading number are treated as 0, so they group together at the start (ascending) or end (descending).
Does it keep blank lines?
Remove empty lines is on by default. Uncheck it to keep blank lines in the output.
Is my text uploaded anywhere?
No. Sorting runs entirely in your browser — nothing is sent to a server.
Practical Example
Paste the lines banana, apple, cherry and sort A to Z. The output is apple, banana, cherry.
- The same list in numeric mode is unchanged, since no line starts with a number.
- With the input
10,2,30,1, numeric ascending gives1,2,10,30.
What Your Results Mean
- A to Z — locale-aware text order; good for names, tags and words.
- Numeric — value order; good for IDs, prices and measurements.
- Length — character-count order; handy for crossword or word lists.
- Duplicates — when removed, only the first occurrence of each line is kept.