Sort Text Lines
Put any list in order: alphabetical (A–Z or Z–A), natural numeric order, or by line length — with one click.
Runs in your browser — files never leave your device
Free · No sign-upOutputs Plain textHow to use Sort Lines
Paste your lines into the input box.
Pick a sort: A–Z, Z–A, natural/numeric, or by length.
Toggle case-insensitive if capitalization shouldn't matter.
Click Sort lines and copy the result.
About this tool
Plain alphabetical sorting puts "item10" before "item2" because it compares character by character. The natural sort option here compares embedded numbers by value, producing the order humans expect. You can also sort case-insensitively, reverse any order, or sort by line length, which is useful for reviewing data exports and organizing word lists.
This comes up often when working with exported data or file listings — sorting a folder of numbered files correctly (file2 before file10), alphabetizing a list of names for a directory, or arranging entries by length to spot unusually short or long outliers.
Common ways people use this
- Sorting a list of numbered files or items so they appear in the order a person would expect (2 before 10)
- Alphabetizing a list of names, products, or entries for a directory or catalog
- Sorting by line length to quickly spot unusually short or long entries in a data export
Tips for better results
- Use natural/numeric sort whenever your list contains numbers embedded in text, like file names or version numbers — plain alphabetical sort will order them incorrectly.
- Sorting by length is a quick way to audit a list for outliers, like an accidentally truncated entry or an unusually long one that needs review.
Frequently asked questions
Why does normal sorting put item10 before item2?
How are empty lines handled?
Does sorting handle accented characters sensibly?
Can I sort a list in reverse alphabetical order?
Will sorting remove duplicate entries?
Related tools
Other tools people commonly use alongside this one.
Remove Duplicates
Clean duplicate entries out of any list — emails, URLs, keywords, log lines. The first occurrence of each line is kept and the rest are removed.
Remove Extra Spaces
Clean up messy whitespace: collapse repeated spaces, trim the ends of lines, and remove empty lines — each cleanup individually selectable.
Text Statistics
Go beyond a simple count: see average word and sentence length, your most frequent words, and estimated reading and speaking times.