Blog
Text tools

Sort strings (lines) alphabetically

Paste your list with one item per line, and every line is sorted from A to Z as you type. Turn on natural sort so numbers inside the text order the way people expect (2 before 10), and case-insensitive matching so "apple" and "Apple" land next to each other.

Your data never leaves this device

Result

Lines sorted

This page has no server side at all. The table you paste is parsed by JavaScript inside your own browser, the chart is drawn on a canvas element on your machine, and the export file is assembled locally. Nothing is uploaded, stored or written to any log. You can disconnect from the network after the page has loaded and everything will still work — which is the simplest way to verify the claim yourself.

Facts and limits of this method

Sort direction Ascending, A→Z (use Reverse Alphabetical Sort for Z→A)
Comparison Unicode code-point order by default, or locale-aware natural order with the option on
Case handling Case-insensitive by default: "apple" and "Apple" compare equal
Empty lines Sorted along with the rest — they float to the top
Duplicates Kept by default; the checkbox removes repeats after sorting
Stability Equal lines (after case folding) keep their relative input order

When it misleads you

How it is calculated

The text is split into lines on line breaks, then run through JavaScript's Array.sort with a comparator you control from the checkboxes above.

With case-insensitive on, both lines being compared are lowercased before comparing, so the visible casing plays no role in ordering — only the letters and their sequence do.

Natural sort switches to localeCompare with numeric mode, which treats consecutive digits as a single number instead of comparing them character by character, so "item 9" comes before "item 10".

When duplicate removal is on, it runs after sorting: lines that compare equal under the current case setting are collapsed to a single line, keeping the first one encountered.

Questions and answers

Does this sort by line or by word?

By line. Each line of the input becomes one item to sort. To sort individual words instead, use the Alphabetical Word Sorter.

How do I sort Z to A instead?

Use the Reverse Alphabetical Sort tool — it's the same logic run in the opposite direction, with its own options for case and natural sort.

Why is "10" sorted before "2"?

That's plain text sorting: character by character, "1" is smaller than "2", so "10" comes first. Turn on natural sort to get numeric order instead.

What happens to blank lines?

They're treated as ordinary (empty) lines and sorted along with everything else — usually ending up at the very top.

Is my list uploaded anywhere?

No. Sorting happens entirely in your browser; nothing is sent to a server.

Related tools

All tools