Text Sorter

Sort lines alphabetically, by length or numerically — plus reverse and shuffle — using locale-aware collation.

Text Tools Runs in your browser · no upload

Reviewed 17 November 2026 · Free · No account needed

ExecutionYour browserInput never leaves your tab
File retentionNoneNothing is stored
AccountNot requiredNo sign-up, no paywall
PriceFreeNo trial, no usage cap on the tool itself

How to use

  1. Paste your list — one entry per line.
  2. Choose a sort mode (A→Z, length, numeric, reverse, shuffle).
  3. Optionally make ordering case-sensitive.
  4. Copy the sorted result.

Example

Input: banana, apple, cherry (A → Z)

Output: apple, banana, cherry

How it works

Lines are sorted alphabetically (A–Z or Z–A) using a standard string comparison. Empty lines are dropped from the sort unless you keep them.

Alphabetical modes use the Intl collator for English — case-insensitive and accent-aware by default, so accented letters sort near their base letter — with an option to compare case variants exactly. Length modes sort by line length and break ties alphabetically; numeric modes compare each line's numeric value.

Worked example

Sorting banana, Apple, apple, apricot A→Z (case-insensitive) gives Apple, apple, apricot, banana — 'Apple' and 'apple' compare as equal, so they keep their input order.

Edge cases to know

  • Numeric modes expect one number per line; non-numeric lines sort unpredictably.
  • Shuffle swaps lines using random numbers and cannot be reproduced.
  • Ties keep their original input order — the sort is stable.

Limits & compatibility

  • Numeric modes expect one number per line; non-numbers sort unpredictably.
  • Shuffle is random and cannot be reproduced.
  • Alphabetical order is locale 'en' collation — accented letters sort near their base letter.

Privacy

Your text never leaves the browser. There is no server call, no storage and no logging of content.

Related tools

FAQ

Questions about Text Sorter

What sort modes are available?

Alphabetical ascending and descending, shortest-first and longest-first, numeric ascending and descending, plus two non-sorting modes: reverse the current line order, and shuffle at random. There is also a case-sensitivity toggle. Sorting works on one entry per line, so paste each item on its own line before choosing a mode.

How are accented characters sorted?

With English locale collation, so accented letters sort next to their base letter — é sits beside e rather than after z. Case sensitivity is off by default, so 'apple' and 'Apple' are treated as equal; switch the toggle on and capital letters begin to order separately. The same collation handles the alphabetical tie-breaks in length mode.

What happens to lines that are not numbers in numeric mode?

Numeric mode expects one number per line and converts each line to a number for comparison. Lines that do not parse as numbers sort unpredictably rather than erroring, so clean the list first if mixed text is present. Numbers in decimal form are fine; headers, units and annotations belong on separate lines outside the numeric sort.

How are equal-length lines ordered in length mode?

Alphabetically, using the same English collation as the A→Z mode — the length comparison falls back to the text comparison when two lines are the same length, so ties resolve in a stable, predictable order rather than keeping them in arbitrary positions. Shortest-first and longest-first behave the same way on their ties.

Can I reproduce the same shuffle twice?

No. Shuffling is genuinely random each time you run it, so the same input produces a different order on every click — that is by design, not a bug. If you need a repeatable rearrangement, use reverse order instead, which deterministically flips the current line order and gives the identical result every time.