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
- 1Paste your list into the input panel
- 2Pick Mode: Alphabetical (default), Numeric, or By length
- 3Pick Order: A→Z (default) or Z→A
- 4Toggle Case sensitive in Alphabetical mode if casing matters
- 5For random order, use Shuffle instead
Keyboard shortcuts
Drive ListShift without touching the mouse.
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.
banana apple cherry
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) |