Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Sort text lines alphabetically or numerically, ascending or descending.
apple
banana
cherryThis tool sorts a text block's lines -- alphabetically or numerically, ascending or descending -- with an option to also remove duplicate lines in the same pass.
Paste text with one item per line, choose ascending/descending order and alphabetical/numeric mode, and optionally enable duplicate removal. The sorted list appears instantly.
Alphabetical mode sorts lines as text using locale-aware string comparison. Numeric mode parses each line as a number first, so "10" correctly sorts after "9" -- a plain alphabetical sort would incorrectly place "10" before "9" since it compares the first character ("1" < "9") rather than the numeric value.
To only remove duplicates without sorting, see the Duplicate Line Remover.
Take the hypothetical lines 10, 9, 100, 2, 25. Sorted alphabetically ascending they become 10, 100, 2, 25, 9, because text comparison goes character by character. Sorted numerically ascending they become 2, 9, 10, 25, 100. Descending simply reverses the sorted order. For a word list such as banana, apple, cherry, alphabetical ascending gives apple, banana, cherry.
Alphabetical mode uses the browser's locale-aware comparison. In practice that means uppercase and lowercase letters are ordered together rather than all capitals first, and accented letters sit near their base letters, though the exact order depends on your browser's language settings. Lines are compared as they are, so leading spaces matter: a line beginning with a space will sort before lines beginning with letters. Trim your text first if some entries carry stray spaces.
Because non-numeric lines act as zero, a column with a header row will place the header among the zeros, not at the top. Remove or re-add the header separately.
Empty lines are dropped from the sorted output unless your text contains a blank line between two lines, in which case they are all kept and sort to the top in ascending order. If you notice blank lines vanishing or piling up unexpectedly, that is why. The optional duplicate removal compares lines exactly, with case sensitivity, before sorting, so "Apple" and "apple" both remain. To collapse them, use the Duplicate Line Remover in case-insensitive mode first.
The tool sorts whole lines, not columns or fields inside a line, and it cannot sort by a second key. It works on one text block in your browser, so very large lists depend on your device.
Because alphabetical (string) comparison looks at characters left to right -- "1" comes before "9" in character order, so "10" sorts before "9" even though numerically 10 is larger; numeric mode avoids this by comparing actual parsed numbers instead.
They parse as 0 (since there's no valid number to extract), so they'll sort to the bottom (ascending) or top (descending) alongside any other zero/unparseable values.
Yes -- enable "Remove duplicate lines" alongside your chosen sort order to do both in one pass.
In numeric mode, a line that does not begin with a number counts as zero, so it sorts among the zeros. Remove the header before sorting and add it back afterward.
Yes. Ties keep their original relative order in ascending sorts.
Numeric parsing stops at the first character that is not part of a number, so 1,200 is read as 1. Remove the thousands separators before sorting.
Reference: MDN Web Docs