Sort lines alphabetically, numerically, or by length.
Free to use, no sign-up required. Sort Lines is one of 198 tools built into Xenition, alongside a chat that can use them for you.
Sorts a list of lines alphabetically, in reverse, by the number at the start of each line, or by length, and can remove exact duplicates at the same time.
A→Z and Z→A use the browser’s localeCompare, which sorts in dictionary order for your language and puts lowercase and capital versions of a letter next to each other. 0→9 reads the number at the start of each line with parseFloat; a line that does not start with a number counts as 0. Length sorts from shortest to longest. Lines that tie keep their original order. unique removes lines that match exactly, including case and spaces.
A→Z sorts 10, 9, 100, 2.5 as 10, 100, 2.5, 9, while 0→9 gives 2.5, 9, 10, 100.
A→Z compares text character by character, and 1 comes before 2. 0→9 does not help here either, because the lines start with letters and all count as 0.
An empty line sorts first in A→Z and Length and last in Z→A. With unique ticked, several blank lines collapse into one.
You do not have to open Sort Lines to use it. Ask Xenition in plain language and it runs the right tool, then carries the answer into whatever you are working on — a document, a spreadsheet, a deck.