Sort Text Lines

Paste the text, choose what to sort (lines, words or a separator you type) and the order. Options ignore letter case, remove duplicates, skip empty lines and follow a language rule. Lines with no numeric value go after the numbers in numeric sorts, and equal items keep their original order.

Sort Text Lines runs entirely in your browser: the text you paste is never sent to a server. It is free and needs no sign-up.

How to use it

  1. Choose what counts as an item Under Sort by, choose Lines, Words (split by spaces) or Custom separator. For a custom separator, type it in the box, such as a comma. An empty separator is read as a comma.
  2. Pick an order Choose an order such as A to Z, Number smallest first, Length, Natural or Shuffle at random. Tick Ignore uppercase and lowercase, Remove duplicates or Skip empty items as needed, and pick sorting language rules.
  3. Copy the sorted list The Items line shows how many items there were before and after sorting. Copy the result, or press Shuffle again for a new random order while Shuffle at random is chosen.

Questions

Why does 10 sort before 9 in A to Z order?

A to Z compares the text one character at a time, so the character 1 comes before 9. Choose Number, smallest first to sort by value. Items that are not numbers keep their original order and move after the numbers.

How does Shuffle at random work?

The shuffle uses a generator inside your browser, meant for ordering a list rather than for security. Each Shuffle again press gives a new order. For a secure random order, use the permutation mode of the Random Number Generator tool.