Line Sorter
Sort lines alphabetically, numerically, by length, or in random order. Choose from six sort modes and get instant results - great for cleaning up lists, data, and text.
FAQ
Six modes: A-Z (alphabetical ascending), Z-A (descending), Numeric ascending, Numeric descending, by line length (shortest to longest), and Random order. Click any mode button to instantly re-sort.
Alphabetical sorting uses standard JavaScript string comparison, which is case-sensitive (uppercase letters sort before lowercase). For case-insensitive sorting, consider normalizing your text first.
Natural sort recognizes numbers within text and sorts them numerically, not character by character. So file2, file10, file1 becomes file1, file2, file10. This matches human expectations for filenames, version numbers, and any text with embedded numeric sequences — unlike standard alphabetical sort which would order them as file1, file10, file2.
Empty lines are treated like any other line — they participate in sorting and usually appear first in ascending sorts. You can use the skip empty lines option to exclude them from the sort. If you prefer to remove empty lines entirely before sorting, use the Whitespace Trimmer tool first to clean up your text.
The line sorter sorts by the entire line from left to right. For sorting by a specific column or field, pre-process your data — split columns, reorder, or sort programmatically. For CSV data with specific column needs, use a spreadsheet or the CSV to JSON Converter tool for column-level sorting.
The line sorter treats each line as a whole. For column-based sorting, we recommend converting your CSV to JSON first using our CSV to JSON Converter, then processing it programmatically.
More tools
Duplicate Line Remover
Remove duplicate lines with case-sensitive or insensitive matching.
Whitespace Trimmer
Trim, collapse, and clean up whitespace in your text instantly.
Character Frequency Counter
Count character frequency with sortable table and bar visualization.
Text Reverser
Reverse text by character, line, word, or word order. Multiple modes.
JSON Formatter
Pretty-print, validate, and minify JSON with syntax highlighting.
Diff Checker
Compare two text blocks side-by-side and see exactly what changed.