↕️

Line Sorter

Sort lines alphabetically, by length, reverse order, or shuffle randomly.

Sort Order

About this tool

Sort lines of text in one click

This line sorter puts a list of lines in order. You can sort alphabetically (A to Z or Z to A), by length, reverse the order or shuffle the lines at random. It can also remove empty lines and duplicates at the same time.

How to use it

  1. Paste your list into Input Lines, one item per line.
  2. Choose a Sort Order.
  3. Tick the options you want: Case-insensitive, Remove empty lines or Remove duplicates.
  4. Click Sort Lines, then click Copy to copy the result.

Sort modes

ModeWhat it does
A → ZAlphabetical order, using your browser's locale rules
Z → AReverse alphabetical order
Shortest FirstLines with fewer characters come first
Longest FirstLines with more characters come first
Reverse OrderFlips the list, so the last line becomes the first
Random ShuffleMixes the lines with a Fisher–Yates shuffle

How it works

The text is split into lines at each line break. If you chose to remove empty lines, lines that are blank or only contain spaces are dropped first. Then the lines are sorted. Duplicates are removed last, and the first copy of each line is kept. With Case-insensitive on (the default), "Apple" and "apple" sort together and count as the same line for duplicates.

After sorting, three counters show the number of input lines, output lines and removed lines.

Tips

  • Lines with the same length keep their original order in Shortest First and Longest First.
  • Spaces at the start or end of a line count as characters and affect sorting.
  • Run Random Shuffle again to get a different order.

Frequently asked questions

How do I sort lines alphabetically?

Paste your list, pick A → Z and click Sort Lines. Leave Case-insensitive on if you want capital and small letters treated the same.

Can it remove duplicate lines?

Yes. Tick Remove duplicates before you sort. Only the first copy of each line is kept, and the removed count is shown below the result.

Is my text uploaded?

No. Sorting runs in your browser. Your list is not sent to a server.

More to explore

Related Text Tools

Browse all tools from the same category.

Showing 1-2 of 27