Sort Lines Online

Paste a list with one item on each line and choose how to order it. You can also remove repeated and empty lines in the same step.

Free Runs in your browser Checked Tuesday, November 10, 2026

One item on each line.

Apple and apple then sort together.

The first copy of each line stays.

Result

Sorted list

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Paste the list in Lines, with one item on each line.
  2. Choose the Order: alphabetical, natural, by length, reverse or random.
  3. Tick Ignore upper and lower case, Remove repeated lines or Remove empty lines if you need them.
  4. Copy the Sorted list, or save it with Download.

How the lines are put in order

Alphabetical order compares the lines letter by letter, using the collation rules of the page's language. Natural order reads each run of digits as one number, so file2 comes before file10. Length order puts the shortest line first and sorts lines of equal length alphabetically.

  • Z to A is the alphabetical order reversed.
  • Reverse the order of the lines keeps the lines as they are and only turns the list around. It does not sort them.

Turkish letters and the random shuffle

On the Turkish page the Turkish alphabet order is used: a b c ç d e f g ğ h ı i j k l m n o ö p r s ş t u ü v y z. So ı comes before i, and ş comes after s. The English page sorts the same letters by English rules.

The random shuffle takes its numbers from the browser's secure random source (crypto.getRandomValues) and uses the Fisher-Yates method, so every order is equally likely. Each change of a setting gives a new order.

What the tool does not do

  • It does not sort the words inside a line. Each line is one item.
  • It does not change the text of a line. Only the order of the lines changes, and the repeated or empty lines you asked to remove.

Worked example: a list of file names

The list has three lines, file10, file2 and file1. In alphabetical order the result is file1, file10, file2, because the comparison reads the 1 of file10 before the 2 of file2.

In natural order the digits are read as numbers, so the result is file1, file2, file10. Z to A gives the alphabetical order reversed.

Order Result
A to Z file1, file10, file2
Natural file1, file2, file10
Z to A file2, file10, file1

Frequently asked questions

Why does file10 come before file2 in alphabetical order?

Alphabetical order compares character by character. The first character that differs is 1 in file10 and 2 in file2, and 1 comes before 2. Choose Natural order to read the digits as numbers, so file2 comes before file10.

Does sorting change the text inside each line?

No. Each line is moved as it is. Only the order of the lines changes, and with Remove repeated lines or Remove empty lines switched on, the matching lines are dropped.

How random is the random shuffle?

It uses the random numbers that the browser provides for security (crypto.getRandomValues) with the Fisher-Yates method, so every order is equally likely. Change any setting to get another order.

Does the tool sort accented letters correctly?

Yes. The page's language decides the rules: on the English page an accented letter sorts with its plain letter, and on the Turkish page the Turkish alphabet is used, so ç follows c and ı comes before i.

Does my list leave my device?

No. The sorting runs in your browser. The list is not sent to our server, and the page does not store it.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.