Loona Automation logoLoona Text Tools
Home › Text Tools › Sort Lines

Sort Lines - Alphabetical, Length, Reverse or Random

In short: the Line Sorter rearranges the lines of your text A-Z, Z-A, shortest-first, longest-first, in reverse order, or shuffled at random - in one click.

Names for a draw, students for a register, keywords for a report - lists are easier to use when they are in order. Paste your lines, pick a sorting style, and the whole list is rearranged instantly.

Private by design: everything in this tool happens 100% in your browser with JavaScript. Your text is never uploaded to a server, never stored and never seen by us - close the tab and everything is gone.

How to use the Sort Lines

  1. Paste your list into the box - one item per line.
  2. Choose the order: A-Z, Z-A, by length, reversed, or a fair random shuffle.
  3. Click Sort Lines, then copy or download the reordered list.

How it works

Alphabetical sorting uses natural ordering, so 'Item 2' correctly comes before 'Item 10' - plain character sorting would get that wrong. Length sorting measures each line in characters and is stable, so equal-length lines keep their relative order. The random shuffle uses the Fisher-Yates method, the same fair algorithm used for card shuffling, so every line has an equal chance of landing anywhere - ideal for prize draws and turn-taking lists.

Worked example

You paste: 'Pear', 'Fig', 'Banana', 'Kiwi'. Shortest-first gives Fig, Pear, Kiwi, Banana. A-Z gives Banana, Fig, Kiwi, Pear. The same four lines, three useful orders, one click each.

Frequently Asked Questions

Is the line sorter free?

Yes - free, with no sign-up and no line limit beyond your device's memory.

Does A-Z sorting handle numbers correctly?

Yes - it uses natural sort order, so 'Chapter 2' comes before 'Chapter 10'.

Is the random shuffle really fair?

Yes - it uses the Fisher-Yates shuffle, where every possible order is equally likely. Good for draws, raffles and choosing who presents first.

Can I remove duplicates at the same time?

Use the Remove Duplicate Lines tool first, then sort - both are one click.

Is my list uploaded?

No - sorting happens entirely in your browser.

Related Text Tools

Embed this tool on your website โ€” free

Add this tool to your own website or blog โ€” it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.