Sort Lines
Sort any list alphabetically, numerically, by length — or shuffle it randomly. One click per sort.
About this tool
Sorting a list is one of those tasks software does perfectly and humans do badly past about ten items: names for an invitation list, keywords from research, references for a bibliography, product SKUs, package imports. Paste the list, click a sort, copy it back — the whole transaction takes ten seconds.
Five sorts cover the real cases. A→Z and Z→A are the everyday pair, with locale-aware comparison so accented characters order correctly. Numeric sort reads the number at the start of each line and orders by value — critical because alphabetical sorting puts 10 before 2, the classic embarrassment of naive sorts. Length sort (shortest first) is quietly useful for keyword lists and CSS class audits. And Shuffle randomizes order using cryptographic randomness with a proper Fisher–Yates shuffle — genuinely fair for picking a presentation order or drawing sequence, not the biased approximations casual tools use.
Two toggles handle the details: ignore case (so "apple" and "Apple" sort together rather than upper-case-first) and remove empty lines while sorting. Combined with the Remove Duplicate Lines tool next door, this completes the list-cleaning workflow: dedupe, then sort, then paste the clean result wherever it was needed. Everything runs locally — client lists and unreleased data never leave your machine.
How to use the Sort Lines
- 1Paste your list, one item per line.
- 2Set the toggles: ignore case, remove empty lines.
- 3Click a sort: A→Z, Z→A, Numeric, By length, or Shuffle.
- 4Copy the result — run a different sort anytime, the input stays put.
Frequently asked questions
Why does alphabetical sorting put 10 before 2?
Because text comparison works character by character: '1' comes before '2', so '10' sorts before '2'. When your lines start with numbers, use the Numeric sort, which compares actual values — 2, then 10, then 100.
How does the case option affect sorting?
With 'ignore case' on (default), apple and Apple sort together as equals. Off, sorting is case-sensitive and follows character order strictly. For human-readable lists, ignoring case almost always gives the expected result.
Is the shuffle really random?
Yes — it uses a Fisher–Yates shuffle driven by the browser's cryptographic random source, giving every ordering equal probability. Fair enough for prize-draw sequences and randomized test orders, not just casual mixing.
Can it sort by the second word or a specific column?
This tool sorts whole lines from their first character. For column-based sorting, a spreadsheet is the right instrument — or if your data is CSV, convert it with the CSV to JSON tool and sort in code.
Related tools
Remove Duplicate Lines
Delete duplicate lines from any list in one click — with a count of exactly how many were removed.
Open toolText Reverser
Reverse text by characters, word order, or line order — instantly, as you type.
Open toolCase Converter
Convert text between UPPERCASE, lowercase, Title Case, Sentence case, camelCase and snake_case.
Open toolRandom Number Generator
Generate truly random numbers in any range — single picks, bulk lists, or unique draws with no repeats.
Open tool