ZapKit

Sort Lines Alphabetically

Paste a list and sort it A to Z or Z to A with numbers in the right order, by length, by leading number, or shuffle it into a random order.

What is a line sorter?

A line sorter rearranges a list so each entry is in order. It saves time when you're alphabetising names for a class register, ordering a glossary, arranging references, ranking keywords by length or reversing a log so the newest entry is first.

This sorter offers natural alphabetical order in both directions, sorting by line length, sorting by the number each line starts with, reversing the current order and a fair random shuffle. Removing duplicates and empty lines can happen in the same pass, so a messy pasted list comes out clean and ordered at once.

How to sort a list alphabetically

  1. 1.Paste the lines

    Any list with one entry per line.

  2. 2.Pick the order

    Alphabetical, reverse, shortest or longest first, by the number at the start, reversed or shuffled.

  3. 3.Tidy as you sort

    Optionally remove duplicates and blank lines in the same step, then copy the result.

Example: mixed names and numbered items

Lines: item 10, item 2, Item 1, zebra, apple, item 2, Mango. Sorted A to Z (natural):

1–2
apple, Item 1
3–5
item 2, item 2, item 10
6–7
Mango, zebra
With Remove duplicates
6 lines, one item 2

Item 1, item 2 and item 10 come out in numeric order, not the 1, 10, 2 a basic sort produces.

Natural order, so 2 comes before 10

Plain computer sorting compares character by character, which puts "item 10" before "item 2". This sorter uses natural ordering, reading runs of digits as numbers, so chapters, file names and versions line up the way a person would expect.

By default capitals are ignored, so "apple" and "Apple" sit together. Tick Capitals before lower case for strict ordering. Shuffle uses your browser's cryptographic random generator, so every order is equally likely.

Frequently asked questions

Why did item 10 come after item 2?

That's natural sorting: numbers inside text are compared by value, not digit by digit.

Can I sort a list of numbers?

Yes. Choose By leading number to sort by the number at the start of each line, including decimals, negatives and thousands separators.

How do I randomise a list?

Choose Shuffle randomly. Change any setting or choose it again to get a new order.

Does it handle accented letters?

Yes. Letters like é and ü sort next to e and u, following standard English collation.

More Utilities tools