Text Sorter

Sort lines of text by natural sort (file2 before file10), alphabetically, numerically, by length, or randomly — 100% in your browser, no upload.

Wrap & join the sorted list

🔒 Sorted in your browser — nothing is uploaded.

Sort any list of lines your way

Paste one item per line and instantly reorder the whole list. Choose alphabetical for A → Z, natural to run the way people expect filenames to — file2 before file10, with digit runs anywhere in the line compared as numbers — numeric to sort by the leading number in each line (so 2 comes before 10, unlike a plain text sort), by length to order from shortest to longest, or random to shuffle everything. Toggle case-insensitive matching, reverse the final order, remove duplicate lines, and trim leading/trailing spaces — all combine freely and the output updates live as you type.

Deterministic sorting, unbiased shuffle

Alphabetical, natural, numeric and length sorts are stable, so lines that compare equal keep their original relative order. Non-numeric lines are pushed to the end in numeric mode instead of being dropped — a line like file2 has no number at its start, so use natural sort for filenames. The random option is a Fisher–Yates shuffle seeded from your browser's cryptographic generator (crypto.getRandomValues), so which order you get is unpredictable. The seed is drawn once, when you choose the shuffle, and then held — so the order stays put while you keep typing or change another option, and Shuffle again is what deals a new one. Your text is never modified in place and never leaves your device — the result is one click away from your clipboard.

Frequently asked questions

How does numeric sorting decide the order?

It reads the number at the start of each line — so "2 apples" sorts before "10 apples" — and lines that don't begin with a number are kept and moved to the end. If the number is inside the line rather than at the start, as in file2 and file10, pick natural sort instead.

Is anything I paste uploaded to a server?

No. Every sort and shuffle happens entirely in your browser and your text never leaves your device — nothing is uploaded or stored.

What do the case-insensitive and remove-duplicates toggles do?

Case-insensitive makes alphabetical sorting and duplicate detection ignore letter case, and remove-duplicates keeps only the first occurrence of each identical line.