Sort Lines Online

Sort a list of lines alphabetically (lexicographic order), numerically, by length, or randomly. Ascending or descending.

Input

Output

About this tool

Sort Modes Explained

Alphabetical uses lexicographic comparison. Numerical parses each line as a number — non-numeric lines sort to the end. By length orders shortest first (or last). Natural sort handles strings like "file2", "file10", "file20" in human order rather than as "file10", "file2", "file20". Shuffle randomizes order using Fisher-Yates.

What is natural sort?

Natural sort treats embedded numbers as numeric values. Compare "file10" vs "file2": alphabetical sort puts "file10" first (1 < 2 in ASCII), but natural sort correctly orders "file2", "file10".

Related Tools

More Text Tools

Word CounterLorem IpsumText Diff CheckerFind & ReplaceRemove DuplicatesReverse Text

Want more detail? Read How to Use Sort Lines Tool: Practical Guide and Best Practices.