Sort lines of text alphabetically, numerically, by length or randomly. Reverse and deduplicate options.
The Line Sorter reorders lines of text by alphabetical order, reverse alphabetical, line length, numeric value or random shuffle - with optional case-insensitive matching, deduplication and blank-line removal. It's a quick utility for developers, data analysts and writers who need to organize lists without opening a spreadsheet or writing a script. All sorting happens instantly in the browser.
By default, sorting is case-sensitive, so uppercase letters (A-Z) sort before lowercase (a-z) due to their lower Unicode code points. Enabling the "Case insensitive" option normalizes all lines to lowercase for comparison purposes before sorting, so "Banana" and "banana" are treated as equal and their relative order is determined by position. Use case-insensitive mode when your list has inconsistent capitalization and you want a natural alphabetical order.
No - all sorting operations run entirely in your browser using JavaScript's built-in Array.prototype.sort(). Your text is never transmitted to any server, stored in a database or retained after you close the tab. Sensitive lists such as customer names, internal keywords or private configuration values can be sorted with complete privacy.
Numeric sorting uses parseFloat() on each line to extract a leading number, then sorts by that value. Lines that do not start with a valid number parse to NaN and will sort to the end of the list in an unpredictable order. This mode is best suited for pure number lists or lines that begin with a number (like versioned items such as "3.2 Feature" or "10 Items"), rather than mixed text data.
The random shuffle uses JavaScript's Math.random(), which produces a pseudo-random sequence seeded by the browser's internal entropy source. It is random enough for the vast majority of uses such as shuffling quiz questions, test datasets or raffle entries, but it is not cryptographically secure. For security-sensitive randomization (e.g., lottery draws with financial stakes) you should use a cryptographically secure random number generator.
Terminal commands like sort on Linux or Mac are powerful but require opening a terminal, saving your list to a file and running a command - a multi-step process for a quick task. Spreadsheet tools require importing data into a table structure. This tool lets you paste, configure and copy sorted output in seconds, directly in the browser, with no file management or command knowledge required. It is ideal for one-off sorting tasks where you just need the result quickly.