Skip to content
APK Peer

Sort Lines Alphabetically

Free · runs in your browser · nothing uploaded

Quick answer

This tool sorts any list of lines alphabetically from A to Z or Z to A, by line length, or into a random order. Numbers are sorted naturally, so 'item 2' comes before 'item 10', and capital letters don't push words out of order. Paste a list, choose an order and copy the result.

0 characters

How to sort lines

  1. Paste your list into the Input box, one item per line.
  2. Choose an order: A → Z, Z → A, By length or Shuffle.
  3. Tick Remove empty lines if your list has blank lines in it.
  4. Tap Copy result.

Sorting options explained

OrderWhat it doesExample use
A → ZAlphabetical, numbers in natural orderName lists, glossaries
Z → AReverse alphabeticalRanking from the end
By lengthShortest lines firstSpotting very long or short entries
ShuffleRandom orderQuiz questions, draws, playlists

The alphabetical sort uses natural ordering, which means numbers inside text are compared as numbers. "Episode 2" comes before "Episode 10", the way people expect, instead of the computer-style order that puts 10 first. It also ignores capital letters, so "android" and "Android" sort together, and it follows your browser's language rules for accented letters.

Shuffling fairly

Shuffle uses a Fisher–Yates shuffle powered by your browser's cryptographically secure random number generator. Every possible order is equally likely, so it's fair for picking turns, randomizing questions or ordering a draw. If you need to pick winners from the list, the random name picker does that directly.

Tips

  • Remove repeated entries first with remove duplicate lines, then sort.
  • To flip a list into its reverse order without sorting, use reverse text and choose Line order.
  • Use Use result as input to apply another step, such as sorting by length after sorting alphabetically.

Private and instant

Sorting happens in your browser, so your list is never uploaded. It works quickly even for lists with tens of thousands of lines.

Frequently asked questions

What is natural sorting?

Natural sorting treats numbers inside text as numbers, so 'file 2' comes before 'file 10'. Plain alphabetical sorting would put 'file 10' first because the character 1 comes before 2. This tool uses natural sorting by default.

Is the shuffle really random?

Yes. Shuffle uses your browser's cryptographically secure random number generator and a standard Fisher–Yates shuffle, so every order is equally likely. That makes it fair for drawing names or randomizing quiz questions.

Does sorting ignore capital letters?

Yes. 'apple' and 'Apple' sort together rather than all capitalized words coming first. Accented letters are sorted according to your browser's language rules.

Last updated by the APKPeer Editorial Team. Read our privacy policy for how the site handles data.