ToolLaunchpad
Text tools

Text Sorter: Sort Lines Online

Paste a list with one item per line and sort it alphabetically, by number or by length, reverse it or shuffle it randomly. The result updates as you type.

Text SorterRuns in your browser
  • 0lines in
  • 0lines out

Runs entirely in your browser. Nothing you enter is uploaded or stored.

How to sort lines

Paste your list into the box, one item per line, and pick an order. The sorted list appears below right away and can be copied with one click.

  • A to Z / Z to A sorts alphabetically. It uses natural order, so file 2 comes before file 10, and accented letters are sorted where readers expect them.
  • Numbers sorts by the first number found in each line, so prices, scores or IDs line up correctly even with text around them. Lines without a number go to the end.
  • Length sorts by the number of characters, which helps to find the shortest or longest entries.
  • Reverse flips the current order without sorting.
  • Shuffle puts the lines in random order using your browser's secure random generator. Press Sort again for a new shuffle.

Worked example

A list of chapters copied from a document:

Chapter 10
chapter 2
Chapter 1
Chapter 2

Sorted A to Z the result is Chapter 1, chapter 2, Chapter 2, Chapter 10: thanks to natural order, 10 comes last instead of after 1. Turn on Remove duplicates and the two "chapter 2" lines become one, because comparison ignores case unless Case-sensitive is switched on.

Typical uses

  • Sorting names, keywords, tags or bibliography entries alphabetically.
  • Ordering a list of scores or prices from highest to lowest.
  • Picking a random order for a raffle, presentation slots or a playlist.
  • Cleaning a spreadsheet column: copy it, sort and deduplicate here, and paste it back.

Your text never leaves your browser, so you can sort lists with private data safely. To only remove repeated lines while keeping the original order, use the duplicate line remover.

Common mistakes

  • Items separated by commas. The sorter works line by line. Put each item on its own line first, for example with your editor's find and replace.
  • Numbers sorted as text. Alphabetical order puts 100 before 20 in plain text sorters. Here natural order prevents that, and the number modes sort by value.
  • Hidden spaces. A leading space puts a line at the top. Keep Trim spaces on to ignore spaces at the start and end.

Frequently asked questions

How do I sort a list alphabetically?

Paste the list with one item per line and choose A to Z. The sorted result appears instantly below and can be copied with the Copy result button.

Does the text sorter handle numbers correctly?

Yes. Alphabetical sorting uses natural order, so 2 comes before 10. The number modes sort by the first number in each line, from small to large or large to small.

Can I sort lines randomly?

Yes. Choose Shuffle randomly. It uses your browser's cryptographic random generator; press Sort again for a new random order.

Is sorting case-sensitive?

Not by default: upper and lower case are sorted together. Switch on Case-sensitive if you want them treated as different.

Is my text uploaded?

No. Sorting happens entirely in your browser, nothing is sent to a server.

More free Launchpad tools