Sort lines

Paste the lines to sort, pick a method, alphabetical, numeric, random, or reverse, and copy the result in one click.

Your lines stay in your browser: they are never saved or uploaded.

Alphabetical vs. numeric: why they're not the same

Many programs put "10" before "2" when sorting alphabetically, because they compare character by character. Not here: even in alphabetical order the numbers inside the lines are read as numbers, so "line 2" comes before "line 10". The order follows English rules, so accented letters such as é, à and ü sit next to the plain ones. The numeric mode only looks at the value instead: it takes the first number on each line, even after some text ("Rent 1,200.50"), reads it the English way (the comma for thousands as in "1,000", the point for decimals as in "3.14") and sorts from smallest to largest; lines with the same value keep their starting order. Lines without a number go to the bottom without changing their order relative to each other, and a number glued to a word, like the 3 in "mp3", doesn't count. A number that starts with the separator, like ".5", is a half; a version number like "1.10.0" isn't a number, though, and its line goes to the bottom with the ones without. Empty lines are removed in every order except "Reverse the current order", which flips everything as it is.

What random order is good for

Shuffling lines comes in handy more often than you'd think: picking the order in which students get called on, assigning presentation slots in a meeting, drawing the starting lineup for a tournament, or reshuffling quiz questions. The tool uses the Fisher-Yates algorithm, which gives every line an equal chance of landing in any position: press the button again for a fresh draw. Empty lines are dropped before shuffling, because scattered at random through the list they'd be no use; the others stay whole, spaces included.

Related tools