Text Tools

Sort a list of lines, properly

Paste a list and sort it — A to Z, by length, by the number in each line, or shuffled. The alphabetical sort orders embedded numbers the way a person would, which is the part most sorters get wrong.

Sort

Numbers inside the text sort in counting order, so "item 9" comes before "item 10".

Sorted

Paste a list above and the sorted version appears here.

  • Runs in your browser
  • No account required
  • Free to use

How it works

01

“item 9” comes before “item 10”

A plain alphabetical sort compares character by character, so “1” beats “9” and you get item 1, item 10, item 2. That is correct to a computer and wrong to everybody else. This sorts with numeric collation, which reads runs of digits as numbers, so numbered lists come out in counting order.

02

Numeric sorting knows what is not a number

Sorting by number reads the value at the start of each line. Lines that do not begin with one cannot be compared numerically, so instead of scrambling into the middle — which is what happens when a sort function is fed values it cannot compare — they are gathered at the end in alphabetical order.

03

The shuffle is a real shuffle

It uses Fisher–Yates, so every possible ordering is equally likely. The common shortcut is to sort by a random comparison, which is measurably biased — some orderings come up far more often than others — and is not something you would want deciding a running order or a draw.

What it does

Four ways to sort

Alphabetically, by line length, by the number in the line, or shuffled. Each can be reversed, so descending is a checkbox rather than a separate mode.

Shuffle again without retyping

A dedicated button re-shuffles the same list. Without it, getting a second ordering means editing the text and putting it back, which is exactly the kind of small indignity that makes a tool annoying.

Case handled sensibly

By default capitals and lowercase sort together, so “Apple” and “apricot” land next to each other rather than in separate blocks. Turn on case sensitivity to get the traditional capitals-first ordering.

Runs in your browser

No upload, no account, no server. Whatever you are sorting — names, addresses, exported data — stays on your machine, because the page makes no network requests at all.

Practical advice

Getting a better result

  • Sorting by length is a quick way to spot outliers in a list of supposedly uniform values — a truncated postcode or an over-long product code jumps straight to one end.
  • Blank lines are dropped by default. Untick that if the spacing in your list is meaningful.
  • To sort and deduplicate, remove duplicates first and sort the result. Sorting first works too, but then the duplicate count no longer reflects your original list.
  • The shuffle is fair enough to use for a draw or a running order, but it is not cryptographically secure and should not be used to generate anything secret.

Questions

Things people ask

Why do my numbered lines sort in the wrong order elsewhere?

Because most sorters compare text one character at a time, where “1” sorts before “9”, giving you item 1, item 10, item 11, item 2. This tool uses numeric collation, which reads a run of digits as a single number, so you get item 1, item 2, item 9, item 10.

What happens to lines that are not numbers when I sort by number?

They go to the end, in alphabetical order among themselves. Leaving them where a numeric comparison put them would scatter them unpredictably through the list, because a comparison involving a value that is not a number has no meaningful result.

Is the shuffle actually random?

It uses Fisher–Yates with the browser’s random number generator, so every ordering is equally likely — unlike the common trick of sorting by a random comparator, which is noticeably biased. It is fine for a draw or a running order. It is not cryptographically secure, so do not use it to generate passwords or anything that has to be unguessable.

Does it sort accented characters correctly?

It uses your browser’s locale-aware comparison, so accented letters sort next to their base letter rather than after Z — éclair files under E. Exact placement follows your browser’s locale, which is the same rule your operating system uses.

Who builds these

Free tools by day. Websites that earn their keep by trade.

KuConvert is built by KUDUY, a web design and development agency. From custom WordPress builds to SEO and e-commerce, everything they do is engineered to bring you more qualified traffic and turn it into revenue.

  • Fixed scope, no surprise invoices

    Most sites ship in four to eight weeks with the scope and the price agreed up front.

  • SEO from day one

    Search is designed into the build — structure, schema and Core Web Vitals — not retrofitted.

  • A team, not a ticket queue

    A project manager, a designer and a developer you can actually reach.

Need your whole site to load this fast?

Images are usually the heaviest thing on a page and the easiest win. KUDUY works on site speed, image delivery and Core Web Vitals for teams who would rather not do it by hand.

This tool runs entirely in your browser. Your files are never uploaded.