Skip to content
AdeptBay

Sort Lines

Alphabetical, numeric, by length or shuffled — with correct accent handling.

Runs in your browserNo sign-upNo file limitAPI available
0 chars · 0 lines
Options

On puts all capitals before all lowercase, the way a byte sort does.

Sorted list

Start typing above and the result appears here.

How to use Sort Lines

  1. Paste your list

    One item per line. Any line ending works.

  2. Choose the order

    Alphabetical uses natural sorting, so "item 2" comes before "item 10".

  3. Copy the result

    Or download it as a text file if the list is long.

Why use this sort lines

  • Runs on your device

    Your input is handled entirely in this browser tab. Nothing is uploaded, so there is nothing for us to store, log or leak.

  • No sign-up, no quota

    No account, no daily limit, no watermark and no email wall. Use it once or two hundred times a day.

  • Built to be linked

    Options are stored in the URL, so a configured tool is a link you can send to a colleague or bookmark.

Technical notes

Two things separate this from a one-line JavaScript sort. First, numeric-aware collation, so item 2 precedes item 10. Second, Intl.Collator for accents and non-Latin scripts, so élan lands next to elan rather than at the end of the list. Both are what a person means by "alphabetical" and neither is what Array.prototype.sort does by default.

Same input, three sorting strategies

InputByte sortThis tool (A → Z)
item 10, item 2item 10, item 2item 2, item 10
élan, echo, zebraecho, zebra, élanecho, élan, zebra
Apple, apple, BananaApple, Banana, appleApple, apple, Banana

Supported

  • Natural numeric ordering inside strings
  • Locale-aware collation for accents and non-Latin scripts
  • Length sorting with an alphabetical tiebreak
  • Cryptographically uniform shuffle

Limits and trade-offs

  • Sorting is by whole line. Sort by a CSV column by extracting the column first.
  • Collation follows the browser's locale. A German and a Swedish browser will order ä differently — correctly, in both cases.

Last verified August 2026 · benchmarks re-run each quarter.

Frequently asked questions

Why does "item 2" come before "item 10"?

Because this sort is numeric-aware. A plain string sort compares character by character, so "1" beats "2" and you get item 1, item 10, item 2. Natural sorting reads runs of digits as numbers, which is what people actually mean by alphabetical.

How are accented characters sorted?

Through Intl.Collator, the browser's own locale-aware comparison. "élan" sorts next to "elan" rather than after "z", which is what a byte-order sort would do because é has a higher code point than every unaccented Latin letter.

What happens to lines with no number in numeric mode?

They move to the bottom, in alphabetical order among themselves. Scattering them randomly through the result — which is what NaN comparisons do if unhandled — makes the output impossible to scan.

Is the shuffle actually random?

It is a Fisher-Yates shuffle drawing from crypto.getRandomValues, with rejection sampling to remove modulo bias. Every permutation is equally likely, which is not true of the common "sort by Math.random()" one-liner.

Does sorting remove duplicates?

No. Sorting and deduplication are separate operations here so you can do one without the other. Run the Remove Duplicate Lines tool first if you want both.

Guide: how to use the Sort Lines, step by stepThe longer version — alternatives, trade-offs, and the mistakes that waste the most time.