✎ TEXT · UTILITY

Sort Lines Alphabetically

Sort any list A–Z or Z–A in one click. Natural sorting puts file2 before file10, numeric sorting understands negatives and decimals, and you can sort by length, reverse or shuffle — with optional trimming, blank-line removal and de-duplication.

7 sort methods · Language-aware A–Z · Stable & fast
Tip: drop a .txt or .csv file onto the input — big lists are sorted in the background.Only need to remove repeats, keeping order? Remove Duplicate Lines →
Input lines One item per line
Sorted lines
Lines: –
Result: –
Removed: –
Time: –
Stable sort · 100% Client-Side
◆ ABOUT THIS TOOL

Sorting Text the Way People Expect

A plain computer sort compares character codes — which is why “Zebra” lands before “apple” and “file10” before “file2”. This tool fixes both.

Alphabetical and Natural use your browser's language-aware collation, so accented letters sort with their base letter (é next to e), and upper- and lowercase words are interleaved rather than split into two groups.

Natural additionally compares runs of digits as numbers: chapter 2, chapter 10, chapter 100 — the order a human would choose. It's the default because it is what most lists need.

Code point is the strict computer order (all uppercase before lowercase, by Unicode value) — useful when the result must match what sort, databases or Array.prototype.sort() produce.

Number in line sorts by the first number found in each line (prices, scores, versions, negative and decimal numbers; thousands separators like 1,250 are understood). Lines without a number go to the end. All sorts are stable: equal lines keep their original relative order.

⇅ METHODS

Sort Methods Compared

The same list — item10, Item2, apple, item1, Éclair — sorted each way (A → Z).

A

Alphabetical

Language-aware, digits compared one by one: apple, Éclair, item1, item10, Item2.

2

Natural

Numbers compared by value: apple, Éclair, item1, Item2, item10.

#

Code point

Raw Unicode order, uppercase first: Item2, apple, item1, item10, Éclair (with Ignore case off).

↔

Length · Number · Reverse · Shuffle

Shortest first; by the first number in the line; the current order flipped; or a fair random order (crypto-random Fisher–Yates).

◐ THREE STEPS

How to Use the Sort Lines Alphabetically

Get your result in under ten seconds.

1

Paste your lines

One item per line, or open/drop a text file.

2

Pick a method and direction

Natural A → Z is the default. Toggle case, trimming, blank lines and duplicates — the result updates instantly.

3

Copy or download

Copy the sorted list, download it as .txt, or press “Use as input” to keep editing.

✓ FEATURES

Why Use the Sort Lines Alphabetically on Developers Web Tools

Fast, accurate and private — built for developers.

🔢

Natural sorting

file2 before file10, v1.9 before v1.10 — numbers compared by value.

🌍

Language-aware

Accents and mixed case sorted the way people expect, using the browser's collation.

🧮

Numeric sort

Sort by the first number in each line, including negatives, decimals and 1,250-style numbers.

🎲

Fair shuffle

Cryptographically random Fisher–Yates shuffle — every order equally likely.

⚡

Fast on huge lists

Stable O(n log n) sorting; large inputs run in a background thread.

🔒

Private

Sorting happens entirely in your browser.

FAQ

Frequently Asked Questions

Natural sorting treats groups of digits as whole numbers, so img2.png comes before img10.png. A plain alphabetical sort compares character by character and puts img10 first because “1” is less than “2”.

Because they sort by character code, where all uppercase letters (A–Z) come before lowercase (a–z). Here, Alphabetical and Natural ignore case by default; choose Code point with Ignore case off if you need that strict order.

They are placed after all lines that contain a number, in their original order, for both directions. The first number in a line is used — v2 build 7 sorts as 2.

Yes. Lines that compare as equal (for example “apple” and “Apple” with Ignore case on, or two lines of the same length) keep their original relative order.

Nothing — direction applies to the comparison methods only. Reverse flips your current order; Shuffle creates a new random order each time you run it.

Hundreds of thousands. Inputs over 256 KB are sorted in a background worker, and files up to 50 MB can be opened.

No. Everything runs locally in your browser.