Sort lines of text alphabetically or numerically. Choose ascending or descending order, case sensitivity, and more. Instant results in your browser.
Sorting lines alphabetically or numerically is a common task when working with lists, data exports, keyword lists, and log files. This tool supports multiple sorting methods and options to handle exactly the way you need your data organized.
Standard alphabetical sort treats numbers as text, so "10" comes before "2". Use the Numeric sort option if you need natural number ordering.
JavaScript's default sort is not guaranteed to be stable. For most practical purposes the order is consistent, but lines with identical sort keys may shift position.
There's no hard limit. Tens of thousands of lines work fine. Very large files (millions of lines) may slow down your browser since all processing is local.
Yes — numeric sort treats "10" as greater than "2", unlike lexicographic sort. Natural sort for mixed text+numbers is also supported.
Yes. Combine sorting with deduplication and remove-empty-lines in a single pass.
Yes. Sorting runs locally; even tens of thousands of lines complete in milliseconds.
Deploy this tool on Vercel · Ship faster with Cursor · Your static site on Cloudflare