Skip to content

Sort LinesBeta

Sort a list alphabetically or by length, reverse the order, or shuffle it randomly. Choose the sort language, and your input never leaves your browser.

0 characters · 0 lines

0 characters · 0 lines

How to use

Paste your list into the input box, one value per line, choose a “Sort by” mode, and the sorted result appears in the output box. The result keeps updating as you edit the input or change the options, and you can grab it with the copy button.

Sort modes

  • Alphabetical: sorts by character order. You can also choose the direction (A to Z / Z to A), the sort language, how numbers are compared, and whether case matters.
  • Length: sorts by the number of characters in each line (counted the way they appear on screen, so an emoji or accented letter still counts as one), shortest first or longest first. Lines with the same length keep their original order relative to each other.
  • Reverse order: does not sort at all — it simply flips the current line order end to end.
  • Shuffle: rearranges the lines in random order. Useful for drawing lots or deciding a presentation order fairly; the “Shuffle again” button draws a new random order each time you click it.

Sort language and options

Alphabetical sorting can give a different result for the same list depending on which language’s rules you compare it with. In German, for instance, letters with an umlaut (ä, ö, ü) sort right next to the plain letter (a, o, u); in Spanish, ñ is treated as its own letter, separate from n. Korean follows its own consonant-vowel order, and Japanese follows its own kana order. Pick “Sort language” to match the language your list is actually written in to get the order you expect.

  • Compare numbers by value: with this off, numbers are compared character by character, so item10 ends up before item2 (only the first digit, “1” vs “2”, is compared). Turn it on to read the number as an actual value, so item2 comes before item10 — the order most people expect.
  • Case sensitive: leave it off and uppercase and lowercase letters count as the same, though accented letters (like á) still sort separately from the plain letter (a). Turn it on to also take letter case into account.
  • Exclude empty lines: removes all empty lines before sorting. Leave it off and empty lines are sorted along with everything else.

When this is useful

Use it to put a list of names, usernames or product names into alphabetical order, to scan through survey answers or a list of entries by length (from short answers to long ones), or to draw a fair random order for a lottery or presentation lineup. It is built for line-based lists, not for paragraphs or tabular data where a single record spans several lines.

Privacy

Your list is processed entirely inside this browser and is never sent to a server or stored. Closing the page clears whatever you pasted.

Frequently asked questions

Does the sort order change depending on the language?

Yes. The order follows the rules of whichever language you pick under "Sort language". German, for example, places ä right next to a, Spanish treats ñ as a separate letter from n, and Korean and Japanese follow their own character order. Sorting the same list with a different sort language can change the result.

Values with numbers in them sort in a strange order.

A plain text comparison compares numbers character by character, so "item2" ends up after "item10" (because "1" is smaller than "2" at the first digit). Turn on "Compare numbers by value" to read the number part as an actual value, giving the order most people expect: item1, item2, item10.

Can I sort with case sensitivity?

Turn on "Case sensitive" to treat uppercase and lowercase letters as different. Leave it off and Apple and apple are treated as the same letters; when both appear, they keep the order they were in originally.

Can I just reverse or shuffle the order instead of sorting?

Yes. "Reverse order" flips the current line order end to end, with no sorting involved. "Shuffle" rearranges the lines randomly, like a lottery, and the "Shuffle again" button draws a fresh order each time.