Sort Lines

Sort lines alphabetically or numerically in one click — with options for case, natural number order, and blank-line cleanup.

How it works

Plain alphabetical sorting puts uppercase before lowercase (“Zebra” before “apple”); the case-insensitive option compares lowercase forms so words order the way a dictionary would. Numeric sort understands embedded numbers, so “item2” correctly comes before “item10” instead of after it. Z–A simply reverses the comparison, and the empty-line toggle drops blank rows before sorting. Sorting is stable and deterministic, so the same input always produces the same output.

How to use

  1. Paste your lines into the "Lines to sort" box.
  2. Choose A–Z or Z–A direction.
  3. Tick "Case-insensitive" for dictionary-style ordering, or leave it off for strict character-code order.
  4. Tick "Numeric (natural) sort" when lines contain numbers, so item2 correctly lands before item10.
  5. Optionally remove empty lines, then copy the sorted result from the output box.

Frequently asked questions

Why does "Zebra" sort before "apple"?

Plain alphabetical sorting compares character codes, and uppercase A–Z (codes 65–90) come before lowercase a–z (codes 97–122). The case-insensitive option compares lowercase forms instead, ordering words the way a dictionary would.

What is numeric (natural) sort?

It understands numbers embedded in text: item2 comes before item10, where plain text sorting would put item10 first because the character "1" is less than "2". Use it for filenames, versioned labels, and numbered lists.

What does Z–A do?

It runs the same comparison in reverse, largest-first instead of smallest-first. Combined with the other options, it gives you reverse dictionary order or reverse numeric order.

What counts as an empty line?

Any line containing nothing but spaces or tabs. Tick "Remove empty lines" to drop those rows before sorting, which tidies up lists pasted from documents with stray blank lines.

Is the sort stable?

Yes. Sorting is stable and deterministic: identical lines keep their original relative order, and the same input always produces the same output. That matters when you sort data where duplicate keys carry meaning in their original sequence, like log lines sharing a timestamp.

Can I sort numbers with decimals?

Yes — numeric sort compares embedded numbers by value, so 2.5 sorts before 10.25. Plain alphabetical mode would order them as text instead, putting "10.25" first because "1" comes before "2".