Text & DocumentsLive🔒 Private

Text Sorter

Sort lines of text alphabetically, numerically, or by length. Free online text sorter — ascending and descending. No signup, 100% private browser tool.

How it works

The Text Sorter sorts lines of text alphabetically, numerically, by length, or randomly (shuffle). It supports ascending and descending order, case-insensitive sorting, and natural sort order for strings containing numbers.

Sorting text is a surprisingly frequent need: alphabetizing lists of names, countries, or keywords; sorting version numbers correctly (1.10 should come after 1.9, not before it); ordering error messages in log files; and organizing configuration keys for easier reading.

How to use it: paste your list (one item per line). Select the sort mode: Alphabetical (A→Z or Z→A), Numerical (smallest to largest or largest to smallest), By Length (shortest to longest or longest to shortest), or Random (shuffle). Toggle "Case Insensitive" and "Remove Duplicates" for additional processing.

Natural sort: standard alphabetical sorting places "item10" before "item2" because "1" < "2" in ASCII. Natural sort correctly orders numeric segments as numbers — "item2" before "item10" — which is the behavior you'd expect from a file manager. Enable natural sort for version numbers, file names, and numbered lists.

CSV column sort: paste a single column of CSV data (with no header) to sort it alphabetically and paste it back into your spreadsheet.

Frequently Asked Questions

What is the difference between alphabetical and natural sort?
Alphabetical sort compares characters by Unicode code point — 'item10' comes before 'item2' because '1' (code 49) < '2' (code 50). Natural sort treats contiguous digit sequences as numbers — 'item2' correctly precedes 'item10'.
Can I sort numerically when the list contains non-numeric items?
In numerical sort mode, items that cannot be parsed as numbers are sorted to the end of the list. A warning is shown listing the non-numeric items.
Can I sort a list of IP addresses correctly?
Yes. Enable 'Natural sort' — it handles IP address components (192.168.1.10 sorts after 192.168.1.2 correctly).
Does the shuffle (random) mode use a good random number generator?
Yes. The shuffle uses the Fisher-Yates algorithm with random values from window.crypto.getRandomValues() for unbiased, cryptographically random shuffling.