Sort list lines online

Sort the lines of a list A→Z or Z→A, numerically, or by character length. Same op as Sort a list - this page is the line-focused framing. For shuffling, use Shuffle; there is no shuffle mode on this tool.

Input
Ready
Output
Live

Line-level sort with three modes

Alphabetical mode (default) uses `localeCompare` with `numeric: true` - so `file10` sorts after `file2` the way humans expect, not the raw ASCII order. Case sensitive off (default) makes `Alice` and `alice` equal for ordering; on uses `sensitivity: "case"` to distinguish them.

Numeric mode parses each line with `parseFloat` (prefix-based, so `42 apples` parses as 42). Lines that don't read as a plain number parse as `NaN` and keep their input-relative position (stable sort treats every `NaN` comparison as equal) - strip them first for a clean numeric-only result. By-length sorts by character count with alphabetical tiebreak.

Order flips asc/desc regardless of mode. No shuffle option on this tool - Shuffle a list handles that with Fisher-Yates, interleave, reverse-pairs, and block modes.

How to use sort list lines online

  1. 1Paste your list into the input panel
  2. 2Pick Mode: Alphabetical (default), Numeric, or By length
  3. 3Pick Order: A→Z (default) or Z→A
  4. 4Toggle Case sensitive in Alphabetical mode if casing matters
  5. 5For random order, use Shuffle instead

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this tool actually does

Same op as Sort a list; three modes, one case toggle.

Alphabetical with natural-order numerics

`localeCompare` with `numeric: true`. `file2` sorts before `file10`. Default and usually correct.

Numeric via parseFloat

Leading digits are parsed (`42 apples` → 42); lines that don't read as a plain number parse as `NaN` and keep their input-relative position (stable sort). For mixed alpha-numeric, use Alphabetical mode - it handles embedded numbers naturally via `localeCompare`.

By length with alphabetical tiebreak

Character count, ties broken alphabetically. Stable output - same input always gives same sorted result.

Case sensitivity: alpha always, by-length only on ties

In Alpha mode the toggle controls the whole compare. In By-length mode it only reads on the alphabetical tiebreak for same-length items (off = equal under base sensitivity, stable order; on = distinct). In Numeric mode the toggle is inert - `parseFloat` has no case dimension.

No shuffle mode

Sort is deterministic. For randomization, use Shuffle a list.

Common use cases

Where a line sort beats copying into a spreadsheet.

Deduping a copy-pasted list

Sort first, then Dedupe to collapse repeats - or use Remove repeats directly.

Version / filename ordering

Natural-order numerics put `v2` before `v10` and `file1.txt` before `file10.txt` without custom padding.

Numeric data review

Switch to Numeric mode for price lists, IDs, or any line-separated number column. Strip any text-only rows first - they parse as `NaN` and clutter the output.

Finding outliers by length

By-length mode surfaces the shortest (likely typos) or longest (likely run-on rows) entries. Chain Head or Tail to grab just those.

Worked example

Default Alphabetical mode, A→Z.

Input
banana
apple
cherry
Output
apple
banana
cherry

Settings reference

How each option shapes the sorted output using the sample above.

Setting What it does Effect on the sample
Mode: Alphabetical (default), Order: A→Z Unicode-aware sort with natural-order numerics `apple` / `banana` / `cherry`
Order: Z→A Reverses the direction of any mode `cherry` / `banana` / `apple`
Mode: By length Character count ascending, alpha tiebreak `apple` (5) / `banana` (6) / `cherry` (6)
Mode: Numeric `parseFloat` each line; non-numeric lines compare as "equal" to everything and keep their input-relative position All three lines are non-numeric → every comparison returns `NaN` (treated as equal) → stable sort preserves input order: `banana` / `apple` / `cherry`
Case sensitive: on (Alphabetical) Uppercase and lowercase sort distinctly No change on this sample (all lowercase)

FAQ

How is this different from Sort a list?
Same op, same options, same output. Sort a list is the main URL; this page is the line-focused framing. Pick whichever matches your search intent.
Can I shuffle / randomize instead of sort?
Not on this tool - sort is deterministic. Use Shuffle a list which offers Fisher-Yates random, interleave, and block-shuffle modes.
Why does `10` sort before `2` in other sorters?
Raw string comparison treats `"1"` as less than `"2"` character-by-character. This tool uses `localeCompare` with `numeric: true` so `"file2"` correctly sorts before `"file10"`.
Does Case sensitive affect Numeric or By-length modes?
Numeric: no - `parseFloat` has no letter-case dimension. By-length: on the alphabetical tiebreak, yes. Length mode compares `line.length` first (case-independent), but when two items share a length the tiebreak reads the toggle - off (default) treats `Apple` / `apple` as equal under base sensitivity; on distinguishes them. Same input with no same-length case-differing items → toggle has no visible effect.
Is the sort stable?
Yes - JavaScript `Array.prototype.sort` is stable since ES2019. Lines with equal sort keys keep original relative order.